Debian Codegraph @

third_party/spirv-cross/reference/opt/shaders-hlsl/frag/sample-mask-in.frag

raw
1 static int gl_SampleID;
2 static int gl_SampleMaskIn;
3 static float4 FragColor;
4
5 struct SPIRV_Cross_Input
6 {
7 uint gl_SampleID : SV_SampleIndex;
8 uint gl_SampleMaskIn : SV_Coverage;
9 };
10
11 struct SPIRV_Cross_Output
12 {
13 float4 FragColor : SV_Target0;
14 };
15
16 void frag_main()
17 {
18 if ((gl_SampleMaskIn & (1 << gl_SampleID)) != 0)
19 {
20 FragColor = 1.0f.xxxx;
21 }
22 }
23
24 SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
25 {
26 gl_SampleID = stage_input.gl_SampleID;
27 gl_SampleMaskIn = stage_input.gl_SampleMaskIn;
28 frag_main();
29 SPIRV_Cross_Output stage_output;
30 stage_output.FragColor = FragColor;
31 return stage_output;
32 }