Debian Codegraph @

third_party/spirv-cross/reference/opt/shaders-hlsl/asm/frag/single-function-private-lut.asm.frag

raw
1 struct myType
2 {
3 float data;
4 };
5
6 static const myType _18 = { 0.0f };
7 static const myType _20 = { 1.0f };
8 static const myType _21[5] = { { 0.0f }, { 1.0f }, { 0.0f }, { 1.0f }, { 0.0f } };
9
10 static float4 gl_FragCoord;
11 static float4 o_color;
12
13 struct SPIRV_Cross_Input
14 {
15 float4 gl_FragCoord : SV_Position;
16 };
17
18 struct SPIRV_Cross_Output
19 {
20 float4 o_color : SV_Target0;
21 };
22
23 float mod(float x, float y)
24 {
25 return x - y * floor(x / y);
26 }
27
28 float2 mod(float2 x, float2 y)
29 {
30 return x - y * floor(x / y);
31 }
32
33 float3 mod(float3 x, float3 y)
34 {
35 return x - y * floor(x / y);
36 }
37
38 float4 mod(float4 x, float4 y)
39 {
40 return x - y * floor(x / y);
41 }
42
43 void frag_main()
44 {
45 if (_21[int(mod(gl_FragCoord.x, 4.0f))].data > 0.0f)
46 {
47 o_color = float4(0.0f, 1.0f, 0.0f, 1.0f);
48 }
49 else
50 {
51 o_color = float4(1.0f, 0.0f, 0.0f, 1.0f);
52 }
53 }
54
55 SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
56 {
57 gl_FragCoord = stage_input.gl_FragCoord;
58 gl_FragCoord.w = 1.0 / gl_FragCoord.w;
59 frag_main();
60 SPIRV_Cross_Output stage_output;
61 stage_output.o_color = o_color;
62 return stage_output;
63 }