1 module shaders.offscreen;
2 import sg = sokol.gfx;
3 import m = handmade.math;
4 extern(C):
5 
6 /*
7     #version:1# (machine generated, don't edit!)
8 
9     Generated by sokol-shdc (https://github.com/floooh/sokol-tools)
10 
11     Cmdline:
12         sokol-shdc -i src/examples/shaders/offscreen.glsl -o src/examples/shaders/offscreen.d -l glsl410:glsl300es:metal_macos:hlsl5:wgsl -f sokol_d
13 
14     Overview:
15     =========
16     Shader program: 'default':
17         Get shader desc: defaultShaderDesc(sg.queryBackend());
18         Vertex Shader: vs_default
19         Fragment Shader: fs_default
20         Attributes:
21             ATTR_DEFAULT_POSITION => 0
22             ATTR_DEFAULT_NORMAL => 1
23             ATTR_DEFAULT_TEXCOORD0 => 2
24     Shader program: 'offscreen':
25         Get shader desc: offscreenShaderDesc(sg.queryBackend());
26         Vertex Shader: vs_offscreen
27         Fragment Shader: fs_offscreen
28         Attributes:
29             ATTR_OFFSCREEN_POSITION => 0
30             ATTR_OFFSCREEN_NORMAL => 1
31     Bindings:
32         Uniform block 'vs_params':
33             D struct: VsParams
34             Bind slot: UB_VS_PARAMS => 0
35         Image 'tex':
36             Image type: sg.ImageType._2d
37             Sample type: sg.ImageSampleType.Float
38             Multisampled: false
39             Bind slot: IMG_TEX => 0
40         Sampler 'smp':
41             Type: sg.SamplerType.Filtering
42             Bind slot: SMP_SMP => 0
43 */
44 enum ATTR_DEFAULT_POSITION = 0;
45 enum ATTR_DEFAULT_NORMAL = 1;
46 enum ATTR_DEFAULT_TEXCOORD0 = 2;
47 enum ATTR_OFFSCREEN_POSITION = 0;
48 enum ATTR_OFFSCREEN_NORMAL = 1;
49 enum UB_VS_PARAMS = 0;
50 enum IMG_TEX = 0;
51 enum SMP_SMP = 0;
52 struct VsParams {
53     align(16) m.Mat4 mvp;
54 }
55 /*
56     #version 410
57 
58     uniform vec4 vs_params[4];
59     layout(location = 0) in vec4 position;
60     layout(location = 0) out vec4 nrm;
61     layout(location = 1) in vec4 normal;
62 
63     void main()
64     {
65         gl_Position = mat4(vs_params[0], vs_params[1], vs_params[2], vs_params[3]) * position;
66         nrm = normal;
67     }
68 
69 */
70 __gshared char[280] VS_OFFSCREEN_SOURCE_GLSL410 = [
71     0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e,
72     0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,0x5f,0x70,0x61,
73     0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,
74     0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,
75     0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,
76     0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,
77     0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x6e,0x72,
78     0x6d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,
79     0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,
80     0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,
81     0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,
82     0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d,0x61,0x74,0x34,0x28,0x76,0x73,
83     0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,
84     0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,
85     0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,
86     0x73,0x5b,0x33,0x5d,0x29,0x20,0x2a,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
87     0x3b,0x0a,0x20,0x20,0x20,0x20,0x6e,0x72,0x6d,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,
88     0x61,0x6c,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
89 ];
90 /*
91     #version 410
92 
93     layout(location = 0) out vec4 frag_color;
94     layout(location = 0) in vec4 nrm;
95 
96     void main()
97     {
98         frag_color = vec4((nrm.xyz * 0.5) + vec3(0.5), 1.0);
99     }
100 
101 */
102 __gshared char[166] FS_OFFSCREEN_SOURCE_GLSL410 = [
103     0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x6c,0x61,
104     0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,
105     0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,
106     0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,
107     0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,
108     0x76,0x65,0x63,0x34,0x20,0x6e,0x72,0x6d,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,
109     0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,
110     0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x28,
111     0x6e,0x72,0x6d,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,
112     0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,
113     0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
114 ];
115 /*
116     #version 410
117 
118     uniform vec4 vs_params[4];
119     layout(location = 0) in vec4 position;
120     layout(location = 1) out vec2 uv;
121     layout(location = 2) in vec2 texcoord0;
122     layout(location = 0) out vec4 nrm;
123     layout(location = 1) in vec4 normal;
124 
125     void main()
126     {
127         mat4 _22 = mat4(vs_params[0], vs_params[1], vs_params[2], vs_params[3]);
128         gl_Position = _22 * position;
129         uv = texcoord0;
130         nrm = _22 * normal;
131     }
132 
133 */
134 __gshared char[400] VS_DEFAULT_SOURCE_GLSL410 = [
135     0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e,
136     0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,0x5f,0x70,0x61,
137     0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,
138     0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,
139     0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,
140     0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,
141     0x3d,0x20,0x31,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x32,0x20,0x75,0x76,
142     0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,
143     0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x74,
144     0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,
145     0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,
146     0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x6e,0x72,0x6d,0x3b,0x0a,0x6c,0x61,0x79,
147     0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,
148     0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,
149     0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,
150     0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x74,0x34,0x20,0x5f,0x32,0x32,0x20,0x3d,0x20,
151     0x6d,0x61,0x74,0x34,0x28,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,
152     0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,
153     0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2c,0x20,0x76,
154     0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,0x29,0x3b,0x0a,0x20,0x20,
155     0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,
156     0x5f,0x32,0x32,0x20,0x2a,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,
157     0x20,0x20,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,
158     0x64,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6e,0x72,0x6d,0x20,0x3d,0x20,0x5f,0x32,
159     0x32,0x20,0x2a,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
160 
161 ];
162 /*
163     #version 410
164 
165     uniform sampler2D tex_smp;
166 
167     layout(location = 1) in vec2 uv;
168     layout(location = 0) in vec4 nrm;
169     layout(location = 0) out vec4 frag_color;
170 
171     void main()
172     {
173         frag_color = vec4(texture(tex_smp, uv * vec2(20.0, 10.0)).xyz * fma(clamp(dot(nrm.xyz, vec3(0.57735025882720947265625, 0.57735025882720947265625, -0.57735025882720947265625)), 0.0, 1.0), 2.0, 0.25), 1.0);
174     }
175 
176 */
177 __gshared char[379] FS_DEFAULT_SOURCE_GLSL410 = [
178     0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e,
179     0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20,
180     0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,
181     0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,
182     0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x75,0x76,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,
183     0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,
184     0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x6e,0x72,0x6d,0x3b,0x0a,0x6c,0x61,0x79,
185     0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,
186     0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,
187     0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,
188     0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,
189     0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x74,0x65,0x78,0x74,
190     0x75,0x72,0x65,0x28,0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76,0x20,
191     0x2a,0x20,0x76,0x65,0x63,0x32,0x28,0x32,0x30,0x2e,0x30,0x2c,0x20,0x31,0x30,0x2e,
192     0x30,0x29,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x66,0x6d,0x61,0x28,0x63,0x6c,
193     0x61,0x6d,0x70,0x28,0x64,0x6f,0x74,0x28,0x6e,0x72,0x6d,0x2e,0x78,0x79,0x7a,0x2c,
194     0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x37,0x37,0x33,0x35,0x30,0x32,0x35,
195     0x38,0x38,0x32,0x37,0x32,0x30,0x39,0x34,0x37,0x32,0x36,0x35,0x36,0x32,0x35,0x2c,
196     0x20,0x30,0x2e,0x35,0x37,0x37,0x33,0x35,0x30,0x32,0x35,0x38,0x38,0x32,0x37,0x32,
197     0x30,0x39,0x34,0x37,0x32,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x2d,0x30,0x2e,0x35,
198     0x37,0x37,0x33,0x35,0x30,0x32,0x35,0x38,0x38,0x32,0x37,0x32,0x30,0x39,0x34,0x37,
199     0x32,0x36,0x35,0x36,0x32,0x35,0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,
200     0x2e,0x30,0x29,0x2c,0x20,0x32,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x32,0x35,0x29,0x2c,
201     0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
202 ];
203 /*
204     #version 300 es
205 
206     uniform vec4 vs_params[4];
207     layout(location = 0) in vec4 position;
208     out vec4 nrm;
209     layout(location = 1) in vec4 normal;
210 
211     void main()
212     {
213         gl_Position = mat4(vs_params[0], vs_params[1], vs_params[2], vs_params[3]) * position;
214         nrm = normal;
215     }
216 
217 */
218 __gshared char[262] VS_OFFSCREEN_SOURCE_GLSL300ES = [
219     0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a,
220     0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,
221     0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,
222     0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,
223     0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,
224     0x6e,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x6e,0x72,0x6d,0x3b,
225     0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,
226     0x20,0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x6e,0x6f,
227     0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,
228     0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,
229     0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d,0x61,0x74,0x34,0x28,0x76,0x73,0x5f,0x70,
230     0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,
231     0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,
232     0x73,0x5b,0x32,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,
233     0x33,0x5d,0x29,0x20,0x2a,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,
234     0x20,0x20,0x20,0x20,0x6e,0x72,0x6d,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,
235     0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
236 ];
237 /*
238     #version 300 es
239     precision mediump float;
240     precision highp int;
241 
242     layout(location = 0) out highp vec4 frag_color;
243     in highp vec4 nrm;
244 
245     void main()
246     {
247         frag_color = vec4((nrm.xyz * 0.5) + vec3(0.5), 1.0);
248     }
249 
250 */
251 __gshared char[206] FS_OFFSCREEN_SOURCE_GLSL300ES = [
252     0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a,
253     0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d,
254     0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69,
255     0x6f,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x69,0x6e,0x74,0x3b,0x0a,0x0a,0x6c,
256     0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,
257     0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,
258     0x63,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x69,
259     0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x6e,0x72,0x6d,
260     0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,
261     0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,
262     0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x28,0x6e,0x72,0x6d,0x2e,0x78,0x79,0x7a,0x20,
263     0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,
264     0x35,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
265 ];
266 /*
267     #version 300 es
268 
269     uniform vec4 vs_params[4];
270     layout(location = 0) in vec4 position;
271     out vec2 uv;
272     layout(location = 2) in vec2 texcoord0;
273     out vec4 nrm;
274     layout(location = 1) in vec4 normal;
275 
276     void main()
277     {
278         mat4 _22 = mat4(vs_params[0], vs_params[1], vs_params[2], vs_params[3]);
279         gl_Position = _22 * position;
280         uv = texcoord0;
281         nrm = _22 * normal;
282     }
283 
284 */
285 __gshared char[361] VS_DEFAULT_SOURCE_GLSL300ES = [
286     0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a,
287     0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,
288     0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,
289     0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,
290     0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,
291     0x6e,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x32,0x20,0x75,0x76,0x3b,0x0a,
292     0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,
293     0x3d,0x20,0x32,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x74,0x65,0x78,
294     0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,
295     0x20,0x6e,0x72,0x6d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,
296     0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,
297     0x63,0x34,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,
298     0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,
299     0x74,0x34,0x20,0x5f,0x32,0x32,0x20,0x3d,0x20,0x6d,0x61,0x74,0x34,0x28,0x76,0x73,
300     0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,
301     0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,
302     0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,
303     0x73,0x5b,0x33,0x5d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,
304     0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x5f,0x32,0x32,0x20,0x2a,0x20,0x70,
305     0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x76,0x20,
306     0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x20,0x20,0x20,
307     0x20,0x6e,0x72,0x6d,0x20,0x3d,0x20,0x5f,0x32,0x32,0x20,0x2a,0x20,0x6e,0x6f,0x72,
308     0x6d,0x61,0x6c,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
309 ];
310 /*
311     #version 300 es
312     precision mediump float;
313     precision highp int;
314 
315     uniform highp sampler2D tex_smp;
316 
317     in highp vec2 uv;
318     in highp vec4 nrm;
319     layout(location = 0) out highp vec4 frag_color;
320 
321     void main()
322     {
323         frag_color = vec4(texture(tex_smp, uv * vec2(20.0, 10.0)).xyz * (clamp(dot(nrm.xyz, vec3(0.57735025882720947265625, 0.57735025882720947265625, -0.57735025882720947265625)), 0.0, 1.0) * 2.0 + 0.25), 1.0);
324     }
325 
326 */
327 __gshared char[409] FS_DEFAULT_SOURCE_GLSL300ES = [
328     0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a,
329     0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d,
330     0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69,
331     0x6f,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x69,0x6e,0x74,0x3b,0x0a,0x0a,0x75,
332     0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x73,0x61,0x6d,
333     0x70,0x6c,0x65,0x72,0x32,0x44,0x20,0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x3b,0x0a,
334     0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x75,
335     0x76,0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,
336     0x20,0x6e,0x72,0x6d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,
337     0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x68,
338     0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,
339     0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,
340     0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,
341     0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x74,0x65,0x78,0x74,0x75,
342     0x72,0x65,0x28,0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76,0x20,0x2a,
343     0x20,0x76,0x65,0x63,0x32,0x28,0x32,0x30,0x2e,0x30,0x2c,0x20,0x31,0x30,0x2e,0x30,
344     0x29,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,
345     0x64,0x6f,0x74,0x28,0x6e,0x72,0x6d,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x76,0x65,0x63,
346     0x33,0x28,0x30,0x2e,0x35,0x37,0x37,0x33,0x35,0x30,0x32,0x35,0x38,0x38,0x32,0x37,
347     0x32,0x30,0x39,0x34,0x37,0x32,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x35,
348     0x37,0x37,0x33,0x35,0x30,0x32,0x35,0x38,0x38,0x32,0x37,0x32,0x30,0x39,0x34,0x37,
349     0x32,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x2d,0x30,0x2e,0x35,0x37,0x37,0x33,0x35,
350     0x30,0x32,0x35,0x38,0x38,0x32,0x37,0x32,0x30,0x39,0x34,0x37,0x32,0x36,0x35,0x36,
351     0x32,0x35,0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x20,
352     0x2a,0x20,0x32,0x2e,0x30,0x20,0x2b,0x20,0x30,0x2e,0x32,0x35,0x29,0x2c,0x20,0x31,
353     0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
354 ];
355 /*
356     cbuffer vs_params : register(b0)
357     {
358         row_major float4x4 _19_mvp : packoffset(c0);
359     };
360 
361 
362     static float4 gl_Position;
363     static float4 position;
364     static float4 nrm;
365     static float4 normal;
366 
367     struct SPIRV_Cross_Input
368     {
369         float4 position : TEXCOORD0;
370         float4 normal : TEXCOORD1;
371     };
372 
373     struct SPIRV_Cross_Output
374     {
375         float4 nrm : TEXCOORD0;
376         float4 gl_Position : SV_Position;
377     };
378 
379     void vert_main()
380     {
381         gl_Position = mul(position, _19_mvp);
382         nrm = normal;
383     }
384 
385     SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
386     {
387         position = stage_input.position;
388         normal = stage_input.normal;
389         vert_main();
390         SPIRV_Cross_Output stage_output;
391         stage_output.gl_Position = gl_Position;
392         stage_output.nrm = nrm;
393         return stage_output;
394     }
395 */
396 __gshared char[738] VS_OFFSCREEN_SOURCE_HLSL5 = [
397     0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,
398     0x73,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x62,0x30,0x29,
399     0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x6f,0x77,0x5f,0x6d,0x61,0x6a,0x6f,0x72,
400     0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x5f,0x31,0x39,0x5f,0x6d,0x76,
401     0x70,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,
402     0x30,0x29,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,
403     0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,
404     0x6f,0x6e,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,
405     0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x73,0x74,0x61,0x74,
406     0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6e,0x72,0x6d,0x3b,0x0a,0x73,
407     0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6e,0x6f,0x72,
408     0x6d,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,
409     0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x0a,0x7b,
410     0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x70,0x6f,0x73,0x69,
411     0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,
412     0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6e,0x6f,0x72,
413     0x6d,0x61,0x6c,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,0x3b,
414     0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,
415     0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x0a,0x7b,
416     0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6e,0x72,0x6d,0x20,
417     0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x20,0x20,0x20,
418     0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,
419     0x69,0x6f,0x6e,0x20,0x3a,0x20,0x53,0x56,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,
420     0x6e,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x76,0x65,0x72,0x74,
421     0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,
422     0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d,0x75,0x6c,0x28,
423     0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x5f,0x31,0x39,0x5f,0x6d,0x76,
424     0x70,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6e,0x72,0x6d,0x20,0x3d,0x20,0x6e,0x6f,
425     0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,
426     0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,
427     0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,
428     0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,
429     0x7b,0x0a,0x20,0x20,0x20,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,
430     0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x70,0x6f,0x73,
431     0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6e,0x6f,0x72,0x6d,0x61,
432     0x6c,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,
433     0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x72,0x74,
434     0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,
435     0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,
436     0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,
437     0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x67,
438     0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x67,0x6c,0x5f,
439     0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,
440     0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x6e,0x72,0x6d,0x20,0x3d,
441     0x20,0x6e,0x72,0x6d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,
442     0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,
443     0x0a,0x00,
444 ];
445 /*
446     static float4 frag_color;
447     static float4 nrm;
448 
449     struct SPIRV_Cross_Input
450     {
451         float4 nrm : TEXCOORD0;
452     };
453 
454     struct SPIRV_Cross_Output
455     {
456         float4 frag_color : SV_Target0;
457     };
458 
459     void frag_main()
460     {
461         frag_color = float4((nrm.xyz * 0.5f) + 0.5f.xxx, 1.0f);
462     }
463 
464     SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
465     {
466         nrm = stage_input.nrm;
467         frag_main();
468         SPIRV_Cross_Output stage_output;
469         stage_output.frag_color = frag_color;
470         return stage_output;
471     }
472 */
473 __gshared char[463] FS_OFFSCREEN_SOURCE_HLSL5 = [
474     0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72,
475     0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,
476     0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6e,0x72,0x6d,0x3b,0x0a,0x0a,0x73,0x74,
477     0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,
478     0x5f,0x49,0x6e,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
479     0x61,0x74,0x34,0x20,0x6e,0x72,0x6d,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,
480     0x52,0x44,0x30,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,
481     0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,
482     0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,
483     0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x53,0x56,0x5f,
484     0x54,0x61,0x72,0x67,0x65,0x74,0x30,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x76,0x6f,0x69,
485     0x64,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,
486     0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,
487     0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x28,0x6e,0x72,0x6d,0x2e,0x78,0x79,0x7a,
488     0x20,0x2a,0x20,0x30,0x2e,0x35,0x66,0x29,0x20,0x2b,0x20,0x30,0x2e,0x35,0x66,0x2e,
489     0x78,0x78,0x78,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x53,
490     0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,
491     0x74,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,
492     0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,
493     0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6e,0x72,0x6d,0x20,
494     0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x6e,0x72,
495     0x6d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,
496     0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,
497     0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,
498     0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,
499     0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,
500     0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,
501     0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,
502     0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00,
503 ];
504 /*
505     cbuffer vs_params : register(b0)
506     {
507         row_major float4x4 _19_mvp : packoffset(c0);
508     };
509 
510 
511     static float4 gl_Position;
512     static float4 position;
513     static float2 uv;
514     static float2 texcoord0;
515     static float4 nrm;
516     static float4 normal;
517 
518     struct SPIRV_Cross_Input
519     {
520         float4 position : TEXCOORD0;
521         float4 normal : TEXCOORD1;
522         float2 texcoord0 : TEXCOORD2;
523     };
524 
525     struct SPIRV_Cross_Output
526     {
527         float4 nrm : TEXCOORD0;
528         float2 uv : TEXCOORD1;
529         float4 gl_Position : SV_Position;
530     };
531 
532     void vert_main()
533     {
534         gl_Position = mul(position, _19_mvp);
535         uv = texcoord0;
536         nrm = mul(normal, _19_mvp);
537     }
538 
539     SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
540     {
541         position = stage_input.position;
542         texcoord0 = stage_input.texcoord0;
543         normal = stage_input.normal;
544         vert_main();
545         SPIRV_Cross_Output stage_output;
546         stage_output.gl_Position = gl_Position;
547         stage_output.uv = uv;
548         stage_output.nrm = nrm;
549         return stage_output;
550     }
551 */
552 __gshared char[941] VS_DEFAULT_SOURCE_HLSL5 = [
553     0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,
554     0x73,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x62,0x30,0x29,
555     0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x6f,0x77,0x5f,0x6d,0x61,0x6a,0x6f,0x72,
556     0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x5f,0x31,0x39,0x5f,0x6d,0x76,
557     0x70,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,
558     0x30,0x29,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,
559     0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,
560     0x6f,0x6e,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,
561     0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x73,0x74,0x61,0x74,
562     0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x75,0x76,0x3b,0x0a,0x73,0x74,
563     0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x74,0x65,0x78,0x63,
564     0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,
565     0x6f,0x61,0x74,0x34,0x20,0x6e,0x72,0x6d,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,
566     0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,
567     0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,
568     0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
569     0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,
570     0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x20,0x20,0x20,
571     0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x3a,
572     0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,
573     0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,
574     0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x32,0x3b,0x0a,0x7d,0x3b,
575     0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,
576     0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,
577     0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6e,0x72,0x6d,0x20,0x3a,0x20,0x54,
578     0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
579     0x6f,0x61,0x74,0x32,0x20,0x75,0x76,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,
580     0x52,0x44,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,
581     0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x53,0x56,
582     0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x76,
583     0x6f,0x69,0x64,0x20,0x76,0x65,0x72,0x74,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,
584     0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,
585     0x6e,0x20,0x3d,0x20,0x6d,0x75,0x6c,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
586     0x2c,0x20,0x5f,0x31,0x39,0x5f,0x6d,0x76,0x70,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,
587     0x75,0x76,0x20,0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,
588     0x20,0x20,0x20,0x20,0x6e,0x72,0x6d,0x20,0x3d,0x20,0x6d,0x75,0x6c,0x28,0x6e,0x6f,
589     0x72,0x6d,0x61,0x6c,0x2c,0x20,0x5f,0x31,0x39,0x5f,0x6d,0x76,0x70,0x29,0x3b,0x0a,
590     0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,
591     0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50,0x49,0x52,0x56,
592     0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20,0x73,0x74,0x61,
593     0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
594     0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,
595     0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,
596     0x0a,0x20,0x20,0x20,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x3d,
597     0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x74,0x65,0x78,
598     0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6e,0x6f,0x72,0x6d,
599     0x61,0x6c,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,
600     0x2e,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x72,
601     0x74,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,
602     0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,
603     0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,
604     0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,
605     0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x67,0x6c,
606     0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,
607     0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x75,0x76,0x20,0x3d,
608     0x20,0x75,0x76,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,
609     0x75,0x74,0x70,0x75,0x74,0x2e,0x6e,0x72,0x6d,0x20,0x3d,0x20,0x6e,0x72,0x6d,0x3b,
610     0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x61,0x67,
611     0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00,
612 ];
613 /*
614     Texture2D<float4> tex : register(t0);
615     SamplerState smp : register(s0);
616 
617     static float2 uv;
618     static float4 nrm;
619     static float4 frag_color;
620 
621     struct SPIRV_Cross_Input
622     {
623         float4 nrm : TEXCOORD0;
624         float2 uv : TEXCOORD1;
625     };
626 
627     struct SPIRV_Cross_Output
628     {
629         float4 frag_color : SV_Target0;
630     };
631 
632     void frag_main()
633     {
634         frag_color = float4(tex.Sample(smp, uv * float2(20.0f, 10.0f)).xyz * mad(clamp(dot(nrm.xyz, float3(0.57735025882720947265625f, 0.57735025882720947265625f, -0.57735025882720947265625f)), 0.0f, 1.0f), 2.0f, 0.25f), 1.0f);
635     }
636 
637     SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
638     {
639         uv = stage_input.uv;
640         nrm = stage_input.nrm;
641         frag_main();
642         SPIRV_Cross_Output stage_output;
643         stage_output.frag_color = frag_color;
644         return stage_output;
645     }
646 */
647 __gshared char[769] FS_DEFAULT_SOURCE_HLSL5 = [
648     0x54,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x44,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x34,
649     0x3e,0x20,0x74,0x65,0x78,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,
650     0x28,0x74,0x30,0x29,0x3b,0x0a,0x53,0x61,0x6d,0x70,0x6c,0x65,0x72,0x53,0x74,0x61,
651     0x74,0x65,0x20,0x73,0x6d,0x70,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,
652     0x72,0x28,0x73,0x30,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,
653     0x6c,0x6f,0x61,0x74,0x32,0x20,0x75,0x76,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,
654     0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6e,0x72,0x6d,0x3b,0x0a,0x73,0x74,0x61,
655     0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,
656     0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,
657     0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,
658     0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6e,0x72,
659     0x6d,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x20,
660     0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x75,0x76,0x20,0x3a,0x20,0x54,
661     0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,
662     0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,
663     0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
664     0x6f,0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,
665     0x3a,0x20,0x53,0x56,0x5f,0x54,0x61,0x72,0x67,0x65,0x74,0x30,0x3b,0x0a,0x7d,0x3b,
666     0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,
667     0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,
668     0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x74,0x65,0x78,
669     0x2e,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76,0x20,
670     0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x32,0x30,0x2e,0x30,0x66,0x2c,0x20,
671     0x31,0x30,0x2e,0x30,0x66,0x29,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x6d,0x61,
672     0x64,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x64,0x6f,0x74,0x28,0x6e,0x72,0x6d,0x2e,
673     0x78,0x79,0x7a,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x35,0x37,
674     0x37,0x33,0x35,0x30,0x32,0x35,0x38,0x38,0x32,0x37,0x32,0x30,0x39,0x34,0x37,0x32,
675     0x36,0x35,0x36,0x32,0x35,0x66,0x2c,0x20,0x30,0x2e,0x35,0x37,0x37,0x33,0x35,0x30,
676     0x32,0x35,0x38,0x38,0x32,0x37,0x32,0x30,0x39,0x34,0x37,0x32,0x36,0x35,0x36,0x32,
677     0x35,0x66,0x2c,0x20,0x2d,0x30,0x2e,0x35,0x37,0x37,0x33,0x35,0x30,0x32,0x35,0x38,
678     0x38,0x32,0x37,0x32,0x30,0x39,0x34,0x37,0x32,0x36,0x35,0x36,0x32,0x35,0x66,0x29,
679     0x29,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x2c,0x20,
680     0x32,0x2e,0x30,0x66,0x2c,0x20,0x30,0x2e,0x32,0x35,0x66,0x29,0x2c,0x20,0x31,0x2e,
681     0x30,0x66,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,
682     0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x28,
683     0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,
684     0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,
685     0x0a,0x20,0x20,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,
686     0x69,0x6e,0x70,0x75,0x74,0x2e,0x75,0x76,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6e,0x72,
687     0x6d,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,
688     0x6e,0x72,0x6d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,
689     0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,
690     0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73,0x74,0x61,
691     0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,
692     0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,
693     0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,
694     0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,
695     0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,
696     0x00,
697 ];
698 /*
699     #include <metal_stdlib>
700     #include <simd/simd.h>
701 
702     using namespace metal;
703 
704     struct vs_params
705     {
706         float4x4 mvp;
707     };
708 
709     struct main0_out
710     {
711         float4 nrm [[user(locn0)]];
712         float4 gl_Position [[position]];
713     };
714 
715     struct main0_in
716     {
717         float4 position [[attribute(0)]];
718         float4 normal [[attribute(1)]];
719     };
720 
721     vertex main0_out main0(main0_in in [[stage_in]], constant vs_params& _19 [[buffer(0)]])
722     {
723         main0_out out = {};
724         out.gl_Position = _19.mvp * in.position;
725         out.nrm = in.normal;
726         return out;
727     }
728 
729 */
730 __gshared char[505] VS_OFFSCREEN_SOURCE_METAL_MACOS = [
731     0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
732     0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
733     0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
734     0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
735     0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x76,
736     0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,
737     0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x6d,0x76,0x70,0x3b,0x0a,0x7d,0x3b,0x0a,
738     0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,
739     0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6e,
740     0x72,0x6d,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,
741     0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,
742     0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,
743     0x69,0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,
744     0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,
745     0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,
746     0x6f,0x6e,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x30,
747     0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,
748     0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,
749     0x74,0x65,0x28,0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x76,0x65,0x72,
750     0x74,0x65,0x78,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,
751     0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,
752     0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,0x63,0x6f,
753     0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,
754     0x26,0x20,0x5f,0x31,0x39,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,
755     0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,
756     0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,
757     0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,
758     0x6f,0x6e,0x20,0x3d,0x20,0x5f,0x31,0x39,0x2e,0x6d,0x76,0x70,0x20,0x2a,0x20,0x69,
759     0x6e,0x2e,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,
760     0x6f,0x75,0x74,0x2e,0x6e,0x72,0x6d,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x6e,0x6f,0x72,
761     0x6d,0x61,0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,
762     0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
763 ];
764 /*
765     #include <metal_stdlib>
766     #include <simd/simd.h>
767 
768     using namespace metal;
769 
770     struct main0_out
771     {
772         float4 frag_color [[color(0)]];
773     };
774 
775     struct main0_in
776     {
777         float4 nrm [[user(locn0)]];
778     };
779 
780     fragment main0_out main0(main0_in in [[stage_in]])
781     {
782         main0_out out = {};
783         out.frag_color = float4((in.nrm.xyz * 0.5) + float3(0.5), 1.0);
784         return out;
785     }
786 
787 */
788 __gshared char[350] FS_OFFSCREEN_SOURCE_METAL_MACOS = [
789     0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
790     0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
791     0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
792     0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
793     0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,
794     0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,
795     0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,
796     0x20,0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,
797     0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,
798     0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,
799     0x6e,0x72,0x6d,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,
800     0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,
801     0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,
802     0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,
803     0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,
804     0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,
805     0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,
806     0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,
807     0x34,0x28,0x28,0x69,0x6e,0x2e,0x6e,0x72,0x6d,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,
808     0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,
809     0x35,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,
810     0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
811 ];
812 /*
813     #include <metal_stdlib>
814     #include <simd/simd.h>
815 
816     using namespace metal;
817 
818     struct vs_params
819     {
820         float4x4 mvp;
821     };
822 
823     struct main0_out
824     {
825         float4 nrm [[user(locn0)]];
826         float2 uv [[user(locn1)]];
827         float4 gl_Position [[position]];
828     };
829 
830     struct main0_in
831     {
832         float4 position [[attribute(0)]];
833         float4 normal [[attribute(1)]];
834         float2 texcoord0 [[attribute(2)]];
835     };
836 
837     vertex main0_out main0(main0_in in [[stage_in]], constant vs_params& _19 [[buffer(0)]])
838     {
839         main0_out out = {};
840         out.gl_Position = _19.mvp * in.position;
841         out.uv = in.texcoord0;
842         out.nrm = _19.mvp * in.normal;
843         return out;
844     }
845 
846 */
847 __gshared char[612] VS_DEFAULT_SOURCE_METAL_MACOS = [
848     0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
849     0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
850     0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
851     0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
852     0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x76,
853     0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,
854     0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x6d,0x76,0x70,0x3b,0x0a,0x7d,0x3b,0x0a,
855     0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,
856     0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6e,
857     0x72,0x6d,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,
858     0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x75,
859     0x76,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x31,0x29,0x5d,
860     0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,
861     0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,
862     0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,
863     0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,
864     0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,
865     0x6e,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x30,0x29,
866     0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6e,
867     0x6f,0x72,0x6d,0x61,0x6c,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,
868     0x65,0x28,0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
869     0x74,0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x5b,0x5b,0x61,
870     0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x32,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,
871     0x3b,0x0a,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,
872     0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,
873     0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,
874     0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x76,0x73,0x5f,
875     0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x31,0x39,0x20,0x5b,0x5b,0x62,0x75,
876     0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,
877     0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,
878     0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,
879     0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x5f,0x31,0x39,0x2e,0x6d,
880     0x76,0x70,0x20,0x2a,0x20,0x69,0x6e,0x2e,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
881     0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x75,0x76,0x20,0x3d,0x20,0x69,
882     0x6e,0x2e,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x20,0x20,0x20,
883     0x20,0x6f,0x75,0x74,0x2e,0x6e,0x72,0x6d,0x20,0x3d,0x20,0x5f,0x31,0x39,0x2e,0x6d,
884     0x76,0x70,0x20,0x2a,0x20,0x69,0x6e,0x2e,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,
885     0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,
886     0x7d,0x0a,0x0a,0x00,
887 ];
888 /*
889     #include <metal_stdlib>
890     #include <simd/simd.h>
891 
892     using namespace metal;
893 
894     struct main0_out
895     {
896         float4 frag_color [[color(0)]];
897     };
898 
899     struct main0_in
900     {
901         float4 nrm [[user(locn0)]];
902         float2 uv [[user(locn1)]];
903     };
904 
905     fragment main0_out main0(main0_in in [[stage_in]], texture2d<float> tex [[texture(0)]], sampler smp [[sampler(0)]])
906     {
907         main0_out out = {};
908         out.frag_color = float4(tex.sample(smp, (in.uv * float2(20.0, 10.0))).xyz * fma(fast::clamp(dot(in.nrm.xyz, float3(0.57735025882720947265625, 0.57735025882720947265625, -0.57735025882720947265625)), 0.0, 1.0), 2.0, 0.25), 1.0);
909         return out;
910     }
911 
912 */
913 __gshared char[610] FS_DEFAULT_SOURCE_METAL_MACOS = [
914     0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
915     0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
916     0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
917     0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
918     0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,
919     0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,
920     0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,
921     0x20,0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,
922     0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,
923     0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,
924     0x6e,0x72,0x6d,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,
925     0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,
926     0x75,0x76,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x31,0x29,
927     0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,
928     0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,
929     0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,
930     0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,0x74,0x65,0x78,0x74,0x75,
931     0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x74,0x65,0x78,0x20,
932     0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,
933     0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x20,0x73,0x6d,0x70,0x20,0x5b,0x5b,0x73,0x61,
934     0x6d,0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,
935     0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,
936     0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,
937     0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,
938     0x34,0x28,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,
939     0x2c,0x20,0x28,0x69,0x6e,0x2e,0x75,0x76,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,
940     0x32,0x28,0x32,0x30,0x2e,0x30,0x2c,0x20,0x31,0x30,0x2e,0x30,0x29,0x29,0x29,0x2e,
941     0x78,0x79,0x7a,0x20,0x2a,0x20,0x66,0x6d,0x61,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,
942     0x63,0x6c,0x61,0x6d,0x70,0x28,0x64,0x6f,0x74,0x28,0x69,0x6e,0x2e,0x6e,0x72,0x6d,
943     0x2e,0x78,0x79,0x7a,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x35,
944     0x37,0x37,0x33,0x35,0x30,0x32,0x35,0x38,0x38,0x32,0x37,0x32,0x30,0x39,0x34,0x37,
945     0x32,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x35,0x37,0x37,0x33,0x35,0x30,
946     0x32,0x35,0x38,0x38,0x32,0x37,0x32,0x30,0x39,0x34,0x37,0x32,0x36,0x35,0x36,0x32,
947     0x35,0x2c,0x20,0x2d,0x30,0x2e,0x35,0x37,0x37,0x33,0x35,0x30,0x32,0x35,0x38,0x38,
948     0x32,0x37,0x32,0x30,0x39,0x34,0x37,0x32,0x36,0x35,0x36,0x32,0x35,0x29,0x29,0x2c,
949     0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x2c,0x20,0x32,0x2e,0x30,0x2c,
950     0x20,0x30,0x2e,0x32,0x35,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,
951     0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,
952     0x0a,0x00,
953 ];
954 /*
955     diagnostic(off, derivative_uniformity);
956 
957     struct vs_params {
958       /_ @offset(0) _/
959       mvp : mat4x4f,
960     }
961 
962     @group(0) @binding(0) var<uniform> x_19 : vs_params;
963 
964     var<private> position_1 : vec4f;
965 
966     var<private> nrm : vec4f;
967 
968     var<private> normal : vec4f;
969 
970     var<private> gl_Position : vec4f;
971 
972     fn main_1() {
973       let x_22 : mat4x4f = x_19.mvp;
974       let x_25 : vec4f = position_1;
975       gl_Position = (x_22 * x_25);
976       let x_31 : vec4f = normal;
977       nrm = x_31;
978       return;
979     }
980 
981     struct main_out {
982       @builtin(position)
983       gl_Position : vec4f,
984       @location(0)
985       nrm_1 : vec4f,
986     }
987 
988     @vertex
989     fn main(@location(0) position_1_param : vec4f, @location(1) normal_param : vec4f) -> main_out {
990       position_1 = position_1_param;
991       normal = normal_param;
992       main_1();
993       return main_out(gl_Position, nrm);
994     }
995 
996 */
997 __gshared char[758] VS_OFFSCREEN_SOURCE_WGSL = [
998     0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20,
999     0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f,
1000     0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,
1001     0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x7b,0x0a,0x20,0x20,0x2f,0x2a,
1002     0x20,0x40,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x30,0x29,0x20,0x2a,0x2f,0x0a,0x20,
1003     0x20,0x6d,0x76,0x70,0x20,0x3a,0x20,0x6d,0x61,0x74,0x34,0x78,0x34,0x66,0x2c,0x0a,
1004     0x7d,0x0a,0x0a,0x40,0x67,0x72,0x6f,0x75,0x70,0x28,0x30,0x29,0x20,0x40,0x62,0x69,
1005     0x6e,0x64,0x69,0x6e,0x67,0x28,0x30,0x29,0x20,0x76,0x61,0x72,0x3c,0x75,0x6e,0x69,
1006     0x66,0x6f,0x72,0x6d,0x3e,0x20,0x78,0x5f,0x31,0x39,0x20,0x3a,0x20,0x76,0x73,0x5f,
1007     0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,
1008     0x76,0x61,0x74,0x65,0x3e,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,
1009     0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,
1010     0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x6e,0x72,0x6d,0x20,0x3a,0x20,0x76,0x65,
1011     0x63,0x34,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,
1012     0x65,0x3e,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,
1013     0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,
1014     0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x76,
1015     0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,
1016     0x28,0x29,0x20,0x7b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x32,0x20,
1017     0x3a,0x20,0x6d,0x61,0x74,0x34,0x78,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x31,0x39,
1018     0x2e,0x6d,0x76,0x70,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x35,
1019     0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x70,0x6f,0x73,0x69,0x74,
1020     0x69,0x6f,0x6e,0x5f,0x31,0x3b,0x0a,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,
1021     0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x28,0x78,0x5f,0x32,0x32,0x20,0x2a,0x20,0x78,
1022     0x5f,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x31,
1023     0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,
1024     0x6c,0x3b,0x0a,0x20,0x20,0x6e,0x72,0x6d,0x20,0x3d,0x20,0x78,0x5f,0x33,0x31,0x3b,
1025     0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,
1026     0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,
1027     0x20,0x20,0x40,0x62,0x75,0x69,0x6c,0x74,0x69,0x6e,0x28,0x70,0x6f,0x73,0x69,0x74,
1028     0x69,0x6f,0x6e,0x29,0x0a,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,
1029     0x6f,0x6e,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x20,0x20,0x40,0x6c,
1030     0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x0a,0x20,0x20,0x6e,0x72,0x6d,
1031     0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,
1032     0x76,0x65,0x72,0x74,0x65,0x78,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x28,0x40,
1033     0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x70,0x6f,0x73,0x69,
1034     0x74,0x69,0x6f,0x6e,0x5f,0x31,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,
1035     0x65,0x63,0x34,0x66,0x2c,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,
1036     0x31,0x29,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,
1037     0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x29,0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,
1038     0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,
1039     0x6e,0x5f,0x31,0x20,0x3d,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,
1040     0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,
1041     0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,
1042     0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x3b,0x0a,0x20,0x20,0x72,
1043     0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x28,0x67,
1044     0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x6e,0x72,0x6d,0x29,
1045     0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
1046 ];
1047 /*
1048     diagnostic(off, derivative_uniformity);
1049 
1050     var<private> frag_color : vec4f;
1051 
1052     var<private> nrm : vec4f;
1053 
1054     fn main_1() {
1055       let x_13 : vec4f = nrm;
1056       let x_18 : vec3f = ((vec3f(x_13.x, x_13.y, x_13.z) * 0.5f) + vec3f(0.5f, 0.5f, 0.5f));
1057       frag_color = vec4f(x_18.x, x_18.y, x_18.z, 1.0f);
1058       return;
1059     }
1060 
1061     struct main_out {
1062       @location(0)
1063       frag_color_1 : vec4f,
1064     }
1065 
1066     @fragment
1067     fn main(@location(0) nrm_param : vec4f) -> main_out {
1068       nrm = nrm_param;
1069       main_1();
1070       return main_out(frag_color);
1071     }
1072 
1073 */
1074 __gshared char[486] FS_OFFSCREEN_SOURCE_WGSL = [
1075     0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20,
1076     0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f,
1077     0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,
1078     0x76,0x61,0x74,0x65,0x3e,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,
1079     0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,
1080     0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x6e,0x72,0x6d,0x20,0x3a,0x20,0x76,0x65,
1081     0x63,0x34,0x66,0x3b,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,
1082     0x29,0x20,0x7b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x33,0x20,0x3a,
1083     0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x6e,0x72,0x6d,0x3b,0x0a,0x20,0x20,
1084     0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x38,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,
1085     0x20,0x3d,0x20,0x28,0x28,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x31,0x33,0x2e,
1086     0x78,0x2c,0x20,0x78,0x5f,0x31,0x33,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x31,0x33,0x2e,
1087     0x7a,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x66,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,
1088     0x33,0x66,0x28,0x30,0x2e,0x35,0x66,0x2c,0x20,0x30,0x2e,0x35,0x66,0x2c,0x20,0x30,
1089     0x2e,0x35,0x66,0x29,0x29,0x3b,0x0a,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,
1090     0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x66,0x28,0x78,0x5f,0x31,0x38,
1091     0x2e,0x78,0x2c,0x20,0x78,0x5f,0x31,0x38,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x31,0x38,
1092     0x2e,0x7a,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,
1093     0x75,0x72,0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,
1094     0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,
1095     0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x0a,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,
1096     0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,
1097     0x0a,0x7d,0x0a,0x0a,0x40,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x0a,0x66,0x6e,
1098     0x20,0x6d,0x61,0x69,0x6e,0x28,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,
1099     0x30,0x29,0x20,0x6e,0x72,0x6d,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,
1100     0x65,0x63,0x34,0x66,0x29,0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,
1101     0x74,0x20,0x7b,0x0a,0x20,0x20,0x6e,0x72,0x6d,0x20,0x3d,0x20,0x6e,0x72,0x6d,0x5f,
1102     0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,
1103     0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,
1104     0x5f,0x6f,0x75,0x74,0x28,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x29,
1105     0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
1106 ];
1107 /*
1108     diagnostic(off, derivative_uniformity);
1109 
1110     struct vs_params {
1111       /_ @offset(0) _/
1112       mvp : mat4x4f,
1113     }
1114 
1115     @group(0) @binding(0) var<uniform> x_19 : vs_params;
1116 
1117     var<private> position_1 : vec4f;
1118 
1119     var<private> uv : vec2f;
1120 
1121     var<private> texcoord0 : vec2f;
1122 
1123     var<private> nrm : vec4f;
1124 
1125     var<private> normal : vec4f;
1126 
1127     var<private> gl_Position : vec4f;
1128 
1129     fn main_1() {
1130       let x_22 : mat4x4f = x_19.mvp;
1131       let x_25 : vec4f = position_1;
1132       gl_Position = (x_22 * x_25);
1133       let x_34 : vec2f = texcoord0;
1134       uv = x_34;
1135       let x_37 : mat4x4f = x_19.mvp;
1136       let x_39 : vec4f = normal;
1137       nrm = (x_37 * x_39);
1138       return;
1139     }
1140 
1141     struct main_out {
1142       @builtin(position)
1143       gl_Position : vec4f,
1144       @location(1)
1145       uv_1 : vec2f,
1146       @location(0)
1147       nrm_1 : vec4f,
1148     }
1149 
1150     @vertex
1151     fn main(@location(0) position_1_param : vec4f, @location(2) texcoord0_param : vec2f, @location(1) normal_param : vec4f) -> main_out {
1152       position_1 = position_1_param;
1153       texcoord0 = texcoord0_param;
1154       normal = normal_param;
1155       main_1();
1156       return main_out(gl_Position, uv, nrm);
1157     }
1158 
1159 */
1160 __gshared char[1008] VS_DEFAULT_SOURCE_WGSL = [
1161     0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20,
1162     0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f,
1163     0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,
1164     0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x7b,0x0a,0x20,0x20,0x2f,0x2a,
1165     0x20,0x40,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x30,0x29,0x20,0x2a,0x2f,0x0a,0x20,
1166     0x20,0x6d,0x76,0x70,0x20,0x3a,0x20,0x6d,0x61,0x74,0x34,0x78,0x34,0x66,0x2c,0x0a,
1167     0x7d,0x0a,0x0a,0x40,0x67,0x72,0x6f,0x75,0x70,0x28,0x30,0x29,0x20,0x40,0x62,0x69,
1168     0x6e,0x64,0x69,0x6e,0x67,0x28,0x30,0x29,0x20,0x76,0x61,0x72,0x3c,0x75,0x6e,0x69,
1169     0x66,0x6f,0x72,0x6d,0x3e,0x20,0x78,0x5f,0x31,0x39,0x20,0x3a,0x20,0x76,0x73,0x5f,
1170     0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,
1171     0x76,0x61,0x74,0x65,0x3e,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,
1172     0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,
1173     0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x75,0x76,0x20,0x3a,0x20,0x76,0x65,0x63,
1174     0x32,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,
1175     0x3e,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x3a,0x20,0x76,0x65,
1176     0x63,0x32,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,
1177     0x65,0x3e,0x20,0x6e,0x72,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,
1178     0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x6e,0x6f,
1179     0x72,0x6d,0x61,0x6c,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x76,
1180     0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x67,0x6c,0x5f,0x50,
1181     0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,
1182     0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x20,0x7b,0x0a,
1183     0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x32,0x20,0x3a,0x20,0x6d,0x61,0x74,
1184     0x34,0x78,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x31,0x39,0x2e,0x6d,0x76,0x70,0x3b,
1185     0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x35,0x20,0x3a,0x20,0x76,0x65,
1186     0x63,0x34,0x66,0x20,0x3d,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,
1187     0x3b,0x0a,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,
1188     0x3d,0x20,0x28,0x78,0x5f,0x32,0x32,0x20,0x2a,0x20,0x78,0x5f,0x32,0x35,0x29,0x3b,
1189     0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x34,0x20,0x3a,0x20,0x76,0x65,
1190     0x63,0x32,0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,
1191     0x0a,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x78,0x5f,0x33,0x34,0x3b,0x0a,0x20,0x20,
1192     0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x37,0x20,0x3a,0x20,0x6d,0x61,0x74,0x34,0x78,
1193     0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x31,0x39,0x2e,0x6d,0x76,0x70,0x3b,0x0a,0x20,
1194     0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x39,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,
1195     0x66,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x20,0x20,0x6e,0x72,
1196     0x6d,0x20,0x3d,0x20,0x28,0x78,0x5f,0x33,0x37,0x20,0x2a,0x20,0x78,0x5f,0x33,0x39,
1197     0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,
1198     0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,
1199     0x7b,0x0a,0x20,0x20,0x40,0x62,0x75,0x69,0x6c,0x74,0x69,0x6e,0x28,0x70,0x6f,0x73,
1200     0x69,0x74,0x69,0x6f,0x6e,0x29,0x0a,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,
1201     0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x20,0x20,
1202     0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x31,0x29,0x0a,0x20,0x20,0x75,
1203     0x76,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x2c,0x0a,0x20,0x20,0x40,
1204     0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x0a,0x20,0x20,0x6e,0x72,
1205     0x6d,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,
1206     0x40,0x76,0x65,0x72,0x74,0x65,0x78,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x28,
1207     0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x70,0x6f,0x73,
1208     0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,
1209     0x76,0x65,0x63,0x34,0x66,0x2c,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,
1210     0x28,0x32,0x29,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x5f,0x70,0x61,
1211     0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x2c,0x20,0x40,0x6c,0x6f,
1212     0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x31,0x29,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,
1213     0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x29,0x20,
1214     0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,
1215     0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,0x20,0x3d,0x20,0x70,0x6f,0x73,
1216     0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,
1217     0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x3d,0x20,0x74,0x65,0x78,
1218     0x63,0x6f,0x6f,0x72,0x64,0x30,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,
1219     0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x5f,
1220     0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,
1221     0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,
1222     0x5f,0x6f,0x75,0x74,0x28,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
1223     0x2c,0x20,0x75,0x76,0x2c,0x20,0x6e,0x72,0x6d,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
1224 
1225 ];
1226 /*
1227     diagnostic(off, derivative_uniformity);
1228 
1229     @group(1) @binding(64) var tex : texture_2d<f32>;
1230 
1231     @group(1) @binding(80) var smp : sampler;
1232 
1233     var<private> uv : vec2f;
1234 
1235     var<private> nrm : vec4f;
1236 
1237     var<private> frag_color : vec4f;
1238 
1239     fn main_1() {
1240       var c : vec4f;
1241       var l : f32;
1242       let x_23 : vec2f = uv;
1243       let x_28 : vec4f = textureSample(tex, smp, (x_23 * vec2f(20.0f, 10.0f)));
1244       c = x_28;
1245       let x_34 : vec4f = nrm;
1246       l = (clamp(dot(vec3f(x_34.x, x_34.y, x_34.z), vec3f(0.57735025882720947266f, 0.57735025882720947266f, -0.57735025882720947266f)), 0.0f, 1.0f) * 2.0f);
1247       let x_47 : vec4f = c;
1248       let x_49 : f32 = l;
1249       let x_52 : vec3f = (vec3f(x_47.x, x_47.y, x_47.z) * (x_49 + 0.25f));
1250       frag_color = vec4f(x_52.x, x_52.y, x_52.z, 1.0f);
1251       return;
1252     }
1253 
1254     struct main_out {
1255       @location(0)
1256       frag_color_1 : vec4f,
1257     }
1258 
1259     @fragment
1260     fn main(@location(1) uv_param : vec2f, @location(0) nrm_param : vec4f) -> main_out {
1261       uv = uv_param;
1262       nrm = nrm_param;
1263       main_1();
1264       return main_out(frag_color);
1265     }
1266 
1267 */
1268 __gshared char[980] FS_DEFAULT_SOURCE_WGSL = [
1269     0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20,
1270     0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f,
1271     0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x40,0x67,0x72,0x6f,0x75,0x70,0x28,
1272     0x31,0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,0x36,0x34,0x29,0x20,
1273     0x76,0x61,0x72,0x20,0x74,0x65,0x78,0x20,0x3a,0x20,0x74,0x65,0x78,0x74,0x75,0x72,
1274     0x65,0x5f,0x32,0x64,0x3c,0x66,0x33,0x32,0x3e,0x3b,0x0a,0x0a,0x40,0x67,0x72,0x6f,
1275     0x75,0x70,0x28,0x31,0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,0x38,
1276     0x30,0x29,0x20,0x76,0x61,0x72,0x20,0x73,0x6d,0x70,0x20,0x3a,0x20,0x73,0x61,0x6d,
1277     0x70,0x6c,0x65,0x72,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,
1278     0x74,0x65,0x3e,0x20,0x75,0x76,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,
1279     0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x6e,0x72,
1280     0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,
1281     0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,
1282     0x6c,0x6f,0x72,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x66,0x6e,
1283     0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x20,0x7b,0x0a,0x20,0x20,0x76,0x61,
1284     0x72,0x20,0x63,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x20,0x20,0x76,
1285     0x61,0x72,0x20,0x6c,0x20,0x3a,0x20,0x66,0x33,0x32,0x3b,0x0a,0x20,0x20,0x6c,0x65,
1286     0x74,0x20,0x78,0x5f,0x32,0x33,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,
1287     0x20,0x75,0x76,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x38,0x20,
1288     0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,
1289     0x65,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x74,0x65,0x78,0x2c,0x20,0x73,0x6d,0x70,
1290     0x2c,0x20,0x28,0x78,0x5f,0x32,0x33,0x20,0x2a,0x20,0x76,0x65,0x63,0x32,0x66,0x28,
1291     0x32,0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x30,0x2e,0x30,0x66,0x29,0x29,0x29,0x3b,
1292     0x0a,0x20,0x20,0x63,0x20,0x3d,0x20,0x78,0x5f,0x32,0x38,0x3b,0x0a,0x20,0x20,0x6c,
1293     0x65,0x74,0x20,0x78,0x5f,0x33,0x34,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,
1294     0x3d,0x20,0x6e,0x72,0x6d,0x3b,0x0a,0x20,0x20,0x6c,0x20,0x3d,0x20,0x28,0x63,0x6c,
1295     0x61,0x6d,0x70,0x28,0x64,0x6f,0x74,0x28,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,
1296     0x33,0x34,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x33,0x34,0x2e,0x79,0x2c,0x20,0x78,0x5f,
1297     0x33,0x34,0x2e,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x30,0x2e,0x35,
1298     0x37,0x37,0x33,0x35,0x30,0x32,0x35,0x38,0x38,0x32,0x37,0x32,0x30,0x39,0x34,0x37,
1299     0x32,0x36,0x36,0x66,0x2c,0x20,0x30,0x2e,0x35,0x37,0x37,0x33,0x35,0x30,0x32,0x35,
1300     0x38,0x38,0x32,0x37,0x32,0x30,0x39,0x34,0x37,0x32,0x36,0x36,0x66,0x2c,0x20,0x2d,
1301     0x30,0x2e,0x35,0x37,0x37,0x33,0x35,0x30,0x32,0x35,0x38,0x38,0x32,0x37,0x32,0x30,
1302     0x39,0x34,0x37,0x32,0x36,0x36,0x66,0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,
1303     0x20,0x31,0x2e,0x30,0x66,0x29,0x20,0x2a,0x20,0x32,0x2e,0x30,0x66,0x29,0x3b,0x0a,
1304     0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x34,0x37,0x20,0x3a,0x20,0x76,0x65,0x63,
1305     0x34,0x66,0x20,0x3d,0x20,0x63,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,
1306     0x34,0x39,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x6c,0x3b,0x0a,0x20,0x20,
1307     0x6c,0x65,0x74,0x20,0x78,0x5f,0x35,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,
1308     0x20,0x3d,0x20,0x28,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x34,0x37,0x2e,0x78,
1309     0x2c,0x20,0x78,0x5f,0x34,0x37,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x34,0x37,0x2e,0x7a,
1310     0x29,0x20,0x2a,0x20,0x28,0x78,0x5f,0x34,0x39,0x20,0x2b,0x20,0x30,0x2e,0x32,0x35,
1311     0x66,0x29,0x29,0x3b,0x0a,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,
1312     0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x66,0x28,0x78,0x5f,0x35,0x32,0x2e,0x78,
1313     0x2c,0x20,0x78,0x5f,0x35,0x32,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x35,0x32,0x2e,0x7a,
1314     0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,
1315     0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,
1316     0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,
1317     0x69,0x6f,0x6e,0x28,0x30,0x29,0x0a,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,
1318     0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d,
1319     0x0a,0x0a,0x40,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x0a,0x66,0x6e,0x20,0x6d,
1320     0x61,0x69,0x6e,0x28,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x31,0x29,
1321     0x20,0x75,0x76,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,
1322     0x66,0x2c,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,
1323     0x6e,0x72,0x6d,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,
1324     0x66,0x29,0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,
1325     0x0a,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x75,0x76,0x5f,0x70,0x61,0x72,0x61,0x6d,
1326     0x3b,0x0a,0x20,0x20,0x6e,0x72,0x6d,0x20,0x3d,0x20,0x6e,0x72,0x6d,0x5f,0x70,0x61,
1327     0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x3b,
1328     0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,
1329     0x75,0x74,0x28,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x29,0x3b,0x0a,
1330     0x7d,0x0a,0x0a,0x00,
1331 ];
1332 sg.ShaderDesc defaultShaderDesc(sg.Backend backend) @trusted @nogc nothrow {
1333     sg.ShaderDesc desc;
1334     desc.label = "default_shader";
1335     switch (backend) {
1336         case sg.Backend.Glcore:
1337             desc.vertex_func.source = &VS_DEFAULT_SOURCE_GLSL410[0];
1338             desc.vertex_func.entry = "main";
1339             desc.fragment_func.source = &FS_DEFAULT_SOURCE_GLSL410[0];
1340             desc.fragment_func.entry = "main";
1341             desc.attrs[0].base_type = sg.ShaderAttrBaseType.Float;
1342             desc.attrs[0].glsl_name = "position";
1343             desc.attrs[1].base_type = sg.ShaderAttrBaseType.Float;
1344             desc.attrs[1].glsl_name = "normal";
1345             desc.attrs[2].base_type = sg.ShaderAttrBaseType.Float;
1346             desc.attrs[2].glsl_name = "texcoord0";
1347             desc.uniform_blocks[0].stage = sg.ShaderStage.Vertex;
1348             desc.uniform_blocks[0].layout = sg.UniformLayout.Std140;
1349             desc.uniform_blocks[0].size = 64;
1350             desc.uniform_blocks[0].glsl_uniforms[0].type = sg.UniformType.Float4;
1351             desc.uniform_blocks[0].glsl_uniforms[0].array_count = 4;
1352             desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "vs_params";
1353             desc.images[0].stage = sg.ShaderStage.Fragment;
1354             desc.images[0].multisampled = false;
1355             desc.images[0].image_type = sg.ImageType._2d;
1356             desc.images[0].sample_type = sg.ImageSampleType.Float;
1357             desc.samplers[0].stage = sg.ShaderStage.Fragment;
1358             desc.samplers[0].sampler_type = sg.SamplerType.Filtering;
1359             desc.image_sampler_pairs[0].stage = sg.ShaderStage.Fragment;
1360             desc.image_sampler_pairs[0].image_slot = 0;
1361             desc.image_sampler_pairs[0].sampler_slot = 0;
1362             desc.image_sampler_pairs[0].glsl_name = "tex_smp";
1363             break;
1364         case sg.Backend.Gles3:
1365             desc.vertex_func.source = &VS_DEFAULT_SOURCE_GLSL300ES[0];
1366             desc.vertex_func.entry = "main";
1367             desc.fragment_func.source = &FS_DEFAULT_SOURCE_GLSL300ES[0];
1368             desc.fragment_func.entry = "main";
1369             desc.attrs[0].base_type = sg.ShaderAttrBaseType.Float;
1370             desc.attrs[0].glsl_name = "position";
1371             desc.attrs[1].base_type = sg.ShaderAttrBaseType.Float;
1372             desc.attrs[1].glsl_name = "normal";
1373             desc.attrs[2].base_type = sg.ShaderAttrBaseType.Float;
1374             desc.attrs[2].glsl_name = "texcoord0";
1375             desc.uniform_blocks[0].stage = sg.ShaderStage.Vertex;
1376             desc.uniform_blocks[0].layout = sg.UniformLayout.Std140;
1377             desc.uniform_blocks[0].size = 64;
1378             desc.uniform_blocks[0].glsl_uniforms[0].type = sg.UniformType.Float4;
1379             desc.uniform_blocks[0].glsl_uniforms[0].array_count = 4;
1380             desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "vs_params";
1381             desc.images[0].stage = sg.ShaderStage.Fragment;
1382             desc.images[0].multisampled = false;
1383             desc.images[0].image_type = sg.ImageType._2d;
1384             desc.images[0].sample_type = sg.ImageSampleType.Float;
1385             desc.samplers[0].stage = sg.ShaderStage.Fragment;
1386             desc.samplers[0].sampler_type = sg.SamplerType.Filtering;
1387             desc.image_sampler_pairs[0].stage = sg.ShaderStage.Fragment;
1388             desc.image_sampler_pairs[0].image_slot = 0;
1389             desc.image_sampler_pairs[0].sampler_slot = 0;
1390             desc.image_sampler_pairs[0].glsl_name = "tex_smp";
1391             break;
1392         case sg.Backend.D3d11:
1393             desc.vertex_func.source = &VS_DEFAULT_SOURCE_HLSL5[0];
1394             desc.vertex_func.d3d11_target = "vs_5_0";
1395             desc.vertex_func.entry = "main";
1396             desc.fragment_func.source = &FS_DEFAULT_SOURCE_HLSL5[0];
1397             desc.fragment_func.d3d11_target = "ps_5_0";
1398             desc.fragment_func.entry = "main";
1399             desc.attrs[0].base_type = sg.ShaderAttrBaseType.Float;
1400             desc.attrs[0].hlsl_sem_name = "TEXCOORD";
1401             desc.attrs[0].hlsl_sem_index = 0;
1402             desc.attrs[1].base_type = sg.ShaderAttrBaseType.Float;
1403             desc.attrs[1].hlsl_sem_name = "TEXCOORD";
1404             desc.attrs[1].hlsl_sem_index = 1;
1405             desc.attrs[2].base_type = sg.ShaderAttrBaseType.Float;
1406             desc.attrs[2].hlsl_sem_name = "TEXCOORD";
1407             desc.attrs[2].hlsl_sem_index = 2;
1408             desc.uniform_blocks[0].stage = sg.ShaderStage.Vertex;
1409             desc.uniform_blocks[0].layout = sg.UniformLayout.Std140;
1410             desc.uniform_blocks[0].size = 64;
1411             desc.uniform_blocks[0].hlsl_register_b_n = 0;
1412             desc.images[0].stage = sg.ShaderStage.Fragment;
1413             desc.images[0].multisampled = false;
1414             desc.images[0].image_type = sg.ImageType._2d;
1415             desc.images[0].sample_type = sg.ImageSampleType.Float;
1416             desc.images[0].hlsl_register_t_n = 0;
1417             desc.samplers[0].stage = sg.ShaderStage.Fragment;
1418             desc.samplers[0].sampler_type = sg.SamplerType.Filtering;
1419             desc.samplers[0].hlsl_register_s_n = 0;
1420             desc.image_sampler_pairs[0].stage = sg.ShaderStage.Fragment;
1421             desc.image_sampler_pairs[0].image_slot = 0;
1422             desc.image_sampler_pairs[0].sampler_slot = 0;
1423             break;
1424         case sg.Backend.Metal_macos:
1425             desc.vertex_func.source = &VS_DEFAULT_SOURCE_METAL_MACOS[0];
1426             desc.vertex_func.entry = "main0";
1427             desc.fragment_func.source = &FS_DEFAULT_SOURCE_METAL_MACOS[0];
1428             desc.fragment_func.entry = "main0";
1429             desc.attrs[0].base_type = sg.ShaderAttrBaseType.Float;
1430             desc.attrs[1].base_type = sg.ShaderAttrBaseType.Float;
1431             desc.attrs[2].base_type = sg.ShaderAttrBaseType.Float;
1432             desc.uniform_blocks[0].stage = sg.ShaderStage.Vertex;
1433             desc.uniform_blocks[0].layout = sg.UniformLayout.Std140;
1434             desc.uniform_blocks[0].size = 64;
1435             desc.uniform_blocks[0].msl_buffer_n = 0;
1436             desc.images[0].stage = sg.ShaderStage.Fragment;
1437             desc.images[0].multisampled = false;
1438             desc.images[0].image_type = sg.ImageType._2d;
1439             desc.images[0].sample_type = sg.ImageSampleType.Float;
1440             desc.images[0].msl_texture_n = 0;
1441             desc.samplers[0].stage = sg.ShaderStage.Fragment;
1442             desc.samplers[0].sampler_type = sg.SamplerType.Filtering;
1443             desc.samplers[0].msl_sampler_n = 0;
1444             desc.image_sampler_pairs[0].stage = sg.ShaderStage.Fragment;
1445             desc.image_sampler_pairs[0].image_slot = 0;
1446             desc.image_sampler_pairs[0].sampler_slot = 0;
1447             break;
1448         case sg.Backend.Wgpu:
1449             desc.vertex_func.source = &VS_DEFAULT_SOURCE_WGSL[0];
1450             desc.vertex_func.entry = "main";
1451             desc.fragment_func.source = &FS_DEFAULT_SOURCE_WGSL[0];
1452             desc.fragment_func.entry = "main";
1453             desc.attrs[0].base_type = sg.ShaderAttrBaseType.Float;
1454             desc.attrs[1].base_type = sg.ShaderAttrBaseType.Float;
1455             desc.attrs[2].base_type = sg.ShaderAttrBaseType.Float;
1456             desc.uniform_blocks[0].stage = sg.ShaderStage.Vertex;
1457             desc.uniform_blocks[0].layout = sg.UniformLayout.Std140;
1458             desc.uniform_blocks[0].size = 64;
1459             desc.uniform_blocks[0].wgsl_group0_binding_n = 0;
1460             desc.images[0].stage = sg.ShaderStage.Fragment;
1461             desc.images[0].multisampled = false;
1462             desc.images[0].image_type = sg.ImageType._2d;
1463             desc.images[0].sample_type = sg.ImageSampleType.Float;
1464             desc.images[0].wgsl_group1_binding_n = 64;
1465             desc.samplers[0].stage = sg.ShaderStage.Fragment;
1466             desc.samplers[0].sampler_type = sg.SamplerType.Filtering;
1467             desc.samplers[0].wgsl_group1_binding_n = 80;
1468             desc.image_sampler_pairs[0].stage = sg.ShaderStage.Fragment;
1469             desc.image_sampler_pairs[0].image_slot = 0;
1470             desc.image_sampler_pairs[0].sampler_slot = 0;
1471             break;
1472         default: break;
1473     }
1474     return desc;
1475 }
1476 sg.ShaderDesc offscreenShaderDesc(sg.Backend backend) @trusted @nogc nothrow {
1477     sg.ShaderDesc desc;
1478     desc.label = "offscreen_shader";
1479     switch (backend) {
1480         case sg.Backend.Glcore:
1481             desc.vertex_func.source = &VS_OFFSCREEN_SOURCE_GLSL410[0];
1482             desc.vertex_func.entry = "main";
1483             desc.fragment_func.source = &FS_OFFSCREEN_SOURCE_GLSL410[0];
1484             desc.fragment_func.entry = "main";
1485             desc.attrs[0].base_type = sg.ShaderAttrBaseType.Float;
1486             desc.attrs[0].glsl_name = "position";
1487             desc.attrs[1].base_type = sg.ShaderAttrBaseType.Float;
1488             desc.attrs[1].glsl_name = "normal";
1489             desc.uniform_blocks[0].stage = sg.ShaderStage.Vertex;
1490             desc.uniform_blocks[0].layout = sg.UniformLayout.Std140;
1491             desc.uniform_blocks[0].size = 64;
1492             desc.uniform_blocks[0].glsl_uniforms[0].type = sg.UniformType.Float4;
1493             desc.uniform_blocks[0].glsl_uniforms[0].array_count = 4;
1494             desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "vs_params";
1495             break;
1496         case sg.Backend.Gles3:
1497             desc.vertex_func.source = &VS_OFFSCREEN_SOURCE_GLSL300ES[0];
1498             desc.vertex_func.entry = "main";
1499             desc.fragment_func.source = &FS_OFFSCREEN_SOURCE_GLSL300ES[0];
1500             desc.fragment_func.entry = "main";
1501             desc.attrs[0].base_type = sg.ShaderAttrBaseType.Float;
1502             desc.attrs[0].glsl_name = "position";
1503             desc.attrs[1].base_type = sg.ShaderAttrBaseType.Float;
1504             desc.attrs[1].glsl_name = "normal";
1505             desc.uniform_blocks[0].stage = sg.ShaderStage.Vertex;
1506             desc.uniform_blocks[0].layout = sg.UniformLayout.Std140;
1507             desc.uniform_blocks[0].size = 64;
1508             desc.uniform_blocks[0].glsl_uniforms[0].type = sg.UniformType.Float4;
1509             desc.uniform_blocks[0].glsl_uniforms[0].array_count = 4;
1510             desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "vs_params";
1511             break;
1512         case sg.Backend.D3d11:
1513             desc.vertex_func.source = &VS_OFFSCREEN_SOURCE_HLSL5[0];
1514             desc.vertex_func.d3d11_target = "vs_5_0";
1515             desc.vertex_func.entry = "main";
1516             desc.fragment_func.source = &FS_OFFSCREEN_SOURCE_HLSL5[0];
1517             desc.fragment_func.d3d11_target = "ps_5_0";
1518             desc.fragment_func.entry = "main";
1519             desc.attrs[0].base_type = sg.ShaderAttrBaseType.Float;
1520             desc.attrs[0].hlsl_sem_name = "TEXCOORD";
1521             desc.attrs[0].hlsl_sem_index = 0;
1522             desc.attrs[1].base_type = sg.ShaderAttrBaseType.Float;
1523             desc.attrs[1].hlsl_sem_name = "TEXCOORD";
1524             desc.attrs[1].hlsl_sem_index = 1;
1525             desc.uniform_blocks[0].stage = sg.ShaderStage.Vertex;
1526             desc.uniform_blocks[0].layout = sg.UniformLayout.Std140;
1527             desc.uniform_blocks[0].size = 64;
1528             desc.uniform_blocks[0].hlsl_register_b_n = 0;
1529             break;
1530         case sg.Backend.Metal_macos:
1531             desc.vertex_func.source = &VS_OFFSCREEN_SOURCE_METAL_MACOS[0];
1532             desc.vertex_func.entry = "main0";
1533             desc.fragment_func.source = &FS_OFFSCREEN_SOURCE_METAL_MACOS[0];
1534             desc.fragment_func.entry = "main0";
1535             desc.attrs[0].base_type = sg.ShaderAttrBaseType.Float;
1536             desc.attrs[1].base_type = sg.ShaderAttrBaseType.Float;
1537             desc.uniform_blocks[0].stage = sg.ShaderStage.Vertex;
1538             desc.uniform_blocks[0].layout = sg.UniformLayout.Std140;
1539             desc.uniform_blocks[0].size = 64;
1540             desc.uniform_blocks[0].msl_buffer_n = 0;
1541             break;
1542         case sg.Backend.Wgpu:
1543             desc.vertex_func.source = &VS_OFFSCREEN_SOURCE_WGSL[0];
1544             desc.vertex_func.entry = "main";
1545             desc.fragment_func.source = &FS_OFFSCREEN_SOURCE_WGSL[0];
1546             desc.fragment_func.entry = "main";
1547             desc.attrs[0].base_type = sg.ShaderAttrBaseType.Float;
1548             desc.attrs[1].base_type = sg.ShaderAttrBaseType.Float;
1549             desc.uniform_blocks[0].stage = sg.ShaderStage.Vertex;
1550             desc.uniform_blocks[0].layout = sg.UniformLayout.Std140;
1551             desc.uniform_blocks[0].size = 64;
1552             desc.uniform_blocks[0].wgsl_group0_binding_n = 0;
1553             break;
1554         default: break;
1555     }
1556     return desc;
1557 }