hi,
i have reorganized a lot of my HLSL shadercode but still could not solve the following problem
// e.g. the include file of global usable constants
static const uint gc_diffuse_lambert = 1; // global const for lambert diffuse brdf option
static const uint gc_material_opaque = 5; // global const for material type opaque
in my shadercode i want to access them like
if ( diffuse_type == globals.gc_diffuse_lambert)
{
// do something
}
I know how to set a constantbuffer definition in HLSL shadercode that does exactly what i want (i use them this way all the time), but a constantbuffer cannot be initialized in the shadercode.
I search a method that lets me define the constants as part of a “pseudo struct”
something.member or somethin::member
thanks for all answers