some more shader functions changed to macros

This commit is contained in:
Turánszki János
2025-05-28 09:27:34 +02:00
parent 6120c54409
commit be1c8c6fd2
3 changed files with 8 additions and 32 deletions
+3 -12
View File
@@ -3,18 +3,9 @@
#include "globals.hlsli"
#include "ShaderInterop_EmittedParticle.h"
ShaderMeshInstance EmitterGetInstance()
{
return load_instance(xEmitterInstanceIndex);
}
ShaderGeometry EmitterGetGeometry()
{
return load_geometry(EmitterGetInstance().geometryOffset);
}
ShaderMaterial EmitterGetMaterial()
{
return load_material(EmitterGetGeometry().materialIndex);
}
#define EmitterGetInstance() (load_instance(xEmitterInstanceIndex))
#define EmitterGetGeometry() (load_geometry(EmitterGetInstance().geometryOffset))
#define EmitterGetMaterial() (load_material(EmitterGetGeometry().materialIndex))
struct VertextoPixel
{
+3 -12
View File
@@ -3,18 +3,9 @@
#include "globals.hlsli"
#include "ShaderInterop_HairParticle.h"
ShaderMeshInstance HairGetInstance()
{
return load_instance(xHairInstanceIndex);
}
ShaderGeometry HairGetGeometry()
{
return load_geometry(HairGetInstance().geometryOffset);
}
ShaderMaterial HairGetMaterial()
{
return load_material(HairGetGeometry().materialIndex);
}
#define HairGetInstance() (load_instance(xHairInstanceIndex))
#define HairGetGeometry() (load_geometry(HairGetInstance().geometryOffset))
#define HairGetMaterial() (load_material(HairGetGeometry().materialIndex))
struct VertexToPixel
{
+2 -8
View File
@@ -49,14 +49,8 @@
PUSHCONSTANT(push, ObjectPushConstants);
inline ShaderGeometry GetMesh()
{
return load_geometry(push.geometryIndex);
}
inline ShaderMaterial GetMaterial()
{
return load_material(push.materialIndex);
}
#define GetMesh() (load_geometry(push.geometryIndex))
#define GetMaterial() (load_material(push.materialIndex))
#define sampler_objectshader bindless_samplers[descriptor_index(GetMaterial().sampler_descriptor)]