226d837d7e
HLSL just picked the variable name which did not work as expected for some users. Use the same logic as GLSL and set up declared_block_names, so the actual name can be queried later.
31 lines
435 B
GLSL
31 lines
435 B
GLSL
cbuffer Registers
|
|
{
|
|
float registers_foo : packoffset(c0);
|
|
};
|
|
|
|
|
|
static float FragColor;
|
|
|
|
struct SPIRV_Cross_Output
|
|
{
|
|
float FragColor : SV_Target0;
|
|
};
|
|
|
|
float add_value(float v, float w)
|
|
{
|
|
return v + w;
|
|
}
|
|
|
|
void frag_main()
|
|
{
|
|
FragColor = add_value(10.0f, registers_foo);
|
|
}
|
|
|
|
SPIRV_Cross_Output main()
|
|
{
|
|
frag_main();
|
|
SPIRV_Cross_Output stage_output;
|
|
stage_output.FragColor = FragColor;
|
|
return stage_output;
|
|
}
|