SPIRV-Cross/reference/opt/shaders-hlsl/frag/spec-constant-block-size.frag
Hans-Kristian Arntzen dd603eab58 Support spec constant array size in blocks.
Won't really be correct if the spec constant is changed outside
SPIRV-Cross, but nothing we can do about that, really.
2018-02-23 15:11:45 +01:00

34 lines
562 B
GLSL

static const int Value = 2;
cbuffer _15 : register(b0)
{
float4 _15_samples[Value] : packoffset(c0);
};
static float4 FragColor;
static int Index;
struct SPIRV_Cross_Input
{
nointerpolation int Index : TEXCOORD0;
};
struct SPIRV_Cross_Output
{
float4 FragColor : SV_Target0;
};
void frag_main()
{
FragColor = _15_samples[Index];
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
Index = stage_input.Index;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;
return stage_output;
}