Debian Codegraph @

third_party/spirv-cross/reference/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 float2 uv = gl_FragCoord.xy;
46 int index = int(mod(uv.x, 4.0f));
47 myType elt = _21[index];
48 if (elt.data > 0.0f)
49 {
50 o_color = float4(0.0f, 1.0f, 0.0f, 1.0f);
51 }
52 else
53 {
54 o_color = float4(1.0f, 0.0f, 0.0f, 1.0f);
55 }
56 }
57
58 SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
59 {
60 gl_FragCoord = stage_input.gl_FragCoord;
61 gl_FragCoord.w = 1.0 / gl_FragCoord.w;
62 frag_main();
63 SPIRV_Cross_Output stage_output;
64 stage_output.o_color = o_color;
65 return stage_output;
66 }