SPIRV-Cross/reference/shaders-hlsl/frag/sample-mask-out.frag
Hans-Kristian Arntzen 0bedb69b02 HLSL: Declare sample mask array with proper module type.
GLSL uses int[] and HLSL emits uint[], and to deal properly
with array copies where we lose ability to rewrite arithmetic types,
we need to declare with proper type.
2023-10-23 12:29:25 +02:00

24 lines
435 B
GLSL

static int gl_SampleMask[1];
static float4 FragColor;
struct SPIRV_Cross_Output
{
float4 FragColor : SV_Target0;
uint gl_SampleMask : SV_Coverage;
};
void frag_main()
{
FragColor = 1.0f.xxxx;
gl_SampleMask[0] = 0;
}
SPIRV_Cross_Output main()
{
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.gl_SampleMask = gl_SampleMask[0];
stage_output.FragColor = FragColor;
return stage_output;
}