shaders.go raw
1 // Code generated by build.go. DO NOT EDIT.
2
3 package gpu
4
5 import "github.com/p9c/p9/pkg/gel/gio/gpu/internal/driver"
6
7 var (
8 shader_backdrop_comp = driver.ShaderSources{
9 Name: "backdrop.comp",
10 GLSL310ES: `#version 310 es
11 layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
12
13 struct Alloc
14 {
15 uint offset;
16 };
17
18 struct AnnotatedRef
19 {
20 uint offset;
21 };
22
23 struct AnnotatedTag
24 {
25 uint tag;
26 uint flags;
27 };
28
29 struct PathRef
30 {
31 uint offset;
32 };
33
34 struct TileRef
35 {
36 uint offset;
37 };
38
39 struct Path
40 {
41 uvec4 bbox;
42 TileRef tiles;
43 };
44
45 struct Config
46 {
47 uint n_elements;
48 uint n_pathseg;
49 uint width_in_tiles;
50 uint height_in_tiles;
51 Alloc tile_alloc;
52 Alloc bin_alloc;
53 Alloc ptcl_alloc;
54 Alloc pathseg_alloc;
55 Alloc anno_alloc;
56 Alloc trans_alloc;
57 };
58
59 layout(binding = 0, std430) buffer Memory
60 {
61 uint mem_offset;
62 uint mem_error;
63 uint memory[];
64 } _77;
65
66 layout(binding = 1, std430) readonly buffer ConfigBuf
67 {
68 Config conf;
69 } _191;
70
71 shared uint sh_row_width[128];
72 shared Alloc sh_row_alloc[128];
73 shared uint sh_row_count[128];
74
75 bool touch_mem(Alloc alloc, uint offset)
76 {
77 return true;
78 }
79
80 uint read_mem(Alloc alloc, uint offset)
81 {
82 Alloc param = alloc;
83 uint param_1 = offset;
84 if (!touch_mem(param, param_1))
85 {
86 return 0u;
87 }
88 uint v = _77.memory[offset];
89 return v;
90 }
91
92 AnnotatedTag Annotated_tag(Alloc a, AnnotatedRef ref)
93 {
94 Alloc param = a;
95 uint param_1 = ref.offset >> uint(2);
96 uint tag_and_flags = read_mem(param, param_1);
97 return AnnotatedTag(tag_and_flags & 65535u, tag_and_flags >> uint(16));
98 }
99
100 uint fill_mode_from_flags(uint flags)
101 {
102 return flags & 1u;
103 }
104
105 Path Path_read(Alloc a, PathRef ref)
106 {
107 uint ix = ref.offset >> uint(2);
108 Alloc param = a;
109 uint param_1 = ix + 0u;
110 uint raw0 = read_mem(param, param_1);
111 Alloc param_2 = a;
112 uint param_3 = ix + 1u;
113 uint raw1 = read_mem(param_2, param_3);
114 Alloc param_4 = a;
115 uint param_5 = ix + 2u;
116 uint raw2 = read_mem(param_4, param_5);
117 Path s;
118 s.bbox = uvec4(raw0 & 65535u, raw0 >> uint(16), raw1 & 65535u, raw1 >> uint(16));
119 s.tiles = TileRef(raw2);
120 return s;
121 }
122
123 Alloc new_alloc(uint offset, uint size)
124 {
125 Alloc a;
126 a.offset = offset;
127 return a;
128 }
129
130 void write_mem(Alloc alloc, uint offset, uint val)
131 {
132 Alloc param = alloc;
133 uint param_1 = offset;
134 if (!touch_mem(param, param_1))
135 {
136 return;
137 }
138 _77.memory[offset] = val;
139 }
140
141 void main()
142 {
143 if (_77.mem_error != 0u)
144 {
145 return;
146 }
147 uint th_ix = gl_LocalInvocationID.x;
148 uint element_ix = gl_GlobalInvocationID.x;
149 AnnotatedRef ref = AnnotatedRef(_191.conf.anno_alloc.offset + (element_ix * 32u));
150 uint row_count = 0u;
151 if (element_ix < _191.conf.n_elements)
152 {
153 Alloc param;
154 param.offset = _191.conf.anno_alloc.offset;
155 AnnotatedRef param_1 = ref;
156 AnnotatedTag tag = Annotated_tag(param, param_1);
157 switch (tag.tag)
158 {
159 case 2u:
160 case 3u:
161 case 1u:
162 {
163 uint param_2 = tag.flags;
164 if (fill_mode_from_flags(param_2) != 0u)
165 {
166 break;
167 }
168 PathRef path_ref = PathRef(_191.conf.tile_alloc.offset + (element_ix * 12u));
169 Alloc param_3;
170 param_3.offset = _191.conf.tile_alloc.offset;
171 PathRef param_4 = path_ref;
172 Path path = Path_read(param_3, param_4);
173 sh_row_width[th_ix] = path.bbox.z - path.bbox.x;
174 row_count = path.bbox.w - path.bbox.y;
175 bool _267 = row_count == 1u;
176 bool _273;
177 if (_267)
178 {
179 _273 = path.bbox.y > 0u;
180 }
181 else
182 {
183 _273 = _267;
184 }
185 if (_273)
186 {
187 row_count = 0u;
188 }
189 uint param_5 = path.tiles.offset;
190 uint param_6 = ((path.bbox.z - path.bbox.x) * (path.bbox.w - path.bbox.y)) * 8u;
191 Alloc path_alloc = new_alloc(param_5, param_6);
192 sh_row_alloc[th_ix] = path_alloc;
193 break;
194 }
195 }
196 }
197 sh_row_count[th_ix] = row_count;
198 for (uint i = 0u; i < 7u; i++)
199 {
200 barrier();
201 if (th_ix >= uint(1 << int(i)))
202 {
203 row_count += sh_row_count[th_ix - uint(1 << int(i))];
204 }
205 barrier();
206 sh_row_count[th_ix] = row_count;
207 }
208 barrier();
209 uint total_rows = sh_row_count[127];
210 uint _395;
211 for (uint row = th_ix; row < total_rows; row += 128u)
212 {
213 uint el_ix = 0u;
214 for (uint i_1 = 0u; i_1 < 7u; i_1++)
215 {
216 uint probe = el_ix + uint(64 >> int(i_1));
217 if (row >= sh_row_count[probe - 1u])
218 {
219 el_ix = probe;
220 }
221 }
222 uint width = sh_row_width[el_ix];
223 if (width > 0u)
224 {
225 Alloc tiles_alloc = sh_row_alloc[el_ix];
226 if (el_ix > 0u)
227 {
228 _395 = sh_row_count[el_ix - 1u];
229 }
230 else
231 {
232 _395 = 0u;
233 }
234 uint seq_ix = row - _395;
235 uint tile_el_ix = ((tiles_alloc.offset >> uint(2)) + 1u) + ((seq_ix * 2u) * width);
236 Alloc param_7 = tiles_alloc;
237 uint param_8 = tile_el_ix;
238 uint sum = read_mem(param_7, param_8);
239 for (uint x = 1u; x < width; x++)
240 {
241 tile_el_ix += 2u;
242 Alloc param_9 = tiles_alloc;
243 uint param_10 = tile_el_ix;
244 sum += read_mem(param_9, param_10);
245 Alloc param_11 = tiles_alloc;
246 uint param_12 = tile_el_ix;
247 uint param_13 = sum;
248 write_mem(param_11, param_12, param_13);
249 }
250 }
251 }
252 }
253
254 `,
255 }
256 shader_binning_comp = driver.ShaderSources{
257 Name: "binning.comp",
258 GLSL310ES: `#version 310 es
259 layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
260
261 struct Alloc
262 {
263 uint offset;
264 };
265
266 struct MallocResult
267 {
268 Alloc alloc;
269 bool failed;
270 };
271
272 struct AnnoEndClipRef
273 {
274 uint offset;
275 };
276
277 struct AnnoEndClip
278 {
279 vec4 bbox;
280 };
281
282 struct AnnotatedRef
283 {
284 uint offset;
285 };
286
287 struct AnnotatedTag
288 {
289 uint tag;
290 uint flags;
291 };
292
293 struct BinInstanceRef
294 {
295 uint offset;
296 };
297
298 struct BinInstance
299 {
300 uint element_ix;
301 };
302
303 struct Config
304 {
305 uint n_elements;
306 uint n_pathseg;
307 uint width_in_tiles;
308 uint height_in_tiles;
309 Alloc tile_alloc;
310 Alloc bin_alloc;
311 Alloc ptcl_alloc;
312 Alloc pathseg_alloc;
313 Alloc anno_alloc;
314 Alloc trans_alloc;
315 };
316
317 layout(binding = 0, std430) buffer Memory
318 {
319 uint mem_offset;
320 uint mem_error;
321 uint memory[];
322 } _88;
323
324 layout(binding = 1, std430) readonly buffer ConfigBuf
325 {
326 Config conf;
327 } _254;
328
329 shared uint bitmaps[4][128];
330 shared bool sh_alloc_failed;
331 shared uint count[4][128];
332 shared Alloc sh_chunk_alloc[128];
333
334 bool touch_mem(Alloc alloc, uint offset)
335 {
336 return true;
337 }
338
339 uint read_mem(Alloc alloc, uint offset)
340 {
341 Alloc param = alloc;
342 uint param_1 = offset;
343 if (!touch_mem(param, param_1))
344 {
345 return 0u;
346 }
347 uint v = _88.memory[offset];
348 return v;
349 }
350
351 AnnotatedTag Annotated_tag(Alloc a, AnnotatedRef ref)
352 {
353 Alloc param = a;
354 uint param_1 = ref.offset >> uint(2);
355 uint tag_and_flags = read_mem(param, param_1);
356 return AnnotatedTag(tag_and_flags & 65535u, tag_and_flags >> uint(16));
357 }
358
359 AnnoEndClip AnnoEndClip_read(Alloc a, AnnoEndClipRef ref)
360 {
361 uint ix = ref.offset >> uint(2);
362 Alloc param = a;
363 uint param_1 = ix + 0u;
364 uint raw0 = read_mem(param, param_1);
365 Alloc param_2 = a;
366 uint param_3 = ix + 1u;
367 uint raw1 = read_mem(param_2, param_3);
368 Alloc param_4 = a;
369 uint param_5 = ix + 2u;
370 uint raw2 = read_mem(param_4, param_5);
371 Alloc param_6 = a;
372 uint param_7 = ix + 3u;
373 uint raw3 = read_mem(param_6, param_7);
374 AnnoEndClip s;
375 s.bbox = vec4(uintBitsToFloat(raw0), uintBitsToFloat(raw1), uintBitsToFloat(raw2), uintBitsToFloat(raw3));
376 return s;
377 }
378
379 AnnoEndClip Annotated_EndClip_read(Alloc a, AnnotatedRef ref)
380 {
381 Alloc param = a;
382 AnnoEndClipRef param_1 = AnnoEndClipRef(ref.offset + 4u);
383 return AnnoEndClip_read(param, param_1);
384 }
385
386 Alloc new_alloc(uint offset, uint size)
387 {
388 Alloc a;
389 a.offset = offset;
390 return a;
391 }
392
393 MallocResult malloc(uint size)
394 {
395 MallocResult r;
396 r.failed = false;
397 uint _94 = atomicAdd(_88.mem_offset, size);
398 uint offset = _94;
399 uint param = offset;
400 uint param_1 = size;
401 r.alloc = new_alloc(param, param_1);
402 if ((offset + size) > uint(int(uint(_88.memory.length())) * 4))
403 {
404 r.failed = true;
405 uint _115 = atomicMax(_88.mem_error, 1u);
406 return r;
407 }
408 return r;
409 }
410
411 void write_mem(Alloc alloc, uint offset, uint val)
412 {
413 Alloc param = alloc;
414 uint param_1 = offset;
415 if (!touch_mem(param, param_1))
416 {
417 return;
418 }
419 _88.memory[offset] = val;
420 }
421
422 void BinInstance_write(Alloc a, BinInstanceRef ref, BinInstance s)
423 {
424 uint ix = ref.offset >> uint(2);
425 Alloc param = a;
426 uint param_1 = ix + 0u;
427 uint param_2 = s.element_ix;
428 write_mem(param, param_1, param_2);
429 }
430
431 void main()
432 {
433 if (_88.mem_error != 0u)
434 {
435 return;
436 }
437 uint my_n_elements = _254.conf.n_elements;
438 uint my_partition = gl_WorkGroupID.x;
439 for (uint i = 0u; i < 4u; i++)
440 {
441 bitmaps[i][gl_LocalInvocationID.x] = 0u;
442 }
443 if (gl_LocalInvocationID.x == 0u)
444 {
445 sh_alloc_failed = false;
446 }
447 barrier();
448 uint element_ix = (my_partition * 128u) + gl_LocalInvocationID.x;
449 AnnotatedRef ref = AnnotatedRef(_254.conf.anno_alloc.offset + (element_ix * 32u));
450 uint tag = 0u;
451 if (element_ix < my_n_elements)
452 {
453 Alloc param;
454 param.offset = _254.conf.anno_alloc.offset;
455 AnnotatedRef param_1 = ref;
456 tag = Annotated_tag(param, param_1).tag;
457 }
458 int x0 = 0;
459 int y0 = 0;
460 int x1 = 0;
461 int y1 = 0;
462 switch (tag)
463 {
464 case 1u:
465 case 2u:
466 case 3u:
467 case 4u:
468 {
469 Alloc param_2;
470 param_2.offset = _254.conf.anno_alloc.offset;
471 AnnotatedRef param_3 = ref;
472 AnnoEndClip clip = Annotated_EndClip_read(param_2, param_3);
473 x0 = int(floor(clip.bbox.x * 0.001953125));
474 y0 = int(floor(clip.bbox.y * 0.00390625));
475 x1 = int(ceil(clip.bbox.z * 0.001953125));
476 y1 = int(ceil(clip.bbox.w * 0.00390625));
477 break;
478 }
479 }
480 uint width_in_bins = ((_254.conf.width_in_tiles + 16u) - 1u) / 16u;
481 uint height_in_bins = ((_254.conf.height_in_tiles + 8u) - 1u) / 8u;
482 x0 = clamp(x0, 0, int(width_in_bins));
483 x1 = clamp(x1, x0, int(width_in_bins));
484 y0 = clamp(y0, 0, int(height_in_bins));
485 y1 = clamp(y1, y0, int(height_in_bins));
486 if (x0 == x1)
487 {
488 y1 = y0;
489 }
490 int x = x0;
491 int y = y0;
492 uint my_slice = gl_LocalInvocationID.x / 32u;
493 uint my_mask = uint(1 << int(gl_LocalInvocationID.x & 31u));
494 while (y < y1)
495 {
496 uint _438 = atomicOr(bitmaps[my_slice][(uint(y) * width_in_bins) + uint(x)], my_mask);
497 x++;
498 if (x == x1)
499 {
500 x = x0;
501 y++;
502 }
503 }
504 barrier();
505 uint element_count = 0u;
506 for (uint i_1 = 0u; i_1 < 4u; i_1++)
507 {
508 element_count += uint(bitCount(bitmaps[i_1][gl_LocalInvocationID.x]));
509 count[i_1][gl_LocalInvocationID.x] = element_count;
510 }
511 uint param_4 = 0u;
512 uint param_5 = 0u;
513 Alloc chunk_alloc = new_alloc(param_4, param_5);
514 if (element_count != 0u)
515 {
516 uint param_6 = element_count * 4u;
517 MallocResult _487 = malloc(param_6);
518 MallocResult chunk = _487;
519 chunk_alloc = chunk.alloc;
520 sh_chunk_alloc[gl_LocalInvocationID.x] = chunk_alloc;
521 if (chunk.failed)
522 {
523 sh_alloc_failed = true;
524 }
525 }
526 uint out_ix = (_254.conf.bin_alloc.offset >> uint(2)) + (((my_partition * 128u) + gl_LocalInvocationID.x) * 2u);
527 Alloc param_7;
528 param_7.offset = _254.conf.bin_alloc.offset;
529 uint param_8 = out_ix;
530 uint param_9 = element_count;
531 write_mem(param_7, param_8, param_9);
532 Alloc param_10;
533 param_10.offset = _254.conf.bin_alloc.offset;
534 uint param_11 = out_ix + 1u;
535 uint param_12 = chunk_alloc.offset;
536 write_mem(param_10, param_11, param_12);
537 barrier();
538 if (sh_alloc_failed)
539 {
540 return;
541 }
542 x = x0;
543 y = y0;
544 while (y < y1)
545 {
546 uint bin_ix = (uint(y) * width_in_bins) + uint(x);
547 uint out_mask = bitmaps[my_slice][bin_ix];
548 if ((out_mask & my_mask) != 0u)
549 {
550 uint idx = uint(bitCount(out_mask & (my_mask - 1u)));
551 if (my_slice > 0u)
552 {
553 idx += count[my_slice - 1u][bin_ix];
554 }
555 Alloc out_alloc = sh_chunk_alloc[bin_ix];
556 uint out_offset = out_alloc.offset + (idx * 4u);
557 Alloc param_13 = out_alloc;
558 BinInstanceRef param_14 = BinInstanceRef(out_offset);
559 BinInstance param_15 = BinInstance(element_ix);
560 BinInstance_write(param_13, param_14, param_15);
561 }
562 x++;
563 if (x == x1)
564 {
565 x = x0;
566 y++;
567 }
568 }
569 }
570
571 `,
572 }
573 shader_blit_frag = [...]driver.ShaderSources{
574 {
575 Name: "blit.frag",
576 Inputs: []driver.InputLocation{{Name: "vUV", Location: 0, Semantic: "TEXCOORD", SemanticIndex: 0, Type: 0x0, Size: 2}},
577 Uniforms: driver.UniformsReflection{
578 Blocks: []driver.UniformBlock{{Name: "Color", Binding: 0}},
579 Locations: []driver.UniformLocation{{Name: "_color.color", Type: 0x0, Size: 4, Offset: 0}},
580 Size: 16,
581 },
582 GLSL100ES: `#version 100
583 precision mediump float;
584 precision highp int;
585
586 struct Color
587 {
588 vec4 color;
589 };
590
591 uniform Color _color;
592
593 varying vec2 vUV;
594
595 void main()
596 {
597 gl_FragData[0] = _color.color;
598 }
599
600 `,
601 GLSL300ES: `#version 300 es
602 precision mediump float;
603 precision highp int;
604
605 layout(std140) uniform Color
606 {
607 vec4 color;
608 } _color;
609
610 layout(location = 0) out vec4 fragColor;
611 in vec2 vUV;
612
613 void main()
614 {
615 fragColor = _color.color;
616 }
617
618 `,
619 GLSL130: `#version 130
620 #ifdef GL_ARB_shading_language_420pack
621 #extension GL_ARB_shading_language_420pack : require
622 #endif
623
624 struct Color
625 {
626 vec4 color;
627 };
628
629 uniform Color _color;
630
631 out vec4 fragColor;
632 in vec2 vUV;
633
634 void main()
635 {
636 fragColor = _color.color;
637 }
638
639 `,
640 GLSL150: `#version 150
641 #ifdef GL_ARB_shading_language_420pack
642 #extension GL_ARB_shading_language_420pack : require
643 #endif
644
645 layout(binding = 0, std140) uniform Color
646 {
647 vec4 color;
648 } _color;
649
650 out vec4 fragColor;
651 in vec2 vUV;
652
653 void main()
654 {
655 fragColor = _color.color;
656 }
657
658 `,
659 HLSL: "DXBC,\xc1\x9c\x85P\xbc\xab\x8a.\x9e\b\xdd\xf7\xd2\x18\xa2\x01\x00\x00\x00t\x02\x00\x00\x06\x00\x00\x008\x00\x00\x00\x84\x00\x00\x00\xcc\x00\x00\x00H\x01\x00\x00\f\x02\x00\x00@\x02\x00\x00Aon9D\x00\x00\x00D\x00\x00\x00\x00\x02\xff\xff\x14\x00\x00\x000\x00\x00\x00\x01\x00$\x00\x00\x000\x00\x00\x000\x00\x00\x00$\x00\x00\x000\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x02\xff\xff\x01\x00\x00\x02\x00\b\x0f\x80\x00\x00\xe4\xa0\xff\xff\x00\x00SHDR@\x00\x00\x00@\x00\x00\x00\x10\x00\x00\x00Y\x00\x00\x04F\x8e \x00\x00\x00\x00\x00\x01\x00\x00\x00e\x00\x00\x03\xf2 \x10\x00\x00\x00\x00\x006\x00\x00\x06\xf2 \x10\x00\x00\x00\x00\x00F\x8e \x00\x00\x00\x00\x00\x00\x00\x00\x00>\x00\x00\x01STATt\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00RDEF\xbc\x00\x00\x00\x01\x00\x00\x00D\x00\x00\x00\x01\x00\x00\x00\x1c\x00\x00\x00\x00\x04\xff\xff\x00\x01\x00\x00\x94\x00\x00\x00<\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00Color\x00\xab\xab<\x00\x00\x00\x01\x00\x00\x00\\\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00t\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x02\x00\x00\x00\x84\x00\x00\x00\x00\x00\x00\x00_color_color\x00\xab\xab\xab\x01\x00\x03\x00\x01\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00Microsoft (R) HLSL Shader Compiler 10.1\x00ISGN,\x00\x00\x00\x01\x00\x00\x00\b\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00TEXCOORD\x00\xab\xab\xabOSGN,\x00\x00\x00\x01\x00\x00\x00\b\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00SV_Target\x00\xab\xab",
660 },
661 {
662 Name: "blit.frag",
663 Inputs: []driver.InputLocation{{Name: "vUV", Location: 0, Semantic: "TEXCOORD", SemanticIndex: 0, Type: 0x0, Size: 2}},
664 Uniforms: driver.UniformsReflection{
665 Blocks: []driver.UniformBlock{{Name: "Gradient", Binding: 0}},
666 Locations: []driver.UniformLocation{{Name: "_gradient.color1", Type: 0x0, Size: 4, Offset: 0}, {Name: "_gradient.color2", Type: 0x0, Size: 4, Offset: 16}},
667 Size: 32,
668 },
669 GLSL100ES: `#version 100
670 precision mediump float;
671 precision highp int;
672
673 struct Gradient
674 {
675 vec4 color1;
676 vec4 color2;
677 };
678
679 uniform Gradient _gradient;
680
681 varying vec2 vUV;
682
683 void main()
684 {
685 gl_FragData[0] = mix(_gradient.color1, _gradient.color2, vec4(clamp(vUV.x, 0.0, 1.0)));
686 }
687
688 `,
689 GLSL300ES: `#version 300 es
690 precision mediump float;
691 precision highp int;
692
693 layout(std140) uniform Gradient
694 {
695 vec4 color1;
696 vec4 color2;
697 } _gradient;
698
699 layout(location = 0) out vec4 fragColor;
700 in vec2 vUV;
701
702 void main()
703 {
704 fragColor = mix(_gradient.color1, _gradient.color2, vec4(clamp(vUV.x, 0.0, 1.0)));
705 }
706
707 `,
708 GLSL130: `#version 130
709 #ifdef GL_ARB_shading_language_420pack
710 #extension GL_ARB_shading_language_420pack : require
711 #endif
712
713 struct Gradient
714 {
715 vec4 color1;
716 vec4 color2;
717 };
718
719 uniform Gradient _gradient;
720
721 out vec4 fragColor;
722 in vec2 vUV;
723
724 void main()
725 {
726 fragColor = mix(_gradient.color1, _gradient.color2, vec4(clamp(vUV.x, 0.0, 1.0)));
727 }
728
729 `,
730 GLSL150: `#version 150
731 #ifdef GL_ARB_shading_language_420pack
732 #extension GL_ARB_shading_language_420pack : require
733 #endif
734
735 layout(binding = 0, std140) uniform Gradient
736 {
737 vec4 color1;
738 vec4 color2;
739 } _gradient;
740
741 out vec4 fragColor;
742 in vec2 vUV;
743
744 void main()
745 {
746 fragColor = mix(_gradient.color1, _gradient.color2, vec4(clamp(vUV.x, 0.0, 1.0)));
747 }
748
749 `,
750 HLSL: "DXBCdZ\xb9AA\xb2\xa5-Σc\xb9\xdc\xfd]\xae\x01\x00\x00\x00P\x03\x00\x00\x06\x00\x00\x008\x00\x00\x00\xcc\x00\x00\x00t\x01\x00\x00\xf0\x01\x00\x00\xe8\x02\x00\x00\x1c\x03\x00\x00Aon9\x8c\x00\x00\x00\x8c\x00\x00\x00\x00\x02\xff\xff\\\x00\x00\x000\x00\x00\x00\x01\x00$\x00\x00\x000\x00\x00\x000\x00\x00\x00$\x00\x00\x000\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x02\xff\xff\x1f\x00\x00\x02\x00\x00\x00\x80\x00\x00\x03\xb0\x01\x00\x00\x02\x00\x00\x18\x80\x00\x00\x00\xb0\x01\x00\x00\x02\x01\x00\x0f\x80\x00\x00\xe4\xa0\x02\x00\x00\x03\x01\x00\x0f\x80\x01\x00\xe4\x81\x01\x00\xe4\xa0\x04\x00\x00\x04\x00\x00\x0f\x80\x00\x00\xff\x80\x01\x00\xe4\x80\x00\x00\xe4\xa0\x01\x00\x00\x02\x00\b\x0f\x80\x00\x00\xe4\x80\xff\xff\x00\x00SHDR\xa0\x00\x00\x00@\x00\x00\x00(\x00\x00\x00Y\x00\x00\x04F\x8e \x00\x00\x00\x00\x00\x02\x00\x00\x00b\x10\x00\x03\x12\x10\x10\x00\x00\x00\x00\x00e\x00\x00\x03\xf2 \x10\x00\x00\x00\x00\x00h\x00\x00\x02\x02\x00\x00\x006 \x00\x05\x12\x00\x10\x00\x00\x00\x00\x00\n\x10\x10\x00\x00\x00\x00\x00\x00\x00\x00\n\xf2\x00\x10\x00\x01\x00\x00\x00F\x8e \x80A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00F\x8e \x00\x00\x00\x00\x00\x01\x00\x00\x002\x00\x00\n\xf2 \x10\x00\x00\x00\x00\x00\x06\x00\x10\x00\x00\x00\x00\x00F\x0e\x10\x00\x01\x00\x00\x00F\x8e \x00\x00\x00\x00\x00\x00\x00\x00\x00>\x00\x00\x01STATt\x00\x00\x00\x04\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00RDEF\xf0\x00\x00\x00\x01\x00\x00\x00H\x00\x00\x00\x01\x00\x00\x00\x1c\x00\x00\x00\x00\x04\xff\xff\x00\x01\x00\x00\xc5\x00\x00\x00<\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00Gradient\x00\xab\xab\xab<\x00\x00\x00\x02\x00\x00\x00`\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x90\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x02\x00\x00\x00\xa4\x00\x00\x00\x00\x00\x00\x00\xb4\x00\x00\x00\x10\x00\x00\x00\x10\x00\x00\x00\x02\x00\x00\x00\xa4\x00\x00\x00\x00\x00\x00\x00_gradient_color1\x00\xab\xab\xab\x01\x00\x03\x00\x01\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00_gradient_color2\x00Microsoft (R) HLSL Shader Compiler 10.1\x00\xab\xab\xabISGN,\x00\x00\x00\x01\x00\x00\x00\b\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x01\x00\x00TEXCOORD\x00\xab\xab\xabOSGN,\x00\x00\x00\x01\x00\x00\x00\b\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00SV_Target\x00\xab\xab",
751 },
752 {
753 Name: "blit.frag",
754 Inputs: []driver.InputLocation{{Name: "vUV", Location: 0, Semantic: "TEXCOORD", SemanticIndex: 0, Type: 0x0, Size: 2}},
755 Textures: []driver.TextureBinding{{Name: "tex", Binding: 0}},
756 GLSL100ES: `#version 100
757 precision mediump float;
758 precision highp int;
759
760 uniform mediump sampler2D tex;
761
762 varying vec2 vUV;
763
764 void main()
765 {
766 gl_FragData[0] = texture2D(tex, vUV);
767 }
768
769 `,
770 GLSL300ES: `#version 300 es
771 precision mediump float;
772 precision highp int;
773
774 uniform mediump sampler2D tex;
775
776 layout(location = 0) out vec4 fragColor;
777 in vec2 vUV;
778
779 void main()
780 {
781 fragColor = texture(tex, vUV);
782 }
783
784 `,
785 GLSL130: `#version 130
786 #ifdef GL_ARB_shading_language_420pack
787 #extension GL_ARB_shading_language_420pack : require
788 #endif
789
790 layout(binding = 0) uniform sampler2D tex;
791
792 out vec4 fragColor;
793 in vec2 vUV;
794
795 void main()
796 {
797 fragColor = texture(tex, vUV);
798 }
799
800 `,
801 GLSL150: `#version 150
802 #ifdef GL_ARB_shading_language_420pack
803 #extension GL_ARB_shading_language_420pack : require
804 #endif
805
806 layout(binding = 0) uniform sampler2D tex;
807
808 out vec4 fragColor;
809 in vec2 vUV;
810
811 void main()
812 {
813 fragColor = texture(tex, vUV);
814 }
815
816 `,
817 HLSL: "DXBC\xb7?\x1d\xb1\x80̀\xa3W\t\xfbZ\x9fV\xd6\xda\x01\x00\x00\x00\x94\x02\x00\x00\x06\x00\x00\x008\x00\x00\x00\xa4\x00\x00\x00\x10\x01\x00\x00\x8c\x01\x00\x00,\x02\x00\x00`\x02\x00\x00Aon9d\x00\x00\x00d\x00\x00\x00\x00\x02\xff\xff<\x00\x00\x00(\x00\x00\x00\x00\x00(\x00\x00\x00(\x00\x00\x00(\x00\x01\x00$\x00\x00\x00(\x00\x00\x00\x00\x00\x00\x02\xff\xff\x1f\x00\x00\x02\x00\x00\x00\x80\x00\x00\x03\xb0\x1f\x00\x00\x02\x00\x00\x00\x90\x00\b\x0f\xa0B\x00\x00\x03\x00\x00\x0f\x80\x00\x00\xe4\xb0\x00\b\xe4\xa0\x01\x00\x00\x02\x00\b\x0f\x80\x00\x00\xe4\x80\xff\xff\x00\x00SHDRd\x00\x00\x00@\x00\x00\x00\x19\x00\x00\x00Z\x00\x00\x03\x00`\x10\x00\x00\x00\x00\x00X\x18\x00\x04\x00p\x10\x00\x00\x00\x00\x00UU\x00\x00b\x10\x00\x032\x10\x10\x00\x00\x00\x00\x00e\x00\x00\x03\xf2 \x10\x00\x00\x00\x00\x00E\x00\x00\t\xf2 \x10\x00\x00\x00\x00\x00F\x10\x10\x00\x00\x00\x00\x00F~\x10\x00\x00\x00\x00\x00\x00`\x10\x00\x00\x00\x00\x00>\x00\x00\x01STATt\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00RDEF\x98\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x1c\x00\x00\x00\x00\x04\xff\xff\x00\x01\x00\x00m\x00\x00\x00\\\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00i\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x04\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x01\x00\x00\x00\r\x00\x00\x00_tex_sampler\x00tex\x00Microsoft (R) HLSL Shader Compiler 10.1\x00\xab\xab\xabISGN,\x00\x00\x00\x01\x00\x00\x00\b\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x03\x00\x00TEXCOORD\x00\xab\xab\xabOSGN,\x00\x00\x00\x01\x00\x00\x00\b\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00SV_Target\x00\xab\xab",
818 },
819 }
820 shader_blit_vert = driver.ShaderSources{
821 Name: "blit.vert",
822 Inputs: []driver.InputLocation{{Name: "pos", Location: 0, Semantic: "TEXCOORD", SemanticIndex: 0, Type: 0x0, Size: 2}, {Name: "uv", Location: 1, Semantic: "TEXCOORD", SemanticIndex: 1, Type: 0x0, Size: 2}},
823 Uniforms: driver.UniformsReflection{
824 Blocks: []driver.UniformBlock{{Name: "Block", Binding: 0}},
825 Locations: []driver.UniformLocation{{Name: "_block.transform", Type: 0x0, Size: 4, Offset: 0}, {Name: "_block.uvTransformR1", Type: 0x0, Size: 4, Offset: 16}, {Name: "_block.uvTransformR2", Type: 0x0, Size: 4, Offset: 32}, {Name: "_block.z", Type: 0x0, Size: 1, Offset: 48}},
826 Size: 52,
827 },
828 GLSL100ES: `#version 100
829
830 struct m3x2
831 {
832 vec3 r0;
833 vec3 r1;
834 };
835
836 struct Block
837 {
838 vec4 transform;
839 vec4 uvTransformR1;
840 vec4 uvTransformR2;
841 float z;
842 };
843
844 uniform Block _block;
845
846 attribute vec2 pos;
847 varying vec2 vUV;
848 attribute vec2 uv;
849
850 vec4 toClipSpace(vec4 pos_1)
851 {
852 return pos_1;
853 }
854
855 vec3 transform3x2(m3x2 t, vec3 v)
856 {
857 return vec3(dot(t.r0, v), dot(t.r1, v), dot(vec3(0.0, 0.0, 1.0), v));
858 }
859
860 void main()
861 {
862 vec2 p = (pos * _block.transform.xy) + _block.transform.zw;
863 vec4 param = vec4(p, _block.z, 1.0);
864 gl_Position = toClipSpace(param);
865 m3x2 param_1 = m3x2(_block.uvTransformR1.xyz, _block.uvTransformR2.xyz);
866 vec3 param_2 = vec3(uv, 1.0);
867 vUV = transform3x2(param_1, param_2).xy;
868 }
869
870 `,
871 GLSL300ES: `#version 300 es
872
873 struct m3x2
874 {
875 vec3 r0;
876 vec3 r1;
877 };
878
879 layout(std140) uniform Block
880 {
881 vec4 transform;
882 vec4 uvTransformR1;
883 vec4 uvTransformR2;
884 float z;
885 } _block;
886
887 layout(location = 0) in vec2 pos;
888 out vec2 vUV;
889 layout(location = 1) in vec2 uv;
890
891 vec4 toClipSpace(vec4 pos_1)
892 {
893 return pos_1;
894 }
895
896 vec3 transform3x2(m3x2 t, vec3 v)
897 {
898 return vec3(dot(t.r0, v), dot(t.r1, v), dot(vec3(0.0, 0.0, 1.0), v));
899 }
900
901 void main()
902 {
903 vec2 p = (pos * _block.transform.xy) + _block.transform.zw;
904 vec4 param = vec4(p, _block.z, 1.0);
905 gl_Position = toClipSpace(param);
906 m3x2 param_1 = m3x2(_block.uvTransformR1.xyz, _block.uvTransformR2.xyz);
907 vec3 param_2 = vec3(uv, 1.0);
908 vUV = transform3x2(param_1, param_2).xy;
909 }
910
911 `,
912 GLSL130: `#version 130
913 #ifdef GL_ARB_shading_language_420pack
914 #extension GL_ARB_shading_language_420pack : require
915 #endif
916
917 struct m3x2
918 {
919 vec3 r0;
920 vec3 r1;
921 };
922
923 struct Block
924 {
925 vec4 transform;
926 vec4 uvTransformR1;
927 vec4 uvTransformR2;
928 float z;
929 };
930
931 uniform Block _block;
932
933 in vec2 pos;
934 out vec2 vUV;
935 in vec2 uv;
936
937 vec4 toClipSpace(vec4 pos_1)
938 {
939 return pos_1;
940 }
941
942 vec3 transform3x2(m3x2 t, vec3 v)
943 {
944 return vec3(dot(t.r0, v), dot(t.r1, v), dot(vec3(0.0, 0.0, 1.0), v));
945 }
946
947 void main()
948 {
949 vec2 p = (pos * _block.transform.xy) + _block.transform.zw;
950 vec4 param = vec4(p, _block.z, 1.0);
951 gl_Position = toClipSpace(param);
952 m3x2 param_1 = m3x2(_block.uvTransformR1.xyz, _block.uvTransformR2.xyz);
953 vec3 param_2 = vec3(uv, 1.0);
954 vUV = transform3x2(param_1, param_2).xy;
955 }
956
957 `,
958 GLSL150: `#version 150
959 #ifdef GL_ARB_shading_language_420pack
960 #extension GL_ARB_shading_language_420pack : require
961 #endif
962
963 struct m3x2
964 {
965 vec3 r0;
966 vec3 r1;
967 };
968
969 layout(binding = 0, std140) uniform Block
970 {
971 vec4 transform;
972 vec4 uvTransformR1;
973 vec4 uvTransformR2;
974 float z;
975 } _block;
976
977 in vec2 pos;
978 out vec2 vUV;
979 in vec2 uv;
980
981 vec4 toClipSpace(vec4 pos_1)
982 {
983 return pos_1;
984 }
985
986 vec3 transform3x2(m3x2 t, vec3 v)
987 {
988 return vec3(dot(t.r0, v), dot(t.r1, v), dot(vec3(0.0, 0.0, 1.0), v));
989 }
990
991 void main()
992 {
993 vec2 p = (pos * _block.transform.xy) + _block.transform.zw;
994 vec4 param = vec4(p, _block.z, 1.0);
995 gl_Position = toClipSpace(param);
996 m3x2 param_1 = m3x2(_block.uvTransformR1.xyz, _block.uvTransformR2.xyz);
997 vec3 param_2 = vec3(uv, 1.0);
998 vUV = transform3x2(param_1, param_2).xy;
999 }
1000
1001 `,
1002 HLSL: "DXBC\x80\xa7\xa0\x9e\xbb\xa1\xa3\x1b\x85\xac\xb6\xe9\xfb\xe6W\x03\x01\x00\x00\x00\xc8\x04\x00\x00\x06\x00\x00\x008\x00\x00\x00$\x01\x00\x00T\x02\x00\x00\xd0\x02\x00\x00$\x04\x00\x00p\x04\x00\x00Aon9\xe4\x00\x00\x00\xe4\x00\x00\x00\x00\x02\xfe\xff\xb0\x00\x00\x004\x00\x00\x00\x01\x00$\x00\x00\x000\x00\x00\x000\x00\x00\x00$\x00\x01\x000\x00\x00\x00\x00\x00\x04\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xfe\xffQ\x00\x00\x05\x05\x00\x0f\xa0\x00\x00\x80?\x00\x00\x00\x00\x00\x00\x00?\x00\x00\x00\x00\x1f\x00\x00\x02\x05\x00\x00\x80\x00\x00\x0f\x90\x1f\x00\x00\x02\x05\x00\x01\x80\x01\x00\x0f\x90\x04\x00\x00\x04\x00\x00\a\x80\x01\x00Đ\x05\x00Р\x05\x00Š\b\x00\x00\x03\x00\x00\x01\xe0\x02\x00\xe4\xa0\x00\x00\xe4\x80\b\x00\x00\x03\x00\x00\x02\xe0\x03\x00\xe4\xa0\x00\x00\xe4\x80\x04\x00\x00\x04\x00\x00\x03\x80\x00\x00\xe4\x90\x01\x00\xe4\xa0\x01\x00\xee\xa0\x02\x00\x00\x03\x00\x00\x03\xc0\x00\x00\xe4\x80\x00\x00\xe4\xa0\x01\x00\x00\x02\x00\x00\a\x80\x05\x00\xe4\xa0\x04\x00\x00\x04\x00\x00\f\xc0\x04\x00\x00\xa0\x00\x00d\x80\x00\x00$\x80\xff\xff\x00\x00SHDR(\x01\x00\x00@\x00\x01\x00J\x00\x00\x00Y\x00\x00\x04F\x8e \x00\x00\x00\x00\x00\x04\x00\x00\x00_\x00\x00\x032\x10\x10\x00\x00\x00\x00\x00_\x00\x00\x032\x10\x10\x00\x01\x00\x00\x00e\x00\x00\x032 \x10\x00\x00\x00\x00\x00g\x00\x00\x04\xf2 \x10\x00\x01\x00\x00\x00\x01\x00\x00\x00h\x00\x00\x02\x01\x00\x00\x006\x00\x00\x052\x00\x10\x00\x00\x00\x00\x00F\x10\x10\x00\x01\x00\x00\x006\x00\x00\x05B\x00\x10\x00\x00\x00\x00\x00\x01@\x00\x00\x00\x00\x80?\x10\x00\x00\b\x12 \x10\x00\x00\x00\x00\x00F\x82 \x00\x00\x00\x00\x00\x01\x00\x00\x00F\x02\x10\x00\x00\x00\x00\x00\x10\x00\x00\b\" \x10\x00\x00\x00\x00\x00F\x82 \x00\x00\x00\x00\x00\x02\x00\x00\x00F\x02\x10\x00\x00\x00\x00\x002\x00\x00\v2 \x10\x00\x01\x00\x00\x00F\x10\x10\x00\x00\x00\x00\x00F\x80 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xe6\x8a \x00\x00\x00\x00\x00\x00\x00\x00\x002\x00\x00\nB \x10\x00\x01\x00\x00\x00\n\x80 \x00\x00\x00\x00\x00\x03\x00\x00\x00\x01@\x00\x00\x00\x00\x00?\x01@\x00\x00\x00\x00\x00?6\x00\x00\x05\x82 \x10\x00\x01\x00\x00\x00\x01@\x00\x00\x00\x00\x80?>\x00\x00\x01STATt\x00\x00\x00\b\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00RDEFL\x01\x00\x00\x01\x00\x00\x00D\x00\x00\x00\x01\x00\x00\x00\x1c\x00\x00\x00\x00\x04\xfe\xff\x00\x01\x00\x00$\x01\x00\x00<\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00Block\x00\xab\xab<\x00\x00\x00\x04\x00\x00\x00\\\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbc\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x02\x00\x00\x00\xd0\x00\x00\x00\x00\x00\x00\x00\xe0\x00\x00\x00\x10\x00\x00\x00\x10\x00\x00\x00\x02\x00\x00\x00\xd0\x00\x00\x00\x00\x00\x00\x00\xf5\x00\x00\x00 \x00\x00\x00\x10\x00\x00\x00\x02\x00\x00\x00\xd0\x00\x00\x00\x00\x00\x00\x00\n\x01\x00\x000\x00\x00\x00\x04\x00\x00\x00\x02\x00\x00\x00\x14\x01\x00\x00\x00\x00\x00\x00_block_transform\x00\xab\xab\xab\x01\x00\x03\x00\x01\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00_block_uvTransformR1\x00_block_uvTransformR2\x00_block_z\x00\xab\x00\x00\x03\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00Microsoft (R) HLSL Shader Compiler 10.1\x00ISGND\x00\x00\x00\x02\x00\x00\x00\b\x00\x00\x008\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x03\x00\x008\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x03\x03\x00\x00TEXCOORD\x00\xab\xab\xabOSGNP\x00\x00\x00\x02\x00\x00\x00\b\x00\x00\x008\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\f\x00\x00A\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x0f\x00\x00\x00TEXCOORD\x00SV_Position\x00\xab\xab\xab",
1003 }
1004 shader_coarse_comp = driver.ShaderSources{
1005 Name: "coarse.comp",
1006 GLSL310ES: `#version 310 es
1007 layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
1008
1009 struct Alloc
1010 {
1011 uint offset;
1012 };
1013
1014 struct MallocResult
1015 {
1016 Alloc alloc;
1017 bool failed;
1018 };
1019
1020 struct AnnoImageRef
1021 {
1022 uint offset;
1023 };
1024
1025 struct AnnoImage
1026 {
1027 vec4 bbox;
1028 float linewidth;
1029 uint index;
1030 ivec2 offset;
1031 };
1032
1033 struct AnnoColorRef
1034 {
1035 uint offset;
1036 };
1037
1038 struct AnnoColor
1039 {
1040 vec4 bbox;
1041 float linewidth;
1042 uint rgba_color;
1043 };
1044
1045 struct AnnoBeginClipRef
1046 {
1047 uint offset;
1048 };
1049
1050 struct AnnoBeginClip
1051 {
1052 vec4 bbox;
1053 float linewidth;
1054 };
1055
1056 struct AnnotatedRef
1057 {
1058 uint offset;
1059 };
1060
1061 struct AnnotatedTag
1062 {
1063 uint tag;
1064 uint flags;
1065 };
1066
1067 struct BinInstanceRef
1068 {
1069 uint offset;
1070 };
1071
1072 struct BinInstance
1073 {
1074 uint element_ix;
1075 };
1076
1077 struct PathRef
1078 {
1079 uint offset;
1080 };
1081
1082 struct TileRef
1083 {
1084 uint offset;
1085 };
1086
1087 struct Path
1088 {
1089 uvec4 bbox;
1090 TileRef tiles;
1091 };
1092
1093 struct TileSegRef
1094 {
1095 uint offset;
1096 };
1097
1098 struct Tile
1099 {
1100 TileSegRef tile;
1101 int backdrop;
1102 };
1103
1104 struct CmdStrokeRef
1105 {
1106 uint offset;
1107 };
1108
1109 struct CmdStroke
1110 {
1111 uint tile_ref;
1112 float half_width;
1113 };
1114
1115 struct CmdFillRef
1116 {
1117 uint offset;
1118 };
1119
1120 struct CmdFill
1121 {
1122 uint tile_ref;
1123 int backdrop;
1124 };
1125
1126 struct CmdColorRef
1127 {
1128 uint offset;
1129 };
1130
1131 struct CmdColor
1132 {
1133 uint rgba_color;
1134 };
1135
1136 struct CmdImageRef
1137 {
1138 uint offset;
1139 };
1140
1141 struct CmdImage
1142 {
1143 uint index;
1144 ivec2 offset;
1145 };
1146
1147 struct CmdJumpRef
1148 {
1149 uint offset;
1150 };
1151
1152 struct CmdJump
1153 {
1154 uint new_ref;
1155 };
1156
1157 struct CmdRef
1158 {
1159 uint offset;
1160 };
1161
1162 struct Config
1163 {
1164 uint n_elements;
1165 uint n_pathseg;
1166 uint width_in_tiles;
1167 uint height_in_tiles;
1168 Alloc tile_alloc;
1169 Alloc bin_alloc;
1170 Alloc ptcl_alloc;
1171 Alloc pathseg_alloc;
1172 Alloc anno_alloc;
1173 Alloc trans_alloc;
1174 };
1175
1176 layout(binding = 0, std430) buffer Memory
1177 {
1178 uint mem_offset;
1179 uint mem_error;
1180 uint memory[];
1181 } _276;
1182
1183 layout(binding = 1, std430) readonly buffer ConfigBuf
1184 {
1185 Config conf;
1186 } _1066;
1187
1188 shared uint sh_bitmaps[4][128];
1189 shared Alloc sh_part_elements[128];
1190 shared uint sh_part_count[128];
1191 shared uint sh_elements[128];
1192 shared uint sh_tile_stride[128];
1193 shared uint sh_tile_width[128];
1194 shared uint sh_tile_x0[128];
1195 shared uint sh_tile_y0[128];
1196 shared uint sh_tile_base[128];
1197 shared uint sh_tile_count[128];
1198
1199 Alloc new_alloc(uint offset, uint size)
1200 {
1201 Alloc a;
1202 a.offset = offset;
1203 return a;
1204 }
1205
1206 Alloc slice_mem(Alloc a, uint offset, uint size)
1207 {
1208 uint param = a.offset + offset;
1209 uint param_1 = size;
1210 return new_alloc(param, param_1);
1211 }
1212
1213 bool touch_mem(Alloc alloc, uint offset)
1214 {
1215 return true;
1216 }
1217
1218 uint read_mem(Alloc alloc, uint offset)
1219 {
1220 Alloc param = alloc;
1221 uint param_1 = offset;
1222 if (!touch_mem(param, param_1))
1223 {
1224 return 0u;
1225 }
1226 uint v = _276.memory[offset];
1227 return v;
1228 }
1229
1230 BinInstanceRef BinInstance_index(BinInstanceRef ref, uint index)
1231 {
1232 return BinInstanceRef(ref.offset + (index * 4u));
1233 }
1234
1235 BinInstance BinInstance_read(Alloc a, BinInstanceRef ref)
1236 {
1237 uint ix = ref.offset >> uint(2);
1238 Alloc param = a;
1239 uint param_1 = ix + 0u;
1240 uint raw0 = read_mem(param, param_1);
1241 BinInstance s;
1242 s.element_ix = raw0;
1243 return s;
1244 }
1245
1246 AnnotatedTag Annotated_tag(Alloc a, AnnotatedRef ref)
1247 {
1248 Alloc param = a;
1249 uint param_1 = ref.offset >> uint(2);
1250 uint tag_and_flags = read_mem(param, param_1);
1251 return AnnotatedTag(tag_and_flags & 65535u, tag_and_flags >> uint(16));
1252 }
1253
1254 Path Path_read(Alloc a, PathRef ref)
1255 {
1256 uint ix = ref.offset >> uint(2);
1257 Alloc param = a;
1258 uint param_1 = ix + 0u;
1259 uint raw0 = read_mem(param, param_1);
1260 Alloc param_2 = a;
1261 uint param_3 = ix + 1u;
1262 uint raw1 = read_mem(param_2, param_3);
1263 Alloc param_4 = a;
1264 uint param_5 = ix + 2u;
1265 uint raw2 = read_mem(param_4, param_5);
1266 Path s;
1267 s.bbox = uvec4(raw0 & 65535u, raw0 >> uint(16), raw1 & 65535u, raw1 >> uint(16));
1268 s.tiles = TileRef(raw2);
1269 return s;
1270 }
1271
1272 void write_tile_alloc(uint el_ix, Alloc a)
1273 {
1274 }
1275
1276 Alloc read_tile_alloc(uint el_ix)
1277 {
1278 uint param = 0u;
1279 uint param_1 = uint(int(uint(_276.memory.length())) * 4);
1280 return new_alloc(param, param_1);
1281 }
1282
1283 Tile Tile_read(Alloc a, TileRef ref)
1284 {
1285 uint ix = ref.offset >> uint(2);
1286 Alloc param = a;
1287 uint param_1 = ix + 0u;
1288 uint raw0 = read_mem(param, param_1);
1289 Alloc param_2 = a;
1290 uint param_3 = ix + 1u;
1291 uint raw1 = read_mem(param_2, param_3);
1292 Tile s;
1293 s.tile = TileSegRef(raw0);
1294 s.backdrop = int(raw1);
1295 return s;
1296 }
1297
1298 AnnoColor AnnoColor_read(Alloc a, AnnoColorRef ref)
1299 {
1300 uint ix = ref.offset >> uint(2);
1301 Alloc param = a;
1302 uint param_1 = ix + 0u;
1303 uint raw0 = read_mem(param, param_1);
1304 Alloc param_2 = a;
1305 uint param_3 = ix + 1u;
1306 uint raw1 = read_mem(param_2, param_3);
1307 Alloc param_4 = a;
1308 uint param_5 = ix + 2u;
1309 uint raw2 = read_mem(param_4, param_5);
1310 Alloc param_6 = a;
1311 uint param_7 = ix + 3u;
1312 uint raw3 = read_mem(param_6, param_7);
1313 Alloc param_8 = a;
1314 uint param_9 = ix + 4u;
1315 uint raw4 = read_mem(param_8, param_9);
1316 Alloc param_10 = a;
1317 uint param_11 = ix + 5u;
1318 uint raw5 = read_mem(param_10, param_11);
1319 AnnoColor s;
1320 s.bbox = vec4(uintBitsToFloat(raw0), uintBitsToFloat(raw1), uintBitsToFloat(raw2), uintBitsToFloat(raw3));
1321 s.linewidth = uintBitsToFloat(raw4);
1322 s.rgba_color = raw5;
1323 return s;
1324 }
1325
1326 AnnoColor Annotated_Color_read(Alloc a, AnnotatedRef ref)
1327 {
1328 Alloc param = a;
1329 AnnoColorRef param_1 = AnnoColorRef(ref.offset + 4u);
1330 return AnnoColor_read(param, param_1);
1331 }
1332
1333 MallocResult malloc(uint size)
1334 {
1335 MallocResult r;
1336 r.failed = false;
1337 uint _282 = atomicAdd(_276.mem_offset, size);
1338 uint offset = _282;
1339 uint param = offset;
1340 uint param_1 = size;
1341 r.alloc = new_alloc(param, param_1);
1342 if ((offset + size) > uint(int(uint(_276.memory.length())) * 4))
1343 {
1344 r.failed = true;
1345 uint _303 = atomicMax(_276.mem_error, 1u);
1346 return r;
1347 }
1348 return r;
1349 }
1350
1351 void write_mem(Alloc alloc, uint offset, uint val)
1352 {
1353 Alloc param = alloc;
1354 uint param_1 = offset;
1355 if (!touch_mem(param, param_1))
1356 {
1357 return;
1358 }
1359 _276.memory[offset] = val;
1360 }
1361
1362 void CmdJump_write(Alloc a, CmdJumpRef ref, CmdJump s)
1363 {
1364 uint ix = ref.offset >> uint(2);
1365 Alloc param = a;
1366 uint param_1 = ix + 0u;
1367 uint param_2 = s.new_ref;
1368 write_mem(param, param_1, param_2);
1369 }
1370
1371 void Cmd_Jump_write(Alloc a, CmdRef ref, CmdJump s)
1372 {
1373 Alloc param = a;
1374 uint param_1 = ref.offset >> uint(2);
1375 uint param_2 = 9u;
1376 write_mem(param, param_1, param_2);
1377 Alloc param_3 = a;
1378 CmdJumpRef param_4 = CmdJumpRef(ref.offset + 4u);
1379 CmdJump param_5 = s;
1380 CmdJump_write(param_3, param_4, param_5);
1381 }
1382
1383 bool alloc_cmd(inout Alloc cmd_alloc, inout CmdRef cmd_ref, inout uint cmd_limit)
1384 {
1385 if (cmd_ref.offset < cmd_limit)
1386 {
1387 return true;
1388 }
1389 uint param = 1024u;
1390 MallocResult _968 = malloc(param);
1391 MallocResult new_cmd = _968;
1392 if (new_cmd.failed)
1393 {
1394 return false;
1395 }
1396 CmdJump jump = CmdJump(new_cmd.alloc.offset);
1397 Alloc param_1 = cmd_alloc;
1398 CmdRef param_2 = cmd_ref;
1399 CmdJump param_3 = jump;
1400 Cmd_Jump_write(param_1, param_2, param_3);
1401 cmd_alloc = new_cmd.alloc;
1402 cmd_ref = CmdRef(cmd_alloc.offset);
1403 cmd_limit = (cmd_alloc.offset + 1024u) - 36u;
1404 return true;
1405 }
1406
1407 uint fill_mode_from_flags(uint flags)
1408 {
1409 return flags & 1u;
1410 }
1411
1412 void CmdFill_write(Alloc a, CmdFillRef ref, CmdFill s)
1413 {
1414 uint ix = ref.offset >> uint(2);
1415 Alloc param = a;
1416 uint param_1 = ix + 0u;
1417 uint param_2 = s.tile_ref;
1418 write_mem(param, param_1, param_2);
1419 Alloc param_3 = a;
1420 uint param_4 = ix + 1u;
1421 uint param_5 = uint(s.backdrop);
1422 write_mem(param_3, param_4, param_5);
1423 }
1424
1425 void Cmd_Fill_write(Alloc a, CmdRef ref, CmdFill s)
1426 {
1427 Alloc param = a;
1428 uint param_1 = ref.offset >> uint(2);
1429 uint param_2 = 1u;
1430 write_mem(param, param_1, param_2);
1431 Alloc param_3 = a;
1432 CmdFillRef param_4 = CmdFillRef(ref.offset + 4u);
1433 CmdFill param_5 = s;
1434 CmdFill_write(param_3, param_4, param_5);
1435 }
1436
1437 void Cmd_Solid_write(Alloc a, CmdRef ref)
1438 {
1439 Alloc param = a;
1440 uint param_1 = ref.offset >> uint(2);
1441 uint param_2 = 3u;
1442 write_mem(param, param_1, param_2);
1443 }
1444
1445 void CmdStroke_write(Alloc a, CmdStrokeRef ref, CmdStroke s)
1446 {
1447 uint ix = ref.offset >> uint(2);
1448 Alloc param = a;
1449 uint param_1 = ix + 0u;
1450 uint param_2 = s.tile_ref;
1451 write_mem(param, param_1, param_2);
1452 Alloc param_3 = a;
1453 uint param_4 = ix + 1u;
1454 uint param_5 = floatBitsToUint(s.half_width);
1455 write_mem(param_3, param_4, param_5);
1456 }
1457
1458 void Cmd_Stroke_write(Alloc a, CmdRef ref, CmdStroke s)
1459 {
1460 Alloc param = a;
1461 uint param_1 = ref.offset >> uint(2);
1462 uint param_2 = 2u;
1463 write_mem(param, param_1, param_2);
1464 Alloc param_3 = a;
1465 CmdStrokeRef param_4 = CmdStrokeRef(ref.offset + 4u);
1466 CmdStroke param_5 = s;
1467 CmdStroke_write(param_3, param_4, param_5);
1468 }
1469
1470 void write_fill(Alloc alloc, inout CmdRef cmd_ref, uint flags, Tile tile, float linewidth)
1471 {
1472 uint param = flags;
1473 if (fill_mode_from_flags(param) == 0u)
1474 {
1475 if (tile.tile.offset != 0u)
1476 {
1477 CmdFill cmd_fill = CmdFill(tile.tile.offset, tile.backdrop);
1478 Alloc param_1 = alloc;
1479 CmdRef param_2 = cmd_ref;
1480 CmdFill param_3 = cmd_fill;
1481 Cmd_Fill_write(param_1, param_2, param_3);
1482 cmd_ref.offset += 12u;
1483 }
1484 else
1485 {
1486 Alloc param_4 = alloc;
1487 CmdRef param_5 = cmd_ref;
1488 Cmd_Solid_write(param_4, param_5);
1489 cmd_ref.offset += 4u;
1490 }
1491 }
1492 else
1493 {
1494 CmdStroke cmd_stroke = CmdStroke(tile.tile.offset, 0.5 * linewidth);
1495 Alloc param_6 = alloc;
1496 CmdRef param_7 = cmd_ref;
1497 CmdStroke param_8 = cmd_stroke;
1498 Cmd_Stroke_write(param_6, param_7, param_8);
1499 cmd_ref.offset += 12u;
1500 }
1501 }
1502
1503 void CmdColor_write(Alloc a, CmdColorRef ref, CmdColor s)
1504 {
1505 uint ix = ref.offset >> uint(2);
1506 Alloc param = a;
1507 uint param_1 = ix + 0u;
1508 uint param_2 = s.rgba_color;
1509 write_mem(param, param_1, param_2);
1510 }
1511
1512 void Cmd_Color_write(Alloc a, CmdRef ref, CmdColor s)
1513 {
1514 Alloc param = a;
1515 uint param_1 = ref.offset >> uint(2);
1516 uint param_2 = 5u;
1517 write_mem(param, param_1, param_2);
1518 Alloc param_3 = a;
1519 CmdColorRef param_4 = CmdColorRef(ref.offset + 4u);
1520 CmdColor param_5 = s;
1521 CmdColor_write(param_3, param_4, param_5);
1522 }
1523
1524 AnnoImage AnnoImage_read(Alloc a, AnnoImageRef ref)
1525 {
1526 uint ix = ref.offset >> uint(2);
1527 Alloc param = a;
1528 uint param_1 = ix + 0u;
1529 uint raw0 = read_mem(param, param_1);
1530 Alloc param_2 = a;
1531 uint param_3 = ix + 1u;
1532 uint raw1 = read_mem(param_2, param_3);
1533 Alloc param_4 = a;
1534 uint param_5 = ix + 2u;
1535 uint raw2 = read_mem(param_4, param_5);
1536 Alloc param_6 = a;
1537 uint param_7 = ix + 3u;
1538 uint raw3 = read_mem(param_6, param_7);
1539 Alloc param_8 = a;
1540 uint param_9 = ix + 4u;
1541 uint raw4 = read_mem(param_8, param_9);
1542 Alloc param_10 = a;
1543 uint param_11 = ix + 5u;
1544 uint raw5 = read_mem(param_10, param_11);
1545 Alloc param_12 = a;
1546 uint param_13 = ix + 6u;
1547 uint raw6 = read_mem(param_12, param_13);
1548 AnnoImage s;
1549 s.bbox = vec4(uintBitsToFloat(raw0), uintBitsToFloat(raw1), uintBitsToFloat(raw2), uintBitsToFloat(raw3));
1550 s.linewidth = uintBitsToFloat(raw4);
1551 s.index = raw5;
1552 s.offset = ivec2(int(raw6 << uint(16)) >> 16, int(raw6) >> 16);
1553 return s;
1554 }
1555
1556 AnnoImage Annotated_Image_read(Alloc a, AnnotatedRef ref)
1557 {
1558 Alloc param = a;
1559 AnnoImageRef param_1 = AnnoImageRef(ref.offset + 4u);
1560 return AnnoImage_read(param, param_1);
1561 }
1562
1563 void CmdImage_write(Alloc a, CmdImageRef ref, CmdImage s)
1564 {
1565 uint ix = ref.offset >> uint(2);
1566 Alloc param = a;
1567 uint param_1 = ix + 0u;
1568 uint param_2 = s.index;
1569 write_mem(param, param_1, param_2);
1570 Alloc param_3 = a;
1571 uint param_4 = ix + 1u;
1572 uint param_5 = (uint(s.offset.x) & 65535u) | (uint(s.offset.y) << uint(16));
1573 write_mem(param_3, param_4, param_5);
1574 }
1575
1576 void Cmd_Image_write(Alloc a, CmdRef ref, CmdImage s)
1577 {
1578 Alloc param = a;
1579 uint param_1 = ref.offset >> uint(2);
1580 uint param_2 = 6u;
1581 write_mem(param, param_1, param_2);
1582 Alloc param_3 = a;
1583 CmdImageRef param_4 = CmdImageRef(ref.offset + 4u);
1584 CmdImage param_5 = s;
1585 CmdImage_write(param_3, param_4, param_5);
1586 }
1587
1588 AnnoBeginClip AnnoBeginClip_read(Alloc a, AnnoBeginClipRef ref)
1589 {
1590 uint ix = ref.offset >> uint(2);
1591 Alloc param = a;
1592 uint param_1 = ix + 0u;
1593 uint raw0 = read_mem(param, param_1);
1594 Alloc param_2 = a;
1595 uint param_3 = ix + 1u;
1596 uint raw1 = read_mem(param_2, param_3);
1597 Alloc param_4 = a;
1598 uint param_5 = ix + 2u;
1599 uint raw2 = read_mem(param_4, param_5);
1600 Alloc param_6 = a;
1601 uint param_7 = ix + 3u;
1602 uint raw3 = read_mem(param_6, param_7);
1603 Alloc param_8 = a;
1604 uint param_9 = ix + 4u;
1605 uint raw4 = read_mem(param_8, param_9);
1606 AnnoBeginClip s;
1607 s.bbox = vec4(uintBitsToFloat(raw0), uintBitsToFloat(raw1), uintBitsToFloat(raw2), uintBitsToFloat(raw3));
1608 s.linewidth = uintBitsToFloat(raw4);
1609 return s;
1610 }
1611
1612 AnnoBeginClip Annotated_BeginClip_read(Alloc a, AnnotatedRef ref)
1613 {
1614 Alloc param = a;
1615 AnnoBeginClipRef param_1 = AnnoBeginClipRef(ref.offset + 4u);
1616 return AnnoBeginClip_read(param, param_1);
1617 }
1618
1619 void Cmd_BeginClip_write(Alloc a, CmdRef ref)
1620 {
1621 Alloc param = a;
1622 uint param_1 = ref.offset >> uint(2);
1623 uint param_2 = 7u;
1624 write_mem(param, param_1, param_2);
1625 }
1626
1627 void Cmd_EndClip_write(Alloc a, CmdRef ref)
1628 {
1629 Alloc param = a;
1630 uint param_1 = ref.offset >> uint(2);
1631 uint param_2 = 8u;
1632 write_mem(param, param_1, param_2);
1633 }
1634
1635 void Cmd_End_write(Alloc a, CmdRef ref)
1636 {
1637 Alloc param = a;
1638 uint param_1 = ref.offset >> uint(2);
1639 uint param_2 = 0u;
1640 write_mem(param, param_1, param_2);
1641 }
1642
1643 void alloc_write(Alloc a, uint offset, Alloc alloc)
1644 {
1645 Alloc param = a;
1646 uint param_1 = offset >> uint(2);
1647 uint param_2 = alloc.offset;
1648 write_mem(param, param_1, param_2);
1649 }
1650
1651 void main()
1652 {
1653 if (_276.mem_error != 0u)
1654 {
1655 return;
1656 }
1657 uint width_in_bins = ((_1066.conf.width_in_tiles + 16u) - 1u) / 16u;
1658 uint bin_ix = (width_in_bins * gl_WorkGroupID.y) + gl_WorkGroupID.x;
1659 uint partition_ix = 0u;
1660 uint n_partitions = ((_1066.conf.n_elements + 128u) - 1u) / 128u;
1661 uint th_ix = gl_LocalInvocationID.x;
1662 uint bin_tile_x = 16u * gl_WorkGroupID.x;
1663 uint bin_tile_y = 8u * gl_WorkGroupID.y;
1664 uint tile_x = gl_LocalInvocationID.x % 16u;
1665 uint tile_y = gl_LocalInvocationID.x / 16u;
1666 uint this_tile_ix = (((bin_tile_y + tile_y) * _1066.conf.width_in_tiles) + bin_tile_x) + tile_x;
1667 Alloc param;
1668 param.offset = _1066.conf.ptcl_alloc.offset;
1669 uint param_1 = this_tile_ix * 1024u;
1670 uint param_2 = 1024u;
1671 Alloc cmd_alloc = slice_mem(param, param_1, param_2);
1672 CmdRef cmd_ref = CmdRef(cmd_alloc.offset);
1673 uint cmd_limit = (cmd_ref.offset + 1024u) - 36u;
1674 uint clip_depth = 0u;
1675 uint clip_zero_depth = 0u;
1676 uint clip_one_mask = 0u;
1677 uint rd_ix = 0u;
1678 uint wr_ix = 0u;
1679 uint part_start_ix = 0u;
1680 uint ready_ix = 0u;
1681 Alloc param_3 = cmd_alloc;
1682 uint param_4 = 0u;
1683 uint param_5 = 8u;
1684 Alloc scratch_alloc = slice_mem(param_3, param_4, param_5);
1685 cmd_ref.offset += 8u;
1686 uint num_begin_slots = 0u;
1687 uint begin_slot = 0u;
1688 Alloc param_6;
1689 Alloc param_8;
1690 uint _1354;
1691 uint element_ix;
1692 AnnotatedRef ref;
1693 Alloc param_16;
1694 Alloc param_18;
1695 uint tile_count;
1696 Alloc param_24;
1697 uint _1667;
1698 bool include_tile;
1699 Alloc param_29;
1700 Tile tile_1;
1701 Alloc param_34;
1702 Alloc param_50;
1703 Alloc param_66;
1704 while (true)
1705 {
1706 for (uint i = 0u; i < 4u; i++)
1707 {
1708 sh_bitmaps[i][th_ix] = 0u;
1709 }
1710 bool _1406;
1711 for (;;)
1712 {
1713 if ((ready_ix == wr_ix) && (partition_ix < n_partitions))
1714 {
1715 part_start_ix = ready_ix;
1716 uint count = 0u;
1717 bool _1204 = th_ix < 128u;
1718 bool _1212;
1719 if (_1204)
1720 {
1721 _1212 = (partition_ix + th_ix) < n_partitions;
1722 }
1723 else
1724 {
1725 _1212 = _1204;
1726 }
1727 if (_1212)
1728 {
1729 uint in_ix = (_1066.conf.bin_alloc.offset >> uint(2)) + ((((partition_ix + th_ix) * 128u) + bin_ix) * 2u);
1730 param_6.offset = _1066.conf.bin_alloc.offset;
1731 uint param_7 = in_ix;
1732 count = read_mem(param_6, param_7);
1733 param_8.offset = _1066.conf.bin_alloc.offset;
1734 uint param_9 = in_ix + 1u;
1735 uint offset = read_mem(param_8, param_9);
1736 uint param_10 = offset;
1737 uint param_11 = count * 4u;
1738 sh_part_elements[th_ix] = new_alloc(param_10, param_11);
1739 }
1740 for (uint i_1 = 0u; i_1 < 7u; i_1++)
1741 {
1742 if (th_ix < 128u)
1743 {
1744 sh_part_count[th_ix] = count;
1745 }
1746 barrier();
1747 if (th_ix < 128u)
1748 {
1749 if (th_ix >= uint(1 << int(i_1)))
1750 {
1751 count += sh_part_count[th_ix - uint(1 << int(i_1))];
1752 }
1753 }
1754 barrier();
1755 }
1756 if (th_ix < 128u)
1757 {
1758 sh_part_count[th_ix] = part_start_ix + count;
1759 }
1760 barrier();
1761 ready_ix = sh_part_count[127];
1762 partition_ix += 128u;
1763 }
1764 uint ix = rd_ix + th_ix;
1765 if ((ix >= wr_ix) && (ix < ready_ix))
1766 {
1767 uint part_ix = 0u;
1768 for (uint i_2 = 0u; i_2 < 7u; i_2++)
1769 {
1770 uint probe = part_ix + uint(64 >> int(i_2));
1771 if (ix >= sh_part_count[probe - 1u])
1772 {
1773 part_ix = probe;
1774 }
1775 }
1776 if (part_ix > 0u)
1777 {
1778 _1354 = sh_part_count[part_ix - 1u];
1779 }
1780 else
1781 {
1782 _1354 = part_start_ix;
1783 }
1784 ix -= _1354;
1785 Alloc bin_alloc = sh_part_elements[part_ix];
1786 BinInstanceRef inst_ref = BinInstanceRef(bin_alloc.offset);
1787 BinInstanceRef param_12 = inst_ref;
1788 uint param_13 = ix;
1789 Alloc param_14 = bin_alloc;
1790 BinInstanceRef param_15 = BinInstance_index(param_12, param_13);
1791 BinInstance inst = BinInstance_read(param_14, param_15);
1792 sh_elements[th_ix] = inst.element_ix;
1793 }
1794 barrier();
1795 wr_ix = min((rd_ix + 128u), ready_ix);
1796 bool _1396 = (wr_ix - rd_ix) < 128u;
1797 if (_1396)
1798 {
1799 _1406 = (wr_ix < ready_ix) || (partition_ix < n_partitions);
1800 }
1801 else
1802 {
1803 _1406 = _1396;
1804 }
1805 if (_1406)
1806 {
1807 continue;
1808 }
1809 else
1810 {
1811 break;
1812 }
1813 }
1814 uint tag = 0u;
1815 if ((th_ix + rd_ix) < wr_ix)
1816 {
1817 element_ix = sh_elements[th_ix];
1818 ref = AnnotatedRef(_1066.conf.anno_alloc.offset + (element_ix * 32u));
1819 param_16.offset = _1066.conf.anno_alloc.offset;
1820 AnnotatedRef param_17 = ref;
1821 tag = Annotated_tag(param_16, param_17).tag;
1822 }
1823 switch (tag)
1824 {
1825 case 1u:
1826 case 2u:
1827 case 3u:
1828 case 4u:
1829 {
1830 uint path_ix = element_ix;
1831 param_18.offset = _1066.conf.tile_alloc.offset;
1832 PathRef param_19 = PathRef(_1066.conf.tile_alloc.offset + (path_ix * 12u));
1833 Path path = Path_read(param_18, param_19);
1834 uint stride = path.bbox.z - path.bbox.x;
1835 sh_tile_stride[th_ix] = stride;
1836 int dx = int(path.bbox.x) - int(bin_tile_x);
1837 int dy = int(path.bbox.y) - int(bin_tile_y);
1838 int x0 = clamp(dx, 0, 16);
1839 int y0 = clamp(dy, 0, 8);
1840 int x1 = clamp(int(path.bbox.z) - int(bin_tile_x), 0, 16);
1841 int y1 = clamp(int(path.bbox.w) - int(bin_tile_y), 0, 8);
1842 sh_tile_width[th_ix] = uint(x1 - x0);
1843 sh_tile_x0[th_ix] = uint(x0);
1844 sh_tile_y0[th_ix] = uint(y0);
1845 tile_count = uint(x1 - x0) * uint(y1 - y0);
1846 uint base = path.tiles.offset - (((uint(dy) * stride) + uint(dx)) * 8u);
1847 sh_tile_base[th_ix] = base;
1848 uint param_20 = path.tiles.offset;
1849 uint param_21 = ((path.bbox.z - path.bbox.x) * (path.bbox.w - path.bbox.y)) * 8u;
1850 Alloc path_alloc = new_alloc(param_20, param_21);
1851 uint param_22 = th_ix;
1852 Alloc param_23 = path_alloc;
1853 write_tile_alloc(param_22, param_23);
1854 break;
1855 }
1856 default:
1857 {
1858 tile_count = 0u;
1859 break;
1860 }
1861 }
1862 sh_tile_count[th_ix] = tile_count;
1863 for (uint i_3 = 0u; i_3 < 7u; i_3++)
1864 {
1865 barrier();
1866 if (th_ix >= uint(1 << int(i_3)))
1867 {
1868 tile_count += sh_tile_count[th_ix - uint(1 << int(i_3))];
1869 }
1870 barrier();
1871 sh_tile_count[th_ix] = tile_count;
1872 }
1873 barrier();
1874 uint total_tile_count = sh_tile_count[127];
1875 for (uint ix_1 = th_ix; ix_1 < total_tile_count; ix_1 += 128u)
1876 {
1877 uint el_ix = 0u;
1878 for (uint i_4 = 0u; i_4 < 7u; i_4++)
1879 {
1880 uint probe_1 = el_ix + uint(64 >> int(i_4));
1881 if (ix_1 >= sh_tile_count[probe_1 - 1u])
1882 {
1883 el_ix = probe_1;
1884 }
1885 }
1886 AnnotatedRef ref_1 = AnnotatedRef(_1066.conf.anno_alloc.offset + (sh_elements[el_ix] * 32u));
1887 param_24.offset = _1066.conf.anno_alloc.offset;
1888 AnnotatedRef param_25 = ref_1;
1889 uint tag_1 = Annotated_tag(param_24, param_25).tag;
1890 if (el_ix > 0u)
1891 {
1892 _1667 = sh_tile_count[el_ix - 1u];
1893 }
1894 else
1895 {
1896 _1667 = 0u;
1897 }
1898 uint seq_ix = ix_1 - _1667;
1899 uint width = sh_tile_width[el_ix];
1900 uint x = sh_tile_x0[el_ix] + (seq_ix % width);
1901 uint y = sh_tile_y0[el_ix] + (seq_ix / width);
1902 if ((tag_1 == 3u) || (tag_1 == 4u))
1903 {
1904 include_tile = true;
1905 }
1906 else
1907 {
1908 uint param_26 = el_ix;
1909 Alloc param_27 = read_tile_alloc(param_26);
1910 TileRef param_28 = TileRef(sh_tile_base[el_ix] + (((sh_tile_stride[el_ix] * y) + x) * 8u));
1911 Tile tile = Tile_read(param_27, param_28);
1912 bool _1728 = tile.tile.offset != 0u;
1913 bool _1735;
1914 if (!_1728)
1915 {
1916 _1735 = tile.backdrop != 0;
1917 }
1918 else
1919 {
1920 _1735 = _1728;
1921 }
1922 include_tile = _1735;
1923 }
1924 if (include_tile)
1925 {
1926 uint el_slice = el_ix / 32u;
1927 uint el_mask = uint(1 << int(el_ix & 31u));
1928 uint _1755 = atomicOr(sh_bitmaps[el_slice][(y * 16u) + x], el_mask);
1929 }
1930 }
1931 barrier();
1932 uint slice_ix = 0u;
1933 uint bitmap = sh_bitmaps[0][th_ix];
1934 while (true)
1935 {
1936 if (bitmap == 0u)
1937 {
1938 slice_ix++;
1939 if (slice_ix == 4u)
1940 {
1941 break;
1942 }
1943 bitmap = sh_bitmaps[slice_ix][th_ix];
1944 if (bitmap == 0u)
1945 {
1946 continue;
1947 }
1948 }
1949 uint element_ref_ix = (slice_ix * 32u) + uint(findLSB(bitmap));
1950 uint element_ix_1 = sh_elements[element_ref_ix];
1951 bitmap &= (bitmap - 1u);
1952 ref = AnnotatedRef(_1066.conf.anno_alloc.offset + (element_ix_1 * 32u));
1953 param_29.offset = _1066.conf.anno_alloc.offset;
1954 AnnotatedRef param_30 = ref;
1955 AnnotatedTag tag_2 = Annotated_tag(param_29, param_30);
1956 if (clip_zero_depth == 0u)
1957 {
1958 switch (tag_2.tag)
1959 {
1960 case 1u:
1961 {
1962 uint param_31 = element_ref_ix;
1963 Alloc param_32 = read_tile_alloc(param_31);
1964 TileRef param_33 = TileRef(sh_tile_base[element_ref_ix] + (((sh_tile_stride[element_ref_ix] * tile_y) + tile_x) * 8u));
1965 tile_1 = Tile_read(param_32, param_33);
1966 param_34.offset = _1066.conf.anno_alloc.offset;
1967 AnnotatedRef param_35 = ref;
1968 AnnoColor fill = Annotated_Color_read(param_34, param_35);
1969 Alloc param_36 = cmd_alloc;
1970 CmdRef param_37 = cmd_ref;
1971 uint param_38 = cmd_limit;
1972 bool _1865 = alloc_cmd(param_36, param_37, param_38);
1973 cmd_alloc = param_36;
1974 cmd_ref = param_37;
1975 cmd_limit = param_38;
1976 if (!_1865)
1977 {
1978 break;
1979 }
1980 Alloc param_39 = cmd_alloc;
1981 CmdRef param_40 = cmd_ref;
1982 uint param_41 = tag_2.flags;
1983 Tile param_42 = tile_1;
1984 float param_43 = fill.linewidth;
1985 write_fill(param_39, param_40, param_41, param_42, param_43);
1986 cmd_ref = param_40;
1987 Alloc param_44 = cmd_alloc;
1988 CmdRef param_45 = cmd_ref;
1989 CmdColor param_46 = CmdColor(fill.rgba_color);
1990 Cmd_Color_write(param_44, param_45, param_46);
1991 cmd_ref.offset += 8u;
1992 break;
1993 }
1994 case 2u:
1995 {
1996 uint param_47 = element_ref_ix;
1997 Alloc param_48 = read_tile_alloc(param_47);
1998 TileRef param_49 = TileRef(sh_tile_base[element_ref_ix] + (((sh_tile_stride[element_ref_ix] * tile_y) + tile_x) * 8u));
1999 tile_1 = Tile_read(param_48, param_49);
2000 param_50.offset = _1066.conf.anno_alloc.offset;
2001 AnnotatedRef param_51 = ref;
2002 AnnoImage fill_img = Annotated_Image_read(param_50, param_51);
2003 Alloc param_52 = cmd_alloc;
2004 CmdRef param_53 = cmd_ref;
2005 uint param_54 = cmd_limit;
2006 bool _1935 = alloc_cmd(param_52, param_53, param_54);
2007 cmd_alloc = param_52;
2008 cmd_ref = param_53;
2009 cmd_limit = param_54;
2010 if (!_1935)
2011 {
2012 break;
2013 }
2014 Alloc param_55 = cmd_alloc;
2015 CmdRef param_56 = cmd_ref;
2016 uint param_57 = tag_2.flags;
2017 Tile param_58 = tile_1;
2018 float param_59 = fill_img.linewidth;
2019 write_fill(param_55, param_56, param_57, param_58, param_59);
2020 cmd_ref = param_56;
2021 Alloc param_60 = cmd_alloc;
2022 CmdRef param_61 = cmd_ref;
2023 CmdImage param_62 = CmdImage(fill_img.index, fill_img.offset);
2024 Cmd_Image_write(param_60, param_61, param_62);
2025 cmd_ref.offset += 12u;
2026 break;
2027 }
2028 case 3u:
2029 {
2030 uint param_63 = element_ref_ix;
2031 Alloc param_64 = read_tile_alloc(param_63);
2032 TileRef param_65 = TileRef(sh_tile_base[element_ref_ix] + (((sh_tile_stride[element_ref_ix] * tile_y) + tile_x) * 8u));
2033 tile_1 = Tile_read(param_64, param_65);
2034 bool _1994 = tile_1.tile.offset == 0u;
2035 bool _2000;
2036 if (_1994)
2037 {
2038 _2000 = tile_1.backdrop == 0;
2039 }
2040 else
2041 {
2042 _2000 = _1994;
2043 }
2044 if (_2000)
2045 {
2046 clip_zero_depth = clip_depth + 1u;
2047 }
2048 else
2049 {
2050 if ((tile_1.tile.offset == 0u) && (clip_depth < 32u))
2051 {
2052 clip_one_mask |= uint(1 << int(clip_depth));
2053 }
2054 else
2055 {
2056 param_66.offset = _1066.conf.anno_alloc.offset;
2057 AnnotatedRef param_67 = ref;
2058 AnnoBeginClip begin_clip = Annotated_BeginClip_read(param_66, param_67);
2059 Alloc param_68 = cmd_alloc;
2060 CmdRef param_69 = cmd_ref;
2061 uint param_70 = cmd_limit;
2062 bool _2035 = alloc_cmd(param_68, param_69, param_70);
2063 cmd_alloc = param_68;
2064 cmd_ref = param_69;
2065 cmd_limit = param_70;
2066 if (!_2035)
2067 {
2068 break;
2069 }
2070 Alloc param_71 = cmd_alloc;
2071 CmdRef param_72 = cmd_ref;
2072 uint param_73 = tag_2.flags;
2073 Tile param_74 = tile_1;
2074 float param_75 = begin_clip.linewidth;
2075 write_fill(param_71, param_72, param_73, param_74, param_75);
2076 cmd_ref = param_72;
2077 Alloc param_76 = cmd_alloc;
2078 CmdRef param_77 = cmd_ref;
2079 Cmd_BeginClip_write(param_76, param_77);
2080 cmd_ref.offset += 4u;
2081 if (clip_depth < 32u)
2082 {
2083 clip_one_mask &= uint(~(1 << int(clip_depth)));
2084 }
2085 begin_slot++;
2086 num_begin_slots = max(num_begin_slots, begin_slot);
2087 }
2088 }
2089 clip_depth++;
2090 break;
2091 }
2092 case 4u:
2093 {
2094 clip_depth--;
2095 bool _2087 = clip_depth >= 32u;
2096 bool _2097;
2097 if (!_2087)
2098 {
2099 _2097 = (clip_one_mask & uint(1 << int(clip_depth))) == 0u;
2100 }
2101 else
2102 {
2103 _2097 = _2087;
2104 }
2105 if (_2097)
2106 {
2107 Alloc param_78 = cmd_alloc;
2108 CmdRef param_79 = cmd_ref;
2109 uint param_80 = cmd_limit;
2110 bool _2106 = alloc_cmd(param_78, param_79, param_80);
2111 cmd_alloc = param_78;
2112 cmd_ref = param_79;
2113 cmd_limit = param_80;
2114 if (!_2106)
2115 {
2116 break;
2117 }
2118 Alloc param_81 = cmd_alloc;
2119 CmdRef param_82 = cmd_ref;
2120 Cmd_Solid_write(param_81, param_82);
2121 cmd_ref.offset += 4u;
2122 begin_slot--;
2123 Alloc param_83 = cmd_alloc;
2124 CmdRef param_84 = cmd_ref;
2125 Cmd_EndClip_write(param_83, param_84);
2126 cmd_ref.offset += 4u;
2127 }
2128 break;
2129 }
2130 }
2131 }
2132 else
2133 {
2134 switch (tag_2.tag)
2135 {
2136 case 3u:
2137 {
2138 clip_depth++;
2139 break;
2140 }
2141 case 4u:
2142 {
2143 if (clip_depth == clip_zero_depth)
2144 {
2145 clip_zero_depth = 0u;
2146 }
2147 clip_depth--;
2148 break;
2149 }
2150 }
2151 }
2152 }
2153 barrier();
2154 rd_ix += 128u;
2155 if ((rd_ix >= ready_ix) && (partition_ix >= n_partitions))
2156 {
2157 break;
2158 }
2159 }
2160 bool _2171 = (bin_tile_x + tile_x) < _1066.conf.width_in_tiles;
2161 bool _2180;
2162 if (_2171)
2163 {
2164 _2180 = (bin_tile_y + tile_y) < _1066.conf.height_in_tiles;
2165 }
2166 else
2167 {
2168 _2180 = _2171;
2169 }
2170 if (_2180)
2171 {
2172 Alloc param_85 = cmd_alloc;
2173 CmdRef param_86 = cmd_ref;
2174 Cmd_End_write(param_85, param_86);
2175 if (num_begin_slots > 0u)
2176 {
2177 uint scratch_size = (((num_begin_slots * 32u) * 32u) * 2u) * 4u;
2178 uint param_87 = scratch_size;
2179 MallocResult _2201 = malloc(param_87);
2180 MallocResult scratch = _2201;
2181 Alloc param_88 = scratch_alloc;
2182 uint param_89 = scratch_alloc.offset;
2183 Alloc param_90 = scratch.alloc;
2184 alloc_write(param_88, param_89, param_90);
2185 }
2186 }
2187 }
2188
2189 `,
2190 }
2191 shader_copy_frag = driver.ShaderSources{
2192 Name: "copy.frag",
2193 Textures: []driver.TextureBinding{{Name: "tex", Binding: 0}},
2194 GLSL300ES: `#version 300 es
2195 precision mediump float;
2196 precision highp int;
2197
2198 uniform mediump sampler2D tex;
2199
2200 layout(location = 0) out highp vec4 fragColor;
2201
2202 highp vec3 sRGBtoRGB(highp vec3 rgb)
2203 {
2204 bvec3 cutoff = greaterThanEqual(rgb, vec3(0.040449999272823333740234375));
2205 highp vec3 below = rgb / vec3(12.9200000762939453125);
2206 highp vec3 above = pow((rgb + vec3(0.054999999701976776123046875)) / vec3(1.05499994754791259765625), vec3(2.400000095367431640625));
2207 return vec3(cutoff.x ? above.x : below.x, cutoff.y ? above.y : below.y, cutoff.z ? above.z : below.z);
2208 }
2209
2210 void main()
2211 {
2212 highp vec4 texel = texelFetch(tex, ivec2(gl_FragCoord.xy), 0);
2213 highp vec3 param = texel.xyz;
2214 highp vec3 rgb = sRGBtoRGB(param);
2215 fragColor = vec4(rgb, texel.w);
2216 }
2217
2218 `,
2219 GLSL130: `#version 130
2220 #ifdef GL_ARB_shading_language_420pack
2221 #extension GL_ARB_shading_language_420pack : require
2222 #endif
2223
2224 layout(binding = 0) uniform sampler2D tex;
2225
2226 out vec4 fragColor;
2227
2228 vec3 sRGBtoRGB(vec3 rgb)
2229 {
2230 bvec3 cutoff = greaterThanEqual(rgb, vec3(0.040449999272823333740234375));
2231 vec3 below = rgb / vec3(12.9200000762939453125);
2232 vec3 above = pow((rgb + vec3(0.054999999701976776123046875)) / vec3(1.05499994754791259765625), vec3(2.400000095367431640625));
2233 return vec3(cutoff.x ? above.x : below.x, cutoff.y ? above.y : below.y, cutoff.z ? above.z : below.z);
2234 }
2235
2236 void main()
2237 {
2238 vec4 texel = texelFetch(tex, ivec2(gl_FragCoord.xy), 0);
2239 vec3 param = texel.xyz;
2240 vec3 rgb = sRGBtoRGB(param);
2241 fragColor = vec4(rgb, texel.w);
2242 }
2243
2244 `,
2245 GLSL150: `#version 150
2246 #ifdef GL_ARB_shading_language_420pack
2247 #extension GL_ARB_shading_language_420pack : require
2248 #endif
2249
2250 layout(binding = 0) uniform sampler2D tex;
2251
2252 out vec4 fragColor;
2253
2254 vec3 sRGBtoRGB(vec3 rgb)
2255 {
2256 bvec3 cutoff = greaterThanEqual(rgb, vec3(0.040449999272823333740234375));
2257 vec3 below = rgb / vec3(12.9200000762939453125);
2258 vec3 above = pow((rgb + vec3(0.054999999701976776123046875)) / vec3(1.05499994754791259765625), vec3(2.400000095367431640625));
2259 return vec3(cutoff.x ? above.x : below.x, cutoff.y ? above.y : below.y, cutoff.z ? above.z : below.z);
2260 }
2261
2262 void main()
2263 {
2264 vec4 texel = texelFetch(tex, ivec2(gl_FragCoord.xy), 0);
2265 vec3 param = texel.xyz;
2266 vec3 rgb = sRGBtoRGB(param);
2267 fragColor = vec4(rgb, texel.w);
2268 }
2269
2270 `,
2271 HLSL: "DXBC\xe6\x89_t\x8b\xfc\xea8\xd9'\xad5.Èk\x01\x00\x00\x00H\x03\x00\x00\x05\x00\x00\x004\x00\x00\x00\xa4\x00\x00\x00\xd8\x00\x00\x00\f\x01\x00\x00\xcc\x02\x00\x00RDEFh\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1c\x00\x00\x00\x00\x04\xff\xff\x00\x01\x00\x00@\x00\x00\x00<\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x04\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x01\x00\x00\x00\r\x00\x00\x00tex\x00Microsoft (R) HLSL Shader Compiler 10.1\x00ISGN,\x00\x00\x00\x01\x00\x00\x00\b\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x0f\x03\x00\x00SV_Position\x00OSGN,\x00\x00\x00\x01\x00\x00\x00\b\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00SV_Target\x00\xab\xabSHDR\xb8\x01\x00\x00@\x00\x00\x00n\x00\x00\x00X\x18\x00\x04\x00p\x10\x00\x00\x00\x00\x00UU\x00\x00d \x00\x042\x10\x10\x00\x00\x00\x00\x00\x01\x00\x00\x00e\x00\x00\x03\xf2 \x10\x00\x00\x00\x00\x00h\x00\x00\x02\x03\x00\x00\x00\x1b\x00\x00\x052\x00\x10\x00\x00\x00\x00\x00F\x10\x10\x00\x00\x00\x00\x006\x00\x00\b\xc2\x00\x10\x00\x00\x00\x00\x00\x02@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-\x00\x00\a\xf2\x00\x10\x00\x00\x00\x00\x00F\x0e\x10\x00\x00\x00\x00\x00F~\x10\x00\x00\x00\x00\x00\x00\x00\x00\nr\x00\x10\x00\x01\x00\x00\x00F\x02\x10\x00\x00\x00\x00\x00\x02@\x00\x00\xaeGa=\xaeGa=\xaeGa=\x00\x00\x00\x008\x00\x00\nr\x00\x10\x00\x01\x00\x00\x00F\x02\x10\x00\x01\x00\x00\x00\x02@\x00\x00o\xa7r?o\xa7r?o\xa7r?\x00\x00\x00\x00/\x00\x00\x05r\x00\x10\x00\x01\x00\x00\x00F\x02\x10\x00\x01\x00\x00\x008\x00\x00\nr\x00\x10\x00\x01\x00\x00\x00F\x02\x10\x00\x01\x00\x00\x00\x02@\x00\x00\x9a\x99\x19@\x9a\x99\x19@\x9a\x99\x19@\x00\x00\x00\x00\x19\x00\x00\x05r\x00\x10\x00\x01\x00\x00\x00F\x02\x10\x00\x01\x00\x00\x00\x1d\x00\x00\nr\x00\x10\x00\x02\x00\x00\x00F\x02\x10\x00\x00\x00\x00\x00\x02@\x00\x00\xe6\xae%=\xe6\xae%=\xe6\xae%=\x00\x00\x00\x008\x00\x00\nr\x00\x10\x00\x00\x00\x00\x00F\x02\x10\x00\x00\x00\x00\x00\x02@\x00\x00\x91\x83\x9e=\x91\x83\x9e=\x91\x83\x9e=\x00\x00\x00\x006\x00\x00\x05\x82 \x10\x00\x00\x00\x00\x00:\x00\x10\x00\x00\x00\x00\x007\x00\x00\tr \x10\x00\x00\x00\x00\x00F\x02\x10\x00\x02\x00\x00\x00F\x02\x10\x00\x01\x00\x00\x00F\x02\x10\x00\x00\x00\x00\x00>\x00\x00\x01STATt\x00\x00\x00\r\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
2272 }
2273 shader_copy_vert = driver.ShaderSources{
2274 Name: "copy.vert",
2275 GLSL100ES: `#version 100
2276
2277 void main()
2278 {
2279 for (int spvDummy6 = 0; spvDummy6 < 1; spvDummy6++)
2280 {
2281 if (gl_VertexID == 0)
2282 {
2283 gl_Position = vec4(-1.0, 1.0, 0.0, 1.0);
2284 break;
2285 }
2286 else if (gl_VertexID == 1)
2287 {
2288 gl_Position = vec4(1.0, 1.0, 0.0, 1.0);
2289 break;
2290 }
2291 else if (gl_VertexID == 2)
2292 {
2293 gl_Position = vec4(-1.0, -1.0, 0.0, 1.0);
2294 break;
2295 }
2296 else if (gl_VertexID == 3)
2297 {
2298 gl_Position = vec4(1.0, -1.0, 0.0, 1.0);
2299 break;
2300 }
2301 }
2302 }
2303
2304 `,
2305 GLSL300ES: `#version 300 es
2306
2307 void main()
2308 {
2309 switch (gl_VertexID)
2310 {
2311 case 0:
2312 {
2313 gl_Position = vec4(-1.0, 1.0, 0.0, 1.0);
2314 break;
2315 }
2316 case 1:
2317 {
2318 gl_Position = vec4(1.0, 1.0, 0.0, 1.0);
2319 break;
2320 }
2321 case 2:
2322 {
2323 gl_Position = vec4(-1.0, -1.0, 0.0, 1.0);
2324 break;
2325 }
2326 case 3:
2327 {
2328 gl_Position = vec4(1.0, -1.0, 0.0, 1.0);
2329 break;
2330 }
2331 }
2332 }
2333
2334 `,
2335 GLSL130: `#version 130
2336 #ifdef GL_ARB_shading_language_420pack
2337 #extension GL_ARB_shading_language_420pack : require
2338 #endif
2339
2340 void main()
2341 {
2342 switch (gl_VertexID)
2343 {
2344 case 0:
2345 {
2346 gl_Position = vec4(-1.0, 1.0, 0.0, 1.0);
2347 break;
2348 }
2349 case 1:
2350 {
2351 gl_Position = vec4(1.0, 1.0, 0.0, 1.0);
2352 break;
2353 }
2354 case 2:
2355 {
2356 gl_Position = vec4(-1.0, -1.0, 0.0, 1.0);
2357 break;
2358 }
2359 case 3:
2360 {
2361 gl_Position = vec4(1.0, -1.0, 0.0, 1.0);
2362 break;
2363 }
2364 }
2365 }
2366
2367 `,
2368 GLSL150: `#version 150
2369 #ifdef GL_ARB_shading_language_420pack
2370 #extension GL_ARB_shading_language_420pack : require
2371 #endif
2372
2373 void main()
2374 {
2375 switch (gl_VertexID)
2376 {
2377 case 0:
2378 {
2379 gl_Position = vec4(-1.0, 1.0, 0.0, 1.0);
2380 break;
2381 }
2382 case 1:
2383 {
2384 gl_Position = vec4(1.0, 1.0, 0.0, 1.0);
2385 break;
2386 }
2387 case 2:
2388 {
2389 gl_Position = vec4(-1.0, -1.0, 0.0, 1.0);
2390 break;
2391 }
2392 case 3:
2393 {
2394 gl_Position = vec4(1.0, -1.0, 0.0, 1.0);
2395 break;
2396 }
2397 }
2398 }
2399
2400 `,
2401 HLSL: "DXBC\x99\xb4[\xef]IX\xa2Qh\x9f\xb6!\x1cR\xe7\x01\x00\x00\x00\xc0\x02\x00\x00\x05\x00\x00\x004\x00\x00\x00\x80\x00\x00\x00\xb4\x00\x00\x00\xe8\x00\x00\x00D\x02\x00\x00RDEFD\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x00\x00\x00\x00\x04\xfe\xff\x00\x01\x00\x00\x1c\x00\x00\x00Microsoft (R) HLSL Shader Compiler 10.1\x00ISGN,\x00\x00\x00\x01\x00\x00\x00\b\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00SV_VertexID\x00OSGN,\x00\x00\x00\x01\x00\x00\x00\b\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00SV_Position\x00SHDRT\x01\x00\x00@\x00\x01\x00U\x00\x00\x00`\x00\x00\x04\x12\x10\x10\x00\x00\x00\x00\x00\x06\x00\x00\x00g\x00\x00\x04\xf2 \x10\x00\x00\x00\x00\x00\x01\x00\x00\x00h\x00\x00\x02\x01\x00\x00\x00L\x00\x00\x03\n\x10\x10\x00\x00\x00\x00\x00\x06\x00\x00\x03\x01@\x00\x00\x00\x00\x00\x006\x00\x00\br\x00\x10\x00\x00\x00\x00\x00\x02@\x00\x00\x00\x00\x80\xbf\x00\x00\x80?\x00\x00\x80?\x00\x00\x00\x00\x02\x00\x00\x01\x06\x00\x00\x03\x01@\x00\x00\x01\x00\x00\x006\x00\x00\br\x00\x10\x00\x00\x00\x00\x00\x02@\x00\x00\x00\x00\x80?\x00\x00\x80?\x00\x00\x80?\x00\x00\x00\x00\x02\x00\x00\x01\x06\x00\x00\x03\x01@\x00\x00\x02\x00\x00\x006\x00\x00\br\x00\x10\x00\x00\x00\x00\x00\x02@\x00\x00\x00\x00\x80\xbf\x00\x00\x80\xbf\x00\x00\x80?\x00\x00\x00\x00\x02\x00\x00\x01\x06\x00\x00\x03\x01@\x00\x00\x03\x00\x00\x006\x00\x00\br\x00\x10\x00\x00\x00\x00\x00\x02@\x00\x00\x00\x00\x80?\x00\x00\x80\xbf\x00\x00\x80?\x00\x00\x00\x00\x02\x00\x00\x01\n\x00\x00\x016\x00\x00\br\x00\x10\x00\x00\x00\x00\x00\x02@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x01\x17\x00\x00\x016\x00\x00\x05\xb2 \x10\x00\x00\x00\x00\x00F\b\x10\x00\x00\x00\x00\x006\x00\x00\x05B \x10\x00\x00\x00\x00\x00\x01@\x00\x00\x00\x00\x00\x00>\x00\x00\x01STATt\x00\x00\x00\x14\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
2402 }
2403 shader_cover_frag = [...]driver.ShaderSources{
2404 {
2405 Name: "cover.frag",
2406 Inputs: []driver.InputLocation{{Name: "vCoverUV", Location: 0, Semantic: "TEXCOORD", SemanticIndex: 0, Type: 0x0, Size: 2}, {Name: "vUV", Location: 1, Semantic: "TEXCOORD", SemanticIndex: 1, Type: 0x0, Size: 2}},
2407 Uniforms: driver.UniformsReflection{
2408 Blocks: []driver.UniformBlock{{Name: "Color", Binding: 0}},
2409 Locations: []driver.UniformLocation{{Name: "_color.color", Type: 0x0, Size: 4, Offset: 0}},
2410 Size: 16,
2411 },
2412 Textures: []driver.TextureBinding{{Name: "cover", Binding: 1}},
2413 GLSL100ES: `#version 100
2414 precision mediump float;
2415 precision highp int;
2416
2417 struct Color
2418 {
2419 vec4 color;
2420 };
2421
2422 uniform Color _color;
2423
2424 uniform mediump sampler2D cover;
2425
2426 varying highp vec2 vCoverUV;
2427 varying vec2 vUV;
2428
2429 void main()
2430 {
2431 gl_FragData[0] = _color.color;
2432 float cover_1 = min(abs(texture2D(cover, vCoverUV).x), 1.0);
2433 gl_FragData[0] *= cover_1;
2434 }
2435
2436 `,
2437 GLSL300ES: `#version 300 es
2438 precision mediump float;
2439 precision highp int;
2440
2441 layout(std140) uniform Color
2442 {
2443 vec4 color;
2444 } _color;
2445
2446 uniform mediump sampler2D cover;
2447
2448 layout(location = 0) out vec4 fragColor;
2449 in highp vec2 vCoverUV;
2450 in vec2 vUV;
2451
2452 void main()
2453 {
2454 fragColor = _color.color;
2455 float cover_1 = min(abs(texture(cover, vCoverUV).x), 1.0);
2456 fragColor *= cover_1;
2457 }
2458
2459 `,
2460 GLSL130: `#version 130
2461 #ifdef GL_ARB_shading_language_420pack
2462 #extension GL_ARB_shading_language_420pack : require
2463 #endif
2464
2465 struct Color
2466 {
2467 vec4 color;
2468 };
2469
2470 uniform Color _color;
2471
2472 layout(binding = 1) uniform sampler2D cover;
2473
2474 out vec4 fragColor;
2475 in vec2 vCoverUV;
2476 in vec2 vUV;
2477
2478 void main()
2479 {
2480 fragColor = _color.color;
2481 float cover_1 = min(abs(texture(cover, vCoverUV).x), 1.0);
2482 fragColor *= cover_1;
2483 }
2484
2485 `,
2486 GLSL150: `#version 150
2487 #ifdef GL_ARB_shading_language_420pack
2488 #extension GL_ARB_shading_language_420pack : require
2489 #endif
2490
2491 layout(binding = 0, std140) uniform Color
2492 {
2493 vec4 color;
2494 } _color;
2495
2496 layout(binding = 1) uniform sampler2D cover;
2497
2498 out vec4 fragColor;
2499 in vec2 vCoverUV;
2500 in vec2 vUV;
2501
2502 void main()
2503 {
2504 fragColor = _color.color;
2505 float cover_1 = min(abs(texture(cover, vCoverUV).x), 1.0);
2506 fragColor *= cover_1;
2507 }
2508
2509 `,
2510 HLSL: "DXBC\x88\x01{\x0f\x94\xca3\xeb\xab߸\xa1\xbfL1\xbf\x01\x00\x00\x00\xa4\x03\x00\x00\x06\x00\x00\x008\x00\x00\x00\xcc\x00\x00\x00\x90\x01\x00\x00\f\x02\x00\x00$\x03\x00\x00p\x03\x00\x00Aon9\x8c\x00\x00\x00\x8c\x00\x00\x00\x00\x02\xff\xffX\x00\x00\x004\x00\x00\x00\x01\x00(\x00\x00\x004\x00\x00\x004\x00\x01\x00$\x00\x00\x004\x00\x01\x01\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x02\xff\xff\x1f\x00\x00\x02\x00\x00\x00\x80\x00\x00\x0f\xb0\x1f\x00\x00\x02\x00\x00\x00\x90\x00\b\x0f\xa0B\x00\x00\x03\x00\x00\x0f\x80\x00\x00\xe4\xb0\x00\b\xe4\xa0#\x00\x00\x02\x00\x00\x11\x80\x00\x00\x00\x80\x05\x00\x00\x03\x00\x00\x0f\x80\x00\x00\x00\x80\x00\x00\xe4\xa0\x01\x00\x00\x02\x00\b\x0f\x80\x00\x00\xe4\x80\xff\xff\x00\x00SHDR\xbc\x00\x00\x00@\x00\x00\x00/\x00\x00\x00Y\x00\x00\x04F\x8e \x00\x00\x00\x00\x00\x01\x00\x00\x00Z\x00\x00\x03\x00`\x10\x00\x01\x00\x00\x00X\x18\x00\x04\x00p\x10\x00\x01\x00\x00\x00UU\x00\x00b\x10\x00\x032\x10\x10\x00\x00\x00\x00\x00e\x00\x00\x03\xf2 \x10\x00\x00\x00\x00\x00h\x00\x00\x02\x01\x00\x00\x00E\x00\x00\t\xf2\x00\x10\x00\x00\x00\x00\x00F\x10\x10\x00\x00\x00\x00\x00F~\x10\x00\x01\x00\x00\x00\x00`\x10\x00\x01\x00\x00\x003\x00\x00\b\x12\x00\x10\x00\x00\x00\x00\x00\n\x00\x10\x80\x81\x00\x00\x00\x00\x00\x00\x00\x01@\x00\x00\x00\x00\x80?8\x00\x00\b\xf2 \x10\x00\x00\x00\x00\x00\x06\x00\x10\x00\x00\x00\x00\x00F\x8e \x00\x00\x00\x00\x00\x00\x00\x00\x00>\x00\x00\x01STATt\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00RDEF\x10\x01\x00\x00\x01\x00\x00\x00\x98\x00\x00\x00\x03\x00\x00\x00\x1c\x00\x00\x00\x00\x04\xff\xff\x00\x01\x00\x00\xe8\x00\x00\x00|\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x8b\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x04\x00\x00\x00\xff\xff\xff\xff\x01\x00\x00\x00\x01\x00\x00\x00\r\x00\x00\x00\x91\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00_cover_sampler\x00cover\x00Color\x00\xab\x91\x00\x00\x00\x01\x00\x00\x00\xb0\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc8\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x02\x00\x00\x00\xd8\x00\x00\x00\x00\x00\x00\x00_color_color\x00\xab\xab\xab\x01\x00\x03\x00\x01\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00Microsoft (R) HLSL Shader Compiler 10.1\x00ISGND\x00\x00\x00\x02\x00\x00\x00\b\x00\x00\x008\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x03\x00\x008\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\f\x00\x00\x00TEXCOORD\x00\xab\xab\xabOSGN,\x00\x00\x00\x01\x00\x00\x00\b\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00SV_Target\x00\xab\xab",
2511 },
2512 {
2513 Name: "cover.frag",
2514 Inputs: []driver.InputLocation{{Name: "vCoverUV", Location: 0, Semantic: "TEXCOORD", SemanticIndex: 0, Type: 0x0, Size: 2}, {Name: "vUV", Location: 1, Semantic: "TEXCOORD", SemanticIndex: 1, Type: 0x0, Size: 2}},
2515 Uniforms: driver.UniformsReflection{
2516 Blocks: []driver.UniformBlock{{Name: "Gradient", Binding: 0}},
2517 Locations: []driver.UniformLocation{{Name: "_gradient.color1", Type: 0x0, Size: 4, Offset: 0}, {Name: "_gradient.color2", Type: 0x0, Size: 4, Offset: 16}},
2518 Size: 32,
2519 },
2520 Textures: []driver.TextureBinding{{Name: "cover", Binding: 1}},
2521 GLSL100ES: `#version 100
2522 precision mediump float;
2523 precision highp int;
2524
2525 struct Gradient
2526 {
2527 vec4 color1;
2528 vec4 color2;
2529 };
2530
2531 uniform Gradient _gradient;
2532
2533 uniform mediump sampler2D cover;
2534
2535 varying vec2 vUV;
2536 varying highp vec2 vCoverUV;
2537
2538 void main()
2539 {
2540 gl_FragData[0] = mix(_gradient.color1, _gradient.color2, vec4(clamp(vUV.x, 0.0, 1.0)));
2541 float cover_1 = min(abs(texture2D(cover, vCoverUV).x), 1.0);
2542 gl_FragData[0] *= cover_1;
2543 }
2544
2545 `,
2546 GLSL300ES: `#version 300 es
2547 precision mediump float;
2548 precision highp int;
2549
2550 layout(std140) uniform Gradient
2551 {
2552 vec4 color1;
2553 vec4 color2;
2554 } _gradient;
2555
2556 uniform mediump sampler2D cover;
2557
2558 layout(location = 0) out vec4 fragColor;
2559 in vec2 vUV;
2560 in highp vec2 vCoverUV;
2561
2562 void main()
2563 {
2564 fragColor = mix(_gradient.color1, _gradient.color2, vec4(clamp(vUV.x, 0.0, 1.0)));
2565 float cover_1 = min(abs(texture(cover, vCoverUV).x), 1.0);
2566 fragColor *= cover_1;
2567 }
2568
2569 `,
2570 GLSL130: `#version 130
2571 #ifdef GL_ARB_shading_language_420pack
2572 #extension GL_ARB_shading_language_420pack : require
2573 #endif
2574
2575 struct Gradient
2576 {
2577 vec4 color1;
2578 vec4 color2;
2579 };
2580
2581 uniform Gradient _gradient;
2582
2583 layout(binding = 1) uniform sampler2D cover;
2584
2585 out vec4 fragColor;
2586 in vec2 vUV;
2587 in vec2 vCoverUV;
2588
2589 void main()
2590 {
2591 fragColor = mix(_gradient.color1, _gradient.color2, vec4(clamp(vUV.x, 0.0, 1.0)));
2592 float cover_1 = min(abs(texture(cover, vCoverUV).x), 1.0);
2593 fragColor *= cover_1;
2594 }
2595
2596 `,
2597 GLSL150: `#version 150
2598 #ifdef GL_ARB_shading_language_420pack
2599 #extension GL_ARB_shading_language_420pack : require
2600 #endif
2601
2602 layout(binding = 0, std140) uniform Gradient
2603 {
2604 vec4 color1;
2605 vec4 color2;
2606 } _gradient;
2607
2608 layout(binding = 1) uniform sampler2D cover;
2609
2610 out vec4 fragColor;
2611 in vec2 vUV;
2612 in vec2 vCoverUV;
2613
2614 void main()
2615 {
2616 fragColor = mix(_gradient.color1, _gradient.color2, vec4(clamp(vUV.x, 0.0, 1.0)));
2617 float cover_1 = min(abs(texture(cover, vCoverUV).x), 1.0);
2618 fragColor *= cover_1;
2619 }
2620
2621 `,
2622 HLSL: "DXBCj\xa0\x9e\x8d\x1eÌO\rJ\xea\x8f\x17\x11o\x98\x01\x00\x00\x00\x80\x04\x00\x00\x06\x00\x00\x008\x00\x00\x00\b\x01\x00\x008\x02\x00\x00\xb4\x02\x00\x00\x00\x04\x00\x00L\x04\x00\x00Aon9\xc8\x00\x00\x00\xc8\x00\x00\x00\x00\x02\xff\xff\x94\x00\x00\x004\x00\x00\x00\x01\x00(\x00\x00\x004\x00\x00\x004\x00\x01\x00$\x00\x00\x004\x00\x01\x01\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x02\xff\xff\x1f\x00\x00\x02\x00\x00\x00\x80\x00\x00\x0f\xb0\x1f\x00\x00\x02\x00\x00\x00\x90\x00\b\x0f\xa0B\x00\x00\x03\x00\x00\x0f\x80\x00\x00\xe4\xb0\x00\b\xe4\xa0\x01\x00\x00\x02\x00\x00\x12\x80\x00\x00\xff\xb0\x01\x00\x00\x02\x01\x00\x0f\x80\x00\x00\xe4\xa0\x02\x00\x00\x03\x01\x00\x0f\x80\x01\x00\xe4\x81\x01\x00\xe4\xa0\x04\x00\x00\x04\x01\x00\x0f\x80\x00\x00U\x80\x01\x00\xe4\x80\x00\x00\xe4\xa0#\x00\x00\x02\x00\x00\x11\x80\x00\x00\x00\x80\x05\x00\x00\x03\x00\x00\x0f\x80\x00\x00\x00\x80\x01\x00\xe4\x80\x01\x00\x00\x02\x00\b\x0f\x80\x00\x00\xe4\x80\xff\xff\x00\x00SHDR(\x01\x00\x00@\x00\x00\x00J\x00\x00\x00Y\x00\x00\x04F\x8e \x00\x00\x00\x00\x00\x02\x00\x00\x00Z\x00\x00\x03\x00`\x10\x00\x01\x00\x00\x00X\x18\x00\x04\x00p\x10\x00\x01\x00\x00\x00UU\x00\x00b\x10\x00\x032\x10\x10\x00\x00\x00\x00\x00b\x10\x00\x03B\x10\x10\x00\x00\x00\x00\x00e\x00\x00\x03\xf2 \x10\x00\x00\x00\x00\x00h\x00\x00\x02\x02\x00\x00\x006 \x00\x05\x12\x00\x10\x00\x00\x00\x00\x00*\x10\x10\x00\x00\x00\x00\x00\x00\x00\x00\n\xf2\x00\x10\x00\x01\x00\x00\x00F\x8e \x80A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00F\x8e \x00\x00\x00\x00\x00\x01\x00\x00\x002\x00\x00\n\xf2\x00\x10\x00\x00\x00\x00\x00\x06\x00\x10\x00\x00\x00\x00\x00F\x0e\x10\x00\x01\x00\x00\x00F\x8e \x00\x00\x00\x00\x00\x00\x00\x00\x00E\x00\x00\t\xf2\x00\x10\x00\x01\x00\x00\x00F\x10\x10\x00\x00\x00\x00\x00F~\x10\x00\x01\x00\x00\x00\x00`\x10\x00\x01\x00\x00\x003\x00\x00\b\x12\x00\x10\x00\x01\x00\x00\x00\n\x00\x10\x80\x81\x00\x00\x00\x01\x00\x00\x00\x01@\x00\x00\x00\x00\x80?8\x00\x00\a\xf2 \x10\x00\x00\x00\x00\x00F\x0e\x10\x00\x00\x00\x00\x00\x06\x00\x10\x00\x01\x00\x00\x00>\x00\x00\x01STATt\x00\x00\x00\a\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00RDEFD\x01\x00\x00\x01\x00\x00\x00\x9c\x00\x00\x00\x03\x00\x00\x00\x1c\x00\x00\x00\x00\x04\xff\xff\x00\x01\x00\x00\x19\x01\x00\x00|\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x8b\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x04\x00\x00\x00\xff\xff\xff\xff\x01\x00\x00\x00\x01\x00\x00\x00\r\x00\x00\x00\x91\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00_cover_sampler\x00cover\x00Gradient\x00\xab\xab\x91\x00\x00\x00\x02\x00\x00\x00\xb4\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe4\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x02\x00\x00\x00\xf8\x00\x00\x00\x00\x00\x00\x00\b\x01\x00\x00\x10\x00\x00\x00\x10\x00\x00\x00\x02\x00\x00\x00\xf8\x00\x00\x00\x00\x00\x00\x00_gradient_color1\x00\xab\xab\xab\x01\x00\x03\x00\x01\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00_gradient_color2\x00Microsoft (R) HLSL Shader Compiler 10.1\x00\xab\xab\xabISGND\x00\x00\x00\x02\x00\x00\x00\b\x00\x00\x008\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x03\x00\x008\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\f\x04\x00\x00TEXCOORD\x00\xab\xab\xabOSGN,\x00\x00\x00\x01\x00\x00\x00\b\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00SV_Target\x00\xab\xab",
2623 },
2624 {
2625 Name: "cover.frag",
2626 Inputs: []driver.InputLocation{{Name: "vCoverUV", Location: 0, Semantic: "TEXCOORD", SemanticIndex: 0, Type: 0x0, Size: 2}, {Name: "vUV", Location: 1, Semantic: "TEXCOORD", SemanticIndex: 1, Type: 0x0, Size: 2}},
2627 Textures: []driver.TextureBinding{{Name: "tex", Binding: 0}, {Name: "cover", Binding: 1}},
2628 GLSL100ES: `#version 100
2629 precision mediump float;
2630 precision highp int;
2631
2632 uniform mediump sampler2D tex;
2633 uniform mediump sampler2D cover;
2634
2635 varying vec2 vUV;
2636 varying highp vec2 vCoverUV;
2637
2638 void main()
2639 {
2640 gl_FragData[0] = texture2D(tex, vUV);
2641 float cover_1 = min(abs(texture2D(cover, vCoverUV).x), 1.0);
2642 gl_FragData[0] *= cover_1;
2643 }
2644
2645 `,
2646 GLSL300ES: `#version 300 es
2647 precision mediump float;
2648 precision highp int;
2649
2650 uniform mediump sampler2D tex;
2651 uniform mediump sampler2D cover;
2652
2653 layout(location = 0) out vec4 fragColor;
2654 in vec2 vUV;
2655 in highp vec2 vCoverUV;
2656
2657 void main()
2658 {
2659 fragColor = texture(tex, vUV);
2660 float cover_1 = min(abs(texture(cover, vCoverUV).x), 1.0);
2661 fragColor *= cover_1;
2662 }
2663
2664 `,
2665 GLSL130: `#version 130
2666 #ifdef GL_ARB_shading_language_420pack
2667 #extension GL_ARB_shading_language_420pack : require
2668 #endif
2669
2670 layout(binding = 0) uniform sampler2D tex;
2671 layout(binding = 1) uniform sampler2D cover;
2672
2673 out vec4 fragColor;
2674 in vec2 vUV;
2675 in vec2 vCoverUV;
2676
2677 void main()
2678 {
2679 fragColor = texture(tex, vUV);
2680 float cover_1 = min(abs(texture(cover, vCoverUV).x), 1.0);
2681 fragColor *= cover_1;
2682 }
2683
2684 `,
2685 GLSL150: `#version 150
2686 #ifdef GL_ARB_shading_language_420pack
2687 #extension GL_ARB_shading_language_420pack : require
2688 #endif
2689
2690 layout(binding = 0) uniform sampler2D tex;
2691 layout(binding = 1) uniform sampler2D cover;
2692
2693 out vec4 fragColor;
2694 in vec2 vUV;
2695 in vec2 vCoverUV;
2696
2697 void main()
2698 {
2699 fragColor = texture(tex, vUV);
2700 float cover_1 = min(abs(texture(cover, vCoverUV).x), 1.0);
2701 fragColor *= cover_1;
2702 }
2703
2704 `,
2705 HLSL: "DXBC\x99\x16l`\xf6:k\xa2Y$\xa1,\xfd\xcdJE\x01\x00\x00\x00\xd8\x03\x00\x00\x06\x00\x00\x008\x00\x00\x00\xec\x00\x00\x00\xe8\x01\x00\x00d\x02\x00\x00X\x03\x00\x00\xa4\x03\x00\x00Aon9\xac\x00\x00\x00\xac\x00\x00\x00\x00\x02\xff\xff\x80\x00\x00\x00,\x00\x00\x00\x00\x00,\x00\x00\x00,\x00\x00\x00,\x00\x02\x00$\x00\x00\x00,\x00\x00\x00\x00\x00\x01\x01\x01\x00\x00\x02\xff\xff\x1f\x00\x00\x02\x00\x00\x00\x80\x00\x00\x0f\xb0\x1f\x00\x00\x02\x00\x00\x00\x90\x00\b\x0f\xa0\x1f\x00\x00\x02\x00\x00\x00\x90\x01\b\x0f\xa0\x01\x00\x00\x02\x00\x00\x03\x80\x00\x00\x1b\xb0B\x00\x00\x03\x00\x00\x0f\x80\x00\x00\xe4\x80\x00\b\xe4\xa0B\x00\x00\x03\x01\x00\x0f\x80\x00\x00\xe4\xb0\x01\b\xe4\xa0#\x00\x00\x02\x01\x00\x11\x80\x01\x00\x00\x80\x05\x00\x00\x03\x00\x00\x0f\x80\x00\x00\xe4\x80\x01\x00\x00\x80\x01\x00\x00\x02\x00\b\x0f\x80\x00\x00\xe4\x80\xff\xff\x00\x00SHDR\xf4\x00\x00\x00@\x00\x00\x00=\x00\x00\x00Z\x00\x00\x03\x00`\x10\x00\x00\x00\x00\x00Z\x00\x00\x03\x00`\x10\x00\x01\x00\x00\x00X\x18\x00\x04\x00p\x10\x00\x00\x00\x00\x00UU\x00\x00X\x18\x00\x04\x00p\x10\x00\x01\x00\x00\x00UU\x00\x00b\x10\x00\x032\x10\x10\x00\x00\x00\x00\x00b\x10\x00\x03\xc2\x10\x10\x00\x00\x00\x00\x00e\x00\x00\x03\xf2 \x10\x00\x00\x00\x00\x00h\x00\x00\x02\x02\x00\x00\x00E\x00\x00\t\xf2\x00\x10\x00\x00\x00\x00\x00F\x10\x10\x00\x00\x00\x00\x00F~\x10\x00\x01\x00\x00\x00\x00`\x10\x00\x01\x00\x00\x003\x00\x00\b\x12\x00\x10\x00\x00\x00\x00\x00\n\x00\x10\x80\x81\x00\x00\x00\x00\x00\x00\x00\x01@\x00\x00\x00\x00\x80?E\x00\x00\t\xf2\x00\x10\x00\x01\x00\x00\x00\xe6\x1a\x10\x00\x00\x00\x00\x00F~\x10\x00\x00\x00\x00\x00\x00`\x10\x00\x00\x00\x00\x008\x00\x00\a\xf2 \x10\x00\x00\x00\x00\x00\x06\x00\x10\x00\x00\x00\x00\x00F\x0e\x10\x00\x01\x00\x00\x00>\x00\x00\x01STATt\x00\x00\x00\x05\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00RDEF\xec\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x1c\x00\x00\x00\x00\x04\xff\xff\x00\x01\x00\x00\xc2\x00\x00\x00\x9c\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\xa9\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\xb8\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x04\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x01\x00\x00\x00\r\x00\x00\x00\xbc\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x04\x00\x00\x00\xff\xff\xff\xff\x01\x00\x00\x00\x01\x00\x00\x00\r\x00\x00\x00_tex_sampler\x00_cover_sampler\x00tex\x00cover\x00Microsoft (R) HLSL Shader Compiler 10.1\x00\xab\xabISGND\x00\x00\x00\x02\x00\x00\x00\b\x00\x00\x008\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x03\x00\x008\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\f\f\x00\x00TEXCOORD\x00\xab\xab\xabOSGN,\x00\x00\x00\x01\x00\x00\x00\b\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00SV_Target\x00\xab\xab",
2706 },
2707 }
2708 shader_cover_vert = driver.ShaderSources{
2709 Name: "cover.vert",
2710 Inputs: []driver.InputLocation{{Name: "pos", Location: 0, Semantic: "TEXCOORD", SemanticIndex: 0, Type: 0x0, Size: 2}, {Name: "uv", Location: 1, Semantic: "TEXCOORD", SemanticIndex: 1, Type: 0x0, Size: 2}},
2711 Uniforms: driver.UniformsReflection{
2712 Blocks: []driver.UniformBlock{{Name: "Block", Binding: 0}},
2713 Locations: []driver.UniformLocation{{Name: "_block.transform", Type: 0x0, Size: 4, Offset: 0}, {Name: "_block.uvCoverTransform", Type: 0x0, Size: 4, Offset: 16}, {Name: "_block.uvTransformR1", Type: 0x0, Size: 4, Offset: 32}, {Name: "_block.uvTransformR2", Type: 0x0, Size: 4, Offset: 48}, {Name: "_block.z", Type: 0x0, Size: 1, Offset: 64}},
2714 Size: 68,
2715 },
2716 GLSL100ES: `#version 100
2717
2718 struct m3x2
2719 {
2720 vec3 r0;
2721 vec3 r1;
2722 };
2723
2724 struct Block
2725 {
2726 vec4 transform;
2727 vec4 uvCoverTransform;
2728 vec4 uvTransformR1;
2729 vec4 uvTransformR2;
2730 float z;
2731 };
2732
2733 uniform Block _block;
2734
2735 attribute vec2 pos;
2736 varying vec2 vUV;
2737 attribute vec2 uv;
2738 varying vec2 vCoverUV;
2739
2740 vec4 toClipSpace(vec4 pos_1)
2741 {
2742 return pos_1;
2743 }
2744
2745 vec3 transform3x2(m3x2 t, vec3 v)
2746 {
2747 return vec3(dot(t.r0, v), dot(t.r1, v), dot(vec3(0.0, 0.0, 1.0), v));
2748 }
2749
2750 void main()
2751 {
2752 vec4 param = vec4((pos * _block.transform.xy) + _block.transform.zw, _block.z, 1.0);
2753 gl_Position = toClipSpace(param);
2754 m3x2 param_1 = m3x2(_block.uvTransformR1.xyz, _block.uvTransformR2.xyz);
2755 vec3 param_2 = vec3(uv, 1.0);
2756 vUV = transform3x2(param_1, param_2).xy;
2757 m3x2 param_3 = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0));
2758 vec3 param_4 = vec3(uv, 1.0);
2759 vec3 uv3 = transform3x2(param_3, param_4);
2760 vCoverUV = ((uv3 * vec3(_block.uvCoverTransform.xy, 1.0)) + vec3(_block.uvCoverTransform.zw, 0.0)).xy;
2761 }
2762
2763 `,
2764 GLSL300ES: `#version 300 es
2765
2766 struct m3x2
2767 {
2768 vec3 r0;
2769 vec3 r1;
2770 };
2771
2772 layout(std140) uniform Block
2773 {
2774 vec4 transform;
2775 vec4 uvCoverTransform;
2776 vec4 uvTransformR1;
2777 vec4 uvTransformR2;
2778 float z;
2779 } _block;
2780
2781 layout(location = 0) in vec2 pos;
2782 out vec2 vUV;
2783 layout(location = 1) in vec2 uv;
2784 out vec2 vCoverUV;
2785
2786 vec4 toClipSpace(vec4 pos_1)
2787 {
2788 return pos_1;
2789 }
2790
2791 vec3 transform3x2(m3x2 t, vec3 v)
2792 {
2793 return vec3(dot(t.r0, v), dot(t.r1, v), dot(vec3(0.0, 0.0, 1.0), v));
2794 }
2795
2796 void main()
2797 {
2798 vec4 param = vec4((pos * _block.transform.xy) + _block.transform.zw, _block.z, 1.0);
2799 gl_Position = toClipSpace(param);
2800 m3x2 param_1 = m3x2(_block.uvTransformR1.xyz, _block.uvTransformR2.xyz);
2801 vec3 param_2 = vec3(uv, 1.0);
2802 vUV = transform3x2(param_1, param_2).xy;
2803 m3x2 param_3 = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0));
2804 vec3 param_4 = vec3(uv, 1.0);
2805 vec3 uv3 = transform3x2(param_3, param_4);
2806 vCoverUV = ((uv3 * vec3(_block.uvCoverTransform.xy, 1.0)) + vec3(_block.uvCoverTransform.zw, 0.0)).xy;
2807 }
2808
2809 `,
2810 GLSL130: `#version 130
2811 #ifdef GL_ARB_shading_language_420pack
2812 #extension GL_ARB_shading_language_420pack : require
2813 #endif
2814
2815 struct m3x2
2816 {
2817 vec3 r0;
2818 vec3 r1;
2819 };
2820
2821 struct Block
2822 {
2823 vec4 transform;
2824 vec4 uvCoverTransform;
2825 vec4 uvTransformR1;
2826 vec4 uvTransformR2;
2827 float z;
2828 };
2829
2830 uniform Block _block;
2831
2832 in vec2 pos;
2833 out vec2 vUV;
2834 in vec2 uv;
2835 out vec2 vCoverUV;
2836
2837 vec4 toClipSpace(vec4 pos_1)
2838 {
2839 return pos_1;
2840 }
2841
2842 vec3 transform3x2(m3x2 t, vec3 v)
2843 {
2844 return vec3(dot(t.r0, v), dot(t.r1, v), dot(vec3(0.0, 0.0, 1.0), v));
2845 }
2846
2847 void main()
2848 {
2849 vec4 param = vec4((pos * _block.transform.xy) + _block.transform.zw, _block.z, 1.0);
2850 gl_Position = toClipSpace(param);
2851 m3x2 param_1 = m3x2(_block.uvTransformR1.xyz, _block.uvTransformR2.xyz);
2852 vec3 param_2 = vec3(uv, 1.0);
2853 vUV = transform3x2(param_1, param_2).xy;
2854 m3x2 param_3 = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0));
2855 vec3 param_4 = vec3(uv, 1.0);
2856 vec3 uv3 = transform3x2(param_3, param_4);
2857 vCoverUV = ((uv3 * vec3(_block.uvCoverTransform.xy, 1.0)) + vec3(_block.uvCoverTransform.zw, 0.0)).xy;
2858 }
2859
2860 `,
2861 GLSL150: `#version 150
2862 #ifdef GL_ARB_shading_language_420pack
2863 #extension GL_ARB_shading_language_420pack : require
2864 #endif
2865
2866 struct m3x2
2867 {
2868 vec3 r0;
2869 vec3 r1;
2870 };
2871
2872 layout(binding = 0, std140) uniform Block
2873 {
2874 vec4 transform;
2875 vec4 uvCoverTransform;
2876 vec4 uvTransformR1;
2877 vec4 uvTransformR2;
2878 float z;
2879 } _block;
2880
2881 in vec2 pos;
2882 out vec2 vUV;
2883 in vec2 uv;
2884 out vec2 vCoverUV;
2885
2886 vec4 toClipSpace(vec4 pos_1)
2887 {
2888 return pos_1;
2889 }
2890
2891 vec3 transform3x2(m3x2 t, vec3 v)
2892 {
2893 return vec3(dot(t.r0, v), dot(t.r1, v), dot(vec3(0.0, 0.0, 1.0), v));
2894 }
2895
2896 void main()
2897 {
2898 vec4 param = vec4((pos * _block.transform.xy) + _block.transform.zw, _block.z, 1.0);
2899 gl_Position = toClipSpace(param);
2900 m3x2 param_1 = m3x2(_block.uvTransformR1.xyz, _block.uvTransformR2.xyz);
2901 vec3 param_2 = vec3(uv, 1.0);
2902 vUV = transform3x2(param_1, param_2).xy;
2903 m3x2 param_3 = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0));
2904 vec3 param_4 = vec3(uv, 1.0);
2905 vec3 uv3 = transform3x2(param_3, param_4);
2906 vCoverUV = ((uv3 * vec3(_block.uvCoverTransform.xy, 1.0)) + vec3(_block.uvCoverTransform.zw, 0.0)).xy;
2907 }
2908
2909 `,
2910 HLSL: "DXBCx\xefn{F\v\x88%\xc6\x05\x8f4h\xe4\xaaP\x01\x00\x00\x00\xd8\x05\x00\x00\x06\x00\x00\x008\x00\x00\x00x\x01\x00\x00\x1c\x03\x00\x00\x98\x03\x00\x00\x1c\x05\x00\x00h\x05\x00\x00Aon98\x01\x00\x008\x01\x00\x00\x00\x02\xfe\xff\x04\x01\x00\x004\x00\x00\x00\x01\x00$\x00\x00\x000\x00\x00\x000\x00\x00\x00$\x00\x01\x000\x00\x00\x00\x00\x00\x05\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xfe\xffQ\x00\x00\x05\x06\x00\x0f\xa0\x00\x00\x80?\x00\x00\x00\x00\x00\x00\x80\xbf\x00\x00\x00?\x1f\x00\x00\x02\x05\x00\x00\x80\x00\x00\x0f\x90\x1f\x00\x00\x02\x05\x00\x01\x80\x01\x00\x0f\x90\x04\x00\x00\x04\x00\x00\a\x80\x01\x00Đ\x06\x00Р\x06\x00Š\b\x00\x00\x03\x00\x00\b\xe0\x03\x00\xe4\xa0\x00\x00\xe4\x80\b\x00\x00\x03\x00\x00\x04\xe0\x04\x00\xe4\xa0\x00\x00\xe4\x80\x04\x00\x00\x04\x00\x00\x03\x80\x01\x00\xe1\x90\x06\x00\xe4\xa0\x06\x00\xe1\xa0\x05\x00\x00\x03\x00\x00\x03\x80\x00\x00\xe4\x80\x06\x00\xe2\xa0\x02\x00\x00\x03\x00\x00\x02\x80\x00\x00U\x80\x00\x00\x00\x80\x01\x00\x00\x02\x00\x00\x01\x80\x01\x00\x00\x90\x04\x00\x00\x04\x00\x00\x03\xe0\x00\x00\xe4\x80\x02\x00\xe4\xa0\x02\x00\xee\xa0\x04\x00\x00\x04\x00\x00\x03\x80\x00\x00\xe4\x90\x01\x00\xe4\xa0\x01\x00\xee\xa0\x02\x00\x00\x03\x00\x00\x03\xc0\x00\x00\xe4\x80\x00\x00\xe4\xa0\x01\x00\x00\x02\x00\x00\v\x80\x06\x00\xe4\xa0\x04\x00\x00\x04\x00\x00\f\xc0\x05\x00\x00\xa0\x00\x00t\x80\x00\x004\x80\xff\xff\x00\x00SHDR\x9c\x01\x00\x00@\x00\x01\x00g\x00\x00\x00Y\x00\x00\x04F\x8e \x00\x00\x00\x00\x00\x05\x00\x00\x00_\x00\x00\x032\x10\x10\x00\x00\x00\x00\x00_\x00\x00\x032\x10\x10\x00\x01\x00\x00\x00e\x00\x00\x032 \x10\x00\x00\x00\x00\x00e\x00\x00\x03\xc2 \x10\x00\x00\x00\x00\x00g\x00\x00\x04\xf2 \x10\x00\x01\x00\x00\x00\x01\x00\x00\x00h\x00\x00\x02\x02\x00\x00\x006\x00\x00\x05\x12\x00\x10\x00\x00\x00\x00\x00\n\x10\x10\x00\x01\x00\x00\x006\x00\x00\x052\x00\x10\x00\x01\x00\x00\x00F\x10\x10\x00\x01\x00\x00\x006\x00\x00\x05B\x00\x10\x00\x01\x00\x00\x00\x01@\x00\x00\x00\x00\x80?\x0f\x00\x00\n\"\x00\x10\x00\x00\x00\x00\x00\x02@\x00\x00\x00\x00\x80\xbf\x00\x00\x80?\x00\x00\x00\x00\x00\x00\x00\x00\x96\x05\x10\x00\x01\x00\x00\x002\x00\x00\v2 \x10\x00\x00\x00\x00\x00F\x00\x10\x00\x00\x00\x00\x00F\x80 \x00\x00\x00\x00\x00\x01\x00\x00\x00\xe6\x8a \x00\x00\x00\x00\x00\x01\x00\x00\x00\x10\x00\x00\bB \x10\x00\x00\x00\x00\x00F\x82 \x00\x00\x00\x00\x00\x02\x00\x00\x00F\x02\x10\x00\x01\x00\x00\x00\x10\x00\x00\b\x82 \x10\x00\x00\x00\x00\x00F\x82 \x00\x00\x00\x00\x00\x03\x00\x00\x00F\x02\x10\x00\x01\x00\x00\x002\x00\x00\v2 \x10\x00\x01\x00\x00\x00F\x10\x10\x00\x00\x00\x00\x00F\x80 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xe6\x8a \x00\x00\x00\x00\x00\x00\x00\x00\x002\x00\x00\nB \x10\x00\x01\x00\x00\x00\n\x80 \x00\x00\x00\x00\x00\x04\x00\x00\x00\x01@\x00\x00\x00\x00\x00?\x01@\x00\x00\x00\x00\x00?6\x00\x00\x05\x82 \x10\x00\x01\x00\x00\x00\x01@\x00\x00\x00\x00\x80?>\x00\x00\x01STATt\x00\x00\x00\v\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00RDEF|\x01\x00\x00\x01\x00\x00\x00D\x00\x00\x00\x01\x00\x00\x00\x1c\x00\x00\x00\x00\x04\xfe\xff\x00\x01\x00\x00T\x01\x00\x00<\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00Block\x00\xab\xab<\x00\x00\x00\x05\x00\x00\x00\\\x00\x00\x00P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd4\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x02\x00\x00\x00\xe8\x00\x00\x00\x00\x00\x00\x00\xf8\x00\x00\x00\x10\x00\x00\x00\x10\x00\x00\x00\x02\x00\x00\x00\xe8\x00\x00\x00\x00\x00\x00\x00\x10\x01\x00\x00 \x00\x00\x00\x10\x00\x00\x00\x02\x00\x00\x00\xe8\x00\x00\x00\x00\x00\x00\x00%\x01\x00\x000\x00\x00\x00\x10\x00\x00\x00\x02\x00\x00\x00\xe8\x00\x00\x00\x00\x00\x00\x00:\x01\x00\x00@\x00\x00\x00\x04\x00\x00\x00\x02\x00\x00\x00D\x01\x00\x00\x00\x00\x00\x00_block_transform\x00\xab\xab\xab\x01\x00\x03\x00\x01\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00_block_uvCoverTransform\x00_block_uvTransformR1\x00_block_uvTransformR2\x00_block_z\x00\xab\x00\x00\x03\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00Microsoft (R) HLSL Shader Compiler 10.1\x00ISGND\x00\x00\x00\x02\x00\x00\x00\b\x00\x00\x008\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x03\x00\x008\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x03\x03\x00\x00TEXCOORD\x00\xab\xab\xabOSGNh\x00\x00\x00\x03\x00\x00\x00\b\x00\x00\x00P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\f\x00\x00P\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\f\x03\x00\x00Y\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x0f\x00\x00\x00TEXCOORD\x00SV_Position\x00\xab\xab\xab",
2911 }
2912 shader_elements_comp = driver.ShaderSources{
2913 Name: "elements.comp",
2914 GLSL310ES: `#version 310 es
2915 layout(local_size_x = 32, local_size_y = 1, local_size_z = 1) in;
2916
2917 struct Alloc
2918 {
2919 uint offset;
2920 };
2921
2922 struct ElementRef
2923 {
2924 uint offset;
2925 };
2926
2927 struct LineSegRef
2928 {
2929 uint offset;
2930 };
2931
2932 struct LineSeg
2933 {
2934 vec2 p0;
2935 vec2 p1;
2936 };
2937
2938 struct QuadSegRef
2939 {
2940 uint offset;
2941 };
2942
2943 struct QuadSeg
2944 {
2945 vec2 p0;
2946 vec2 p1;
2947 vec2 p2;
2948 };
2949
2950 struct CubicSegRef
2951 {
2952 uint offset;
2953 };
2954
2955 struct CubicSeg
2956 {
2957 vec2 p0;
2958 vec2 p1;
2959 vec2 p2;
2960 vec2 p3;
2961 };
2962
2963 struct FillColorRef
2964 {
2965 uint offset;
2966 };
2967
2968 struct FillColor
2969 {
2970 uint rgba_color;
2971 };
2972
2973 struct FillImageRef
2974 {
2975 uint offset;
2976 };
2977
2978 struct FillImage
2979 {
2980 uint index;
2981 ivec2 offset;
2982 };
2983
2984 struct SetLineWidthRef
2985 {
2986 uint offset;
2987 };
2988
2989 struct SetLineWidth
2990 {
2991 float width;
2992 };
2993
2994 struct TransformRef
2995 {
2996 uint offset;
2997 };
2998
2999 struct Transform
3000 {
3001 vec4 mat;
3002 vec2 translate;
3003 };
3004
3005 struct ClipRef
3006 {
3007 uint offset;
3008 };
3009
3010 struct Clip
3011 {
3012 vec4 bbox;
3013 };
3014
3015 struct SetFillModeRef
3016 {
3017 uint offset;
3018 };
3019
3020 struct SetFillMode
3021 {
3022 uint fill_mode;
3023 };
3024
3025 struct ElementTag
3026 {
3027 uint tag;
3028 uint flags;
3029 };
3030
3031 struct StateRef
3032 {
3033 uint offset;
3034 };
3035
3036 struct State
3037 {
3038 vec4 mat;
3039 vec2 translate;
3040 vec4 bbox;
3041 float linewidth;
3042 uint flags;
3043 uint path_count;
3044 uint pathseg_count;
3045 uint trans_count;
3046 };
3047
3048 struct AnnoImageRef
3049 {
3050 uint offset;
3051 };
3052
3053 struct AnnoImage
3054 {
3055 vec4 bbox;
3056 float linewidth;
3057 uint index;
3058 ivec2 offset;
3059 };
3060
3061 struct AnnoColorRef
3062 {
3063 uint offset;
3064 };
3065
3066 struct AnnoColor
3067 {
3068 vec4 bbox;
3069 float linewidth;
3070 uint rgba_color;
3071 };
3072
3073 struct AnnoBeginClipRef
3074 {
3075 uint offset;
3076 };
3077
3078 struct AnnoBeginClip
3079 {
3080 vec4 bbox;
3081 float linewidth;
3082 };
3083
3084 struct AnnoEndClipRef
3085 {
3086 uint offset;
3087 };
3088
3089 struct AnnoEndClip
3090 {
3091 vec4 bbox;
3092 };
3093
3094 struct AnnotatedRef
3095 {
3096 uint offset;
3097 };
3098
3099 struct PathCubicRef
3100 {
3101 uint offset;
3102 };
3103
3104 struct PathCubic
3105 {
3106 vec2 p0;
3107 vec2 p1;
3108 vec2 p2;
3109 vec2 p3;
3110 uint path_ix;
3111 uint trans_ix;
3112 vec2 stroke;
3113 };
3114
3115 struct PathSegRef
3116 {
3117 uint offset;
3118 };
3119
3120 struct TransformSegRef
3121 {
3122 uint offset;
3123 };
3124
3125 struct TransformSeg
3126 {
3127 vec4 mat;
3128 vec2 translate;
3129 };
3130
3131 struct Config
3132 {
3133 uint n_elements;
3134 uint n_pathseg;
3135 uint width_in_tiles;
3136 uint height_in_tiles;
3137 Alloc tile_alloc;
3138 Alloc bin_alloc;
3139 Alloc ptcl_alloc;
3140 Alloc pathseg_alloc;
3141 Alloc anno_alloc;
3142 Alloc trans_alloc;
3143 };
3144
3145 layout(binding = 0, std430) buffer Memory
3146 {
3147 uint mem_offset;
3148 uint mem_error;
3149 uint memory[];
3150 } _294;
3151
3152 layout(binding = 2, std430) readonly buffer SceneBuf
3153 {
3154 uint scene[];
3155 } _323;
3156
3157 layout(binding = 3, std430) coherent buffer StateBuf
3158 {
3159 uint part_counter;
3160 uint state[];
3161 } _779;
3162
3163 layout(binding = 1, std430) readonly buffer ConfigBuf
3164 {
3165 Config conf;
3166 } _2435;
3167
3168 shared uint sh_part_ix;
3169 shared State sh_state[32];
3170 shared State sh_prefix;
3171
3172 ElementTag Element_tag(ElementRef ref)
3173 {
3174 uint tag_and_flags = _323.scene[ref.offset >> uint(2)];
3175 return ElementTag(tag_and_flags & 65535u, tag_and_flags >> uint(16));
3176 }
3177
3178 LineSeg LineSeg_read(LineSegRef ref)
3179 {
3180 uint ix = ref.offset >> uint(2);
3181 uint raw0 = _323.scene[ix + 0u];
3182 uint raw1 = _323.scene[ix + 1u];
3183 uint raw2 = _323.scene[ix + 2u];
3184 uint raw3 = _323.scene[ix + 3u];
3185 LineSeg s;
3186 s.p0 = vec2(uintBitsToFloat(raw0), uintBitsToFloat(raw1));
3187 s.p1 = vec2(uintBitsToFloat(raw2), uintBitsToFloat(raw3));
3188 return s;
3189 }
3190
3191 LineSeg Element_Line_read(ElementRef ref)
3192 {
3193 LineSegRef param = LineSegRef(ref.offset + 4u);
3194 return LineSeg_read(param);
3195 }
3196
3197 QuadSeg QuadSeg_read(QuadSegRef ref)
3198 {
3199 uint ix = ref.offset >> uint(2);
3200 uint raw0 = _323.scene[ix + 0u];
3201 uint raw1 = _323.scene[ix + 1u];
3202 uint raw2 = _323.scene[ix + 2u];
3203 uint raw3 = _323.scene[ix + 3u];
3204 uint raw4 = _323.scene[ix + 4u];
3205 uint raw5 = _323.scene[ix + 5u];
3206 QuadSeg s;
3207 s.p0 = vec2(uintBitsToFloat(raw0), uintBitsToFloat(raw1));
3208 s.p1 = vec2(uintBitsToFloat(raw2), uintBitsToFloat(raw3));
3209 s.p2 = vec2(uintBitsToFloat(raw4), uintBitsToFloat(raw5));
3210 return s;
3211 }
3212
3213 QuadSeg Element_Quad_read(ElementRef ref)
3214 {
3215 QuadSegRef param = QuadSegRef(ref.offset + 4u);
3216 return QuadSeg_read(param);
3217 }
3218
3219 CubicSeg CubicSeg_read(CubicSegRef ref)
3220 {
3221 uint ix = ref.offset >> uint(2);
3222 uint raw0 = _323.scene[ix + 0u];
3223 uint raw1 = _323.scene[ix + 1u];
3224 uint raw2 = _323.scene[ix + 2u];
3225 uint raw3 = _323.scene[ix + 3u];
3226 uint raw4 = _323.scene[ix + 4u];
3227 uint raw5 = _323.scene[ix + 5u];
3228 uint raw6 = _323.scene[ix + 6u];
3229 uint raw7 = _323.scene[ix + 7u];
3230 CubicSeg s;
3231 s.p0 = vec2(uintBitsToFloat(raw0), uintBitsToFloat(raw1));
3232 s.p1 = vec2(uintBitsToFloat(raw2), uintBitsToFloat(raw3));
3233 s.p2 = vec2(uintBitsToFloat(raw4), uintBitsToFloat(raw5));
3234 s.p3 = vec2(uintBitsToFloat(raw6), uintBitsToFloat(raw7));
3235 return s;
3236 }
3237
3238 CubicSeg Element_Cubic_read(ElementRef ref)
3239 {
3240 CubicSegRef param = CubicSegRef(ref.offset + 4u);
3241 return CubicSeg_read(param);
3242 }
3243
3244 SetLineWidth SetLineWidth_read(SetLineWidthRef ref)
3245 {
3246 uint ix = ref.offset >> uint(2);
3247 uint raw0 = _323.scene[ix + 0u];
3248 SetLineWidth s;
3249 s.width = uintBitsToFloat(raw0);
3250 return s;
3251 }
3252
3253 SetLineWidth Element_SetLineWidth_read(ElementRef ref)
3254 {
3255 SetLineWidthRef param = SetLineWidthRef(ref.offset + 4u);
3256 return SetLineWidth_read(param);
3257 }
3258
3259 Transform Transform_read(TransformRef ref)
3260 {
3261 uint ix = ref.offset >> uint(2);
3262 uint raw0 = _323.scene[ix + 0u];
3263 uint raw1 = _323.scene[ix + 1u];
3264 uint raw2 = _323.scene[ix + 2u];
3265 uint raw3 = _323.scene[ix + 3u];
3266 uint raw4 = _323.scene[ix + 4u];
3267 uint raw5 = _323.scene[ix + 5u];
3268 Transform s;
3269 s.mat = vec4(uintBitsToFloat(raw0), uintBitsToFloat(raw1), uintBitsToFloat(raw2), uintBitsToFloat(raw3));
3270 s.translate = vec2(uintBitsToFloat(raw4), uintBitsToFloat(raw5));
3271 return s;
3272 }
3273
3274 Transform Element_Transform_read(ElementRef ref)
3275 {
3276 TransformRef param = TransformRef(ref.offset + 4u);
3277 return Transform_read(param);
3278 }
3279
3280 SetFillMode SetFillMode_read(SetFillModeRef ref)
3281 {
3282 uint ix = ref.offset >> uint(2);
3283 uint raw0 = _323.scene[ix + 0u];
3284 SetFillMode s;
3285 s.fill_mode = raw0;
3286 return s;
3287 }
3288
3289 SetFillMode Element_SetFillMode_read(ElementRef ref)
3290 {
3291 SetFillModeRef param = SetFillModeRef(ref.offset + 4u);
3292 return SetFillMode_read(param);
3293 }
3294
3295 State map_element(ElementRef ref)
3296 {
3297 ElementRef param = ref;
3298 uint tag = Element_tag(param).tag;
3299 State c;
3300 c.bbox = vec4(0.0);
3301 c.mat = vec4(1.0, 0.0, 0.0, 1.0);
3302 c.translate = vec2(0.0);
3303 c.linewidth = 1.0;
3304 c.flags = 0u;
3305 c.path_count = 0u;
3306 c.pathseg_count = 0u;
3307 c.trans_count = 0u;
3308 switch (tag)
3309 {
3310 case 1u:
3311 {
3312 ElementRef param_1 = ref;
3313 LineSeg line = Element_Line_read(param_1);
3314 vec2 _1919 = min(line.p0, line.p1);
3315 c.bbox = vec4(_1919.x, _1919.y, c.bbox.z, c.bbox.w);
3316 vec2 _1927 = max(line.p0, line.p1);
3317 c.bbox = vec4(c.bbox.x, c.bbox.y, _1927.x, _1927.y);
3318 c.pathseg_count = 1u;
3319 break;
3320 }
3321 case 2u:
3322 {
3323 ElementRef param_2 = ref;
3324 QuadSeg quad = Element_Quad_read(param_2);
3325 vec2 _1944 = min(min(quad.p0, quad.p1), quad.p2);
3326 c.bbox = vec4(_1944.x, _1944.y, c.bbox.z, c.bbox.w);
3327 vec2 _1955 = max(max(quad.p0, quad.p1), quad.p2);
3328 c.bbox = vec4(c.bbox.x, c.bbox.y, _1955.x, _1955.y);
3329 c.pathseg_count = 1u;
3330 break;
3331 }
3332 case 3u:
3333 {
3334 ElementRef param_3 = ref;
3335 CubicSeg cubic = Element_Cubic_read(param_3);
3336 vec2 _1975 = min(min(cubic.p0, cubic.p1), min(cubic.p2, cubic.p3));
3337 c.bbox = vec4(_1975.x, _1975.y, c.bbox.z, c.bbox.w);
3338 vec2 _1989 = max(max(cubic.p0, cubic.p1), max(cubic.p2, cubic.p3));
3339 c.bbox = vec4(c.bbox.x, c.bbox.y, _1989.x, _1989.y);
3340 c.pathseg_count = 1u;
3341 break;
3342 }
3343 case 4u:
3344 case 9u:
3345 case 7u:
3346 {
3347 c.flags = 4u;
3348 c.path_count = 1u;
3349 break;
3350 }
3351 case 8u:
3352 {
3353 c.path_count = 1u;
3354 break;
3355 }
3356 case 5u:
3357 {
3358 ElementRef param_4 = ref;
3359 SetLineWidth lw = Element_SetLineWidth_read(param_4);
3360 c.linewidth = lw.width;
3361 c.flags = 1u;
3362 break;
3363 }
3364 case 6u:
3365 {
3366 ElementRef param_5 = ref;
3367 Transform t = Element_Transform_read(param_5);
3368 c.mat = t.mat;
3369 c.translate = t.translate;
3370 c.trans_count = 1u;
3371 break;
3372 }
3373 case 10u:
3374 {
3375 ElementRef param_6 = ref;
3376 SetFillMode fm = Element_SetFillMode_read(param_6);
3377 c.flags = 8u | (fm.fill_mode << uint(4));
3378 break;
3379 }
3380 }
3381 return c;
3382 }
3383
3384 ElementRef Element_index(ElementRef ref, uint index)
3385 {
3386 return ElementRef(ref.offset + (index * 36u));
3387 }
3388
3389 State combine_state(State a, State b)
3390 {
3391 State c;
3392 c.bbox.x = (min(a.mat.x * b.bbox.x, a.mat.x * b.bbox.z) + min(a.mat.z * b.bbox.y, a.mat.z * b.bbox.w)) + a.translate.x;
3393 c.bbox.y = (min(a.mat.y * b.bbox.x, a.mat.y * b.bbox.z) + min(a.mat.w * b.bbox.y, a.mat.w * b.bbox.w)) + a.translate.y;
3394 c.bbox.z = (max(a.mat.x * b.bbox.x, a.mat.x * b.bbox.z) + max(a.mat.z * b.bbox.y, a.mat.z * b.bbox.w)) + a.translate.x;
3395 c.bbox.w = (max(a.mat.y * b.bbox.x, a.mat.y * b.bbox.z) + max(a.mat.w * b.bbox.y, a.mat.w * b.bbox.w)) + a.translate.y;
3396 bool _1657 = (a.flags & 4u) == 0u;
3397 bool _1665;
3398 if (_1657)
3399 {
3400 _1665 = b.bbox.z <= b.bbox.x;
3401 }
3402 else
3403 {
3404 _1665 = _1657;
3405 }
3406 bool _1673;
3407 if (_1665)
3408 {
3409 _1673 = b.bbox.w <= b.bbox.y;
3410 }
3411 else
3412 {
3413 _1673 = _1665;
3414 }
3415 if (_1673)
3416 {
3417 c.bbox = a.bbox;
3418 }
3419 else
3420 {
3421 bool _1683 = (a.flags & 4u) == 0u;
3422 bool _1690;
3423 if (_1683)
3424 {
3425 _1690 = (b.flags & 2u) == 0u;
3426 }
3427 else
3428 {
3429 _1690 = _1683;
3430 }
3431 bool _1707;
3432 if (_1690)
3433 {
3434 bool _1697 = a.bbox.z > a.bbox.x;
3435 bool _1706;
3436 if (!_1697)
3437 {
3438 _1706 = a.bbox.w > a.bbox.y;
3439 }
3440 else
3441 {
3442 _1706 = _1697;
3443 }
3444 _1707 = _1706;
3445 }
3446 else
3447 {
3448 _1707 = _1690;
3449 }
3450 if (_1707)
3451 {
3452 vec2 _1716 = min(a.bbox.xy, c.bbox.xy);
3453 c.bbox = vec4(_1716.x, _1716.y, c.bbox.z, c.bbox.w);
3454 vec2 _1726 = max(a.bbox.zw, c.bbox.zw);
3455 c.bbox = vec4(c.bbox.x, c.bbox.y, _1726.x, _1726.y);
3456 }
3457 }
3458 c.mat.x = (a.mat.x * b.mat.x) + (a.mat.z * b.mat.y);
3459 c.mat.y = (a.mat.y * b.mat.x) + (a.mat.w * b.mat.y);
3460 c.mat.z = (a.mat.x * b.mat.z) + (a.mat.z * b.mat.w);
3461 c.mat.w = (a.mat.y * b.mat.z) + (a.mat.w * b.mat.w);
3462 c.translate.x = ((a.mat.x * b.translate.x) + (a.mat.z * b.translate.y)) + a.translate.x;
3463 c.translate.y = ((a.mat.y * b.translate.x) + (a.mat.w * b.translate.y)) + a.translate.y;
3464 float _1812;
3465 if ((b.flags & 1u) == 0u)
3466 {
3467 _1812 = a.linewidth;
3468 }
3469 else
3470 {
3471 _1812 = b.linewidth;
3472 }
3473 c.linewidth = _1812;
3474 c.flags = (a.flags & 11u) | b.flags;
3475 c.flags |= ((a.flags & 4u) >> uint(1));
3476 uint _1842;
3477 if ((b.flags & 8u) == 0u)
3478 {
3479 _1842 = a.flags;
3480 }
3481 else
3482 {
3483 _1842 = b.flags;
3484 }
3485 uint fill_mode = _1842;
3486 fill_mode &= 16u;
3487 c.flags = (c.flags & 4294967279u) | fill_mode;
3488 c.path_count = a.path_count + b.path_count;
3489 c.pathseg_count = a.pathseg_count + b.pathseg_count;
3490 c.trans_count = a.trans_count + b.trans_count;
3491 return c;
3492 }
3493
3494 StateRef state_aggregate_ref(uint partition_ix)
3495 {
3496 return StateRef(4u + (partition_ix * 124u));
3497 }
3498
3499 void State_write(StateRef ref, State s)
3500 {
3501 uint ix = ref.offset >> uint(2);
3502 _779.state[ix + 0u] = floatBitsToUint(s.mat.x);
3503 _779.state[ix + 1u] = floatBitsToUint(s.mat.y);
3504 _779.state[ix + 2u] = floatBitsToUint(s.mat.z);
3505 _779.state[ix + 3u] = floatBitsToUint(s.mat.w);
3506 _779.state[ix + 4u] = floatBitsToUint(s.translate.x);
3507 _779.state[ix + 5u] = floatBitsToUint(s.translate.y);
3508 _779.state[ix + 6u] = floatBitsToUint(s.bbox.x);
3509 _779.state[ix + 7u] = floatBitsToUint(s.bbox.y);
3510 _779.state[ix + 8u] = floatBitsToUint(s.bbox.z);
3511 _779.state[ix + 9u] = floatBitsToUint(s.bbox.w);
3512 _779.state[ix + 10u] = floatBitsToUint(s.linewidth);
3513 _779.state[ix + 11u] = s.flags;
3514 _779.state[ix + 12u] = s.path_count;
3515 _779.state[ix + 13u] = s.pathseg_count;
3516 _779.state[ix + 14u] = s.trans_count;
3517 }
3518
3519 StateRef state_prefix_ref(uint partition_ix)
3520 {
3521 return StateRef((4u + (partition_ix * 124u)) + 60u);
3522 }
3523
3524 uint state_flag_index(uint partition_ix)
3525 {
3526 return partition_ix * 31u;
3527 }
3528
3529 State State_read(StateRef ref)
3530 {
3531 uint ix = ref.offset >> uint(2);
3532 uint raw0 = _779.state[ix + 0u];
3533 uint raw1 = _779.state[ix + 1u];
3534 uint raw2 = _779.state[ix + 2u];
3535 uint raw3 = _779.state[ix + 3u];
3536 uint raw4 = _779.state[ix + 4u];
3537 uint raw5 = _779.state[ix + 5u];
3538 uint raw6 = _779.state[ix + 6u];
3539 uint raw7 = _779.state[ix + 7u];
3540 uint raw8 = _779.state[ix + 8u];
3541 uint raw9 = _779.state[ix + 9u];
3542 uint raw10 = _779.state[ix + 10u];
3543 uint raw11 = _779.state[ix + 11u];
3544 uint raw12 = _779.state[ix + 12u];
3545 uint raw13 = _779.state[ix + 13u];
3546 uint raw14 = _779.state[ix + 14u];
3547 State s;
3548 s.mat = vec4(uintBitsToFloat(raw0), uintBitsToFloat(raw1), uintBitsToFloat(raw2), uintBitsToFloat(raw3));
3549 s.translate = vec2(uintBitsToFloat(raw4), uintBitsToFloat(raw5));
3550 s.bbox = vec4(uintBitsToFloat(raw6), uintBitsToFloat(raw7), uintBitsToFloat(raw8), uintBitsToFloat(raw9));
3551 s.linewidth = uintBitsToFloat(raw10);
3552 s.flags = raw11;
3553 s.path_count = raw12;
3554 s.pathseg_count = raw13;
3555 s.trans_count = raw14;
3556 return s;
3557 }
3558
3559 uint fill_mode_from_flags(uint flags)
3560 {
3561 return flags & 1u;
3562 }
3563
3564 vec2 get_linewidth(State st)
3565 {
3566 return vec2(length(st.mat.xz), length(st.mat.yw)) * (0.5 * st.linewidth);
3567 }
3568
3569 bool touch_mem(Alloc alloc, uint offset)
3570 {
3571 return true;
3572 }
3573
3574 void write_mem(Alloc alloc, uint offset, uint val)
3575 {
3576 Alloc param = alloc;
3577 uint param_1 = offset;
3578 if (!touch_mem(param, param_1))
3579 {
3580 return;
3581 }
3582 _294.memory[offset] = val;
3583 }
3584
3585 void PathCubic_write(Alloc a, PathCubicRef ref, PathCubic s)
3586 {
3587 uint ix = ref.offset >> uint(2);
3588 Alloc param = a;
3589 uint param_1 = ix + 0u;
3590 uint param_2 = floatBitsToUint(s.p0.x);
3591 write_mem(param, param_1, param_2);
3592 Alloc param_3 = a;
3593 uint param_4 = ix + 1u;
3594 uint param_5 = floatBitsToUint(s.p0.y);
3595 write_mem(param_3, param_4, param_5);
3596 Alloc param_6 = a;
3597 uint param_7 = ix + 2u;
3598 uint param_8 = floatBitsToUint(s.p1.x);
3599 write_mem(param_6, param_7, param_8);
3600 Alloc param_9 = a;
3601 uint param_10 = ix + 3u;
3602 uint param_11 = floatBitsToUint(s.p1.y);
3603 write_mem(param_9, param_10, param_11);
3604 Alloc param_12 = a;
3605 uint param_13 = ix + 4u;
3606 uint param_14 = floatBitsToUint(s.p2.x);
3607 write_mem(param_12, param_13, param_14);
3608 Alloc param_15 = a;
3609 uint param_16 = ix + 5u;
3610 uint param_17 = floatBitsToUint(s.p2.y);
3611 write_mem(param_15, param_16, param_17);
3612 Alloc param_18 = a;
3613 uint param_19 = ix + 6u;
3614 uint param_20 = floatBitsToUint(s.p3.x);
3615 write_mem(param_18, param_19, param_20);
3616 Alloc param_21 = a;
3617 uint param_22 = ix + 7u;
3618 uint param_23 = floatBitsToUint(s.p3.y);
3619 write_mem(param_21, param_22, param_23);
3620 Alloc param_24 = a;
3621 uint param_25 = ix + 8u;
3622 uint param_26 = s.path_ix;
3623 write_mem(param_24, param_25, param_26);
3624 Alloc param_27 = a;
3625 uint param_28 = ix + 9u;
3626 uint param_29 = s.trans_ix;
3627 write_mem(param_27, param_28, param_29);
3628 Alloc param_30 = a;
3629 uint param_31 = ix + 10u;
3630 uint param_32 = floatBitsToUint(s.stroke.x);
3631 write_mem(param_30, param_31, param_32);
3632 Alloc param_33 = a;
3633 uint param_34 = ix + 11u;
3634 uint param_35 = floatBitsToUint(s.stroke.y);
3635 write_mem(param_33, param_34, param_35);
3636 }
3637
3638 void PathSeg_Cubic_write(Alloc a, PathSegRef ref, uint flags, PathCubic s)
3639 {
3640 Alloc param = a;
3641 uint param_1 = ref.offset >> uint(2);
3642 uint param_2 = (flags << uint(16)) | 1u;
3643 write_mem(param, param_1, param_2);
3644 Alloc param_3 = a;
3645 PathCubicRef param_4 = PathCubicRef(ref.offset + 4u);
3646 PathCubic param_5 = s;
3647 PathCubic_write(param_3, param_4, param_5);
3648 }
3649
3650 FillColor FillColor_read(FillColorRef ref)
3651 {
3652 uint ix = ref.offset >> uint(2);
3653 uint raw0 = _323.scene[ix + 0u];
3654 FillColor s;
3655 s.rgba_color = raw0;
3656 return s;
3657 }
3658
3659 FillColor Element_FillColor_read(ElementRef ref)
3660 {
3661 FillColorRef param = FillColorRef(ref.offset + 4u);
3662 return FillColor_read(param);
3663 }
3664
3665 void AnnoColor_write(Alloc a, AnnoColorRef ref, AnnoColor s)
3666 {
3667 uint ix = ref.offset >> uint(2);
3668 Alloc param = a;
3669 uint param_1 = ix + 0u;
3670 uint param_2 = floatBitsToUint(s.bbox.x);
3671 write_mem(param, param_1, param_2);
3672 Alloc param_3 = a;
3673 uint param_4 = ix + 1u;
3674 uint param_5 = floatBitsToUint(s.bbox.y);
3675 write_mem(param_3, param_4, param_5);
3676 Alloc param_6 = a;
3677 uint param_7 = ix + 2u;
3678 uint param_8 = floatBitsToUint(s.bbox.z);
3679 write_mem(param_6, param_7, param_8);
3680 Alloc param_9 = a;
3681 uint param_10 = ix + 3u;
3682 uint param_11 = floatBitsToUint(s.bbox.w);
3683 write_mem(param_9, param_10, param_11);
3684 Alloc param_12 = a;
3685 uint param_13 = ix + 4u;
3686 uint param_14 = floatBitsToUint(s.linewidth);
3687 write_mem(param_12, param_13, param_14);
3688 Alloc param_15 = a;
3689 uint param_16 = ix + 5u;
3690 uint param_17 = s.rgba_color;
3691 write_mem(param_15, param_16, param_17);
3692 }
3693
3694 void Annotated_Color_write(Alloc a, AnnotatedRef ref, uint flags, AnnoColor s)
3695 {
3696 Alloc param = a;
3697 uint param_1 = ref.offset >> uint(2);
3698 uint param_2 = (flags << uint(16)) | 1u;
3699 write_mem(param, param_1, param_2);
3700 Alloc param_3 = a;
3701 AnnoColorRef param_4 = AnnoColorRef(ref.offset + 4u);
3702 AnnoColor param_5 = s;
3703 AnnoColor_write(param_3, param_4, param_5);
3704 }
3705
3706 FillImage FillImage_read(FillImageRef ref)
3707 {
3708 uint ix = ref.offset >> uint(2);
3709 uint raw0 = _323.scene[ix + 0u];
3710 uint raw1 = _323.scene[ix + 1u];
3711 FillImage s;
3712 s.index = raw0;
3713 s.offset = ivec2(int(raw1 << uint(16)) >> 16, int(raw1) >> 16);
3714 return s;
3715 }
3716
3717 FillImage Element_FillImage_read(ElementRef ref)
3718 {
3719 FillImageRef param = FillImageRef(ref.offset + 4u);
3720 return FillImage_read(param);
3721 }
3722
3723 void AnnoImage_write(Alloc a, AnnoImageRef ref, AnnoImage s)
3724 {
3725 uint ix = ref.offset >> uint(2);
3726 Alloc param = a;
3727 uint param_1 = ix + 0u;
3728 uint param_2 = floatBitsToUint(s.bbox.x);
3729 write_mem(param, param_1, param_2);
3730 Alloc param_3 = a;
3731 uint param_4 = ix + 1u;
3732 uint param_5 = floatBitsToUint(s.bbox.y);
3733 write_mem(param_3, param_4, param_5);
3734 Alloc param_6 = a;
3735 uint param_7 = ix + 2u;
3736 uint param_8 = floatBitsToUint(s.bbox.z);
3737 write_mem(param_6, param_7, param_8);
3738 Alloc param_9 = a;
3739 uint param_10 = ix + 3u;
3740 uint param_11 = floatBitsToUint(s.bbox.w);
3741 write_mem(param_9, param_10, param_11);
3742 Alloc param_12 = a;
3743 uint param_13 = ix + 4u;
3744 uint param_14 = floatBitsToUint(s.linewidth);
3745 write_mem(param_12, param_13, param_14);
3746 Alloc param_15 = a;
3747 uint param_16 = ix + 5u;
3748 uint param_17 = s.index;
3749 write_mem(param_15, param_16, param_17);
3750 Alloc param_18 = a;
3751 uint param_19 = ix + 6u;
3752 uint param_20 = (uint(s.offset.x) & 65535u) | (uint(s.offset.y) << uint(16));
3753 write_mem(param_18, param_19, param_20);
3754 }
3755
3756 void Annotated_Image_write(Alloc a, AnnotatedRef ref, uint flags, AnnoImage s)
3757 {
3758 Alloc param = a;
3759 uint param_1 = ref.offset >> uint(2);
3760 uint param_2 = (flags << uint(16)) | 2u;
3761 write_mem(param, param_1, param_2);
3762 Alloc param_3 = a;
3763 AnnoImageRef param_4 = AnnoImageRef(ref.offset + 4u);
3764 AnnoImage param_5 = s;
3765 AnnoImage_write(param_3, param_4, param_5);
3766 }
3767
3768 Clip Clip_read(ClipRef ref)
3769 {
3770 uint ix = ref.offset >> uint(2);
3771 uint raw0 = _323.scene[ix + 0u];
3772 uint raw1 = _323.scene[ix + 1u];
3773 uint raw2 = _323.scene[ix + 2u];
3774 uint raw3 = _323.scene[ix + 3u];
3775 Clip s;
3776 s.bbox = vec4(uintBitsToFloat(raw0), uintBitsToFloat(raw1), uintBitsToFloat(raw2), uintBitsToFloat(raw3));
3777 return s;
3778 }
3779
3780 Clip Element_BeginClip_read(ElementRef ref)
3781 {
3782 ClipRef param = ClipRef(ref.offset + 4u);
3783 return Clip_read(param);
3784 }
3785
3786 void AnnoBeginClip_write(Alloc a, AnnoBeginClipRef ref, AnnoBeginClip s)
3787 {
3788 uint ix = ref.offset >> uint(2);
3789 Alloc param = a;
3790 uint param_1 = ix + 0u;
3791 uint param_2 = floatBitsToUint(s.bbox.x);
3792 write_mem(param, param_1, param_2);
3793 Alloc param_3 = a;
3794 uint param_4 = ix + 1u;
3795 uint param_5 = floatBitsToUint(s.bbox.y);
3796 write_mem(param_3, param_4, param_5);
3797 Alloc param_6 = a;
3798 uint param_7 = ix + 2u;
3799 uint param_8 = floatBitsToUint(s.bbox.z);
3800 write_mem(param_6, param_7, param_8);
3801 Alloc param_9 = a;
3802 uint param_10 = ix + 3u;
3803 uint param_11 = floatBitsToUint(s.bbox.w);
3804 write_mem(param_9, param_10, param_11);
3805 Alloc param_12 = a;
3806 uint param_13 = ix + 4u;
3807 uint param_14 = floatBitsToUint(s.linewidth);
3808 write_mem(param_12, param_13, param_14);
3809 }
3810
3811 void Annotated_BeginClip_write(Alloc a, AnnotatedRef ref, uint flags, AnnoBeginClip s)
3812 {
3813 Alloc param = a;
3814 uint param_1 = ref.offset >> uint(2);
3815 uint param_2 = (flags << uint(16)) | 3u;
3816 write_mem(param, param_1, param_2);
3817 Alloc param_3 = a;
3818 AnnoBeginClipRef param_4 = AnnoBeginClipRef(ref.offset + 4u);
3819 AnnoBeginClip param_5 = s;
3820 AnnoBeginClip_write(param_3, param_4, param_5);
3821 }
3822
3823 Clip Element_EndClip_read(ElementRef ref)
3824 {
3825 ClipRef param = ClipRef(ref.offset + 4u);
3826 return Clip_read(param);
3827 }
3828
3829 void AnnoEndClip_write(Alloc a, AnnoEndClipRef ref, AnnoEndClip s)
3830 {
3831 uint ix = ref.offset >> uint(2);
3832 Alloc param = a;
3833 uint param_1 = ix + 0u;
3834 uint param_2 = floatBitsToUint(s.bbox.x);
3835 write_mem(param, param_1, param_2);
3836 Alloc param_3 = a;
3837 uint param_4 = ix + 1u;
3838 uint param_5 = floatBitsToUint(s.bbox.y);
3839 write_mem(param_3, param_4, param_5);
3840 Alloc param_6 = a;
3841 uint param_7 = ix + 2u;
3842 uint param_8 = floatBitsToUint(s.bbox.z);
3843 write_mem(param_6, param_7, param_8);
3844 Alloc param_9 = a;
3845 uint param_10 = ix + 3u;
3846 uint param_11 = floatBitsToUint(s.bbox.w);
3847 write_mem(param_9, param_10, param_11);
3848 }
3849
3850 void Annotated_EndClip_write(Alloc a, AnnotatedRef ref, AnnoEndClip s)
3851 {
3852 Alloc param = a;
3853 uint param_1 = ref.offset >> uint(2);
3854 uint param_2 = 4u;
3855 write_mem(param, param_1, param_2);
3856 Alloc param_3 = a;
3857 AnnoEndClipRef param_4 = AnnoEndClipRef(ref.offset + 4u);
3858 AnnoEndClip param_5 = s;
3859 AnnoEndClip_write(param_3, param_4, param_5);
3860 }
3861
3862 void TransformSeg_write(Alloc a, TransformSegRef ref, TransformSeg s)
3863 {
3864 uint ix = ref.offset >> uint(2);
3865 Alloc param = a;
3866 uint param_1 = ix + 0u;
3867 uint param_2 = floatBitsToUint(s.mat.x);
3868 write_mem(param, param_1, param_2);
3869 Alloc param_3 = a;
3870 uint param_4 = ix + 1u;
3871 uint param_5 = floatBitsToUint(s.mat.y);
3872 write_mem(param_3, param_4, param_5);
3873 Alloc param_6 = a;
3874 uint param_7 = ix + 2u;
3875 uint param_8 = floatBitsToUint(s.mat.z);
3876 write_mem(param_6, param_7, param_8);
3877 Alloc param_9 = a;
3878 uint param_10 = ix + 3u;
3879 uint param_11 = floatBitsToUint(s.mat.w);
3880 write_mem(param_9, param_10, param_11);
3881 Alloc param_12 = a;
3882 uint param_13 = ix + 4u;
3883 uint param_14 = floatBitsToUint(s.translate.x);
3884 write_mem(param_12, param_13, param_14);
3885 Alloc param_15 = a;
3886 uint param_16 = ix + 5u;
3887 uint param_17 = floatBitsToUint(s.translate.y);
3888 write_mem(param_15, param_16, param_17);
3889 }
3890
3891 void main()
3892 {
3893 if (_294.mem_error != 0u)
3894 {
3895 return;
3896 }
3897 if (gl_LocalInvocationID.x == 0u)
3898 {
3899 uint _2069 = atomicAdd(_779.part_counter, 1u);
3900 sh_part_ix = _2069;
3901 }
3902 barrier();
3903 uint part_ix = sh_part_ix;
3904 uint ix = (part_ix * 128u) + (gl_LocalInvocationID.x * 4u);
3905 ElementRef ref = ElementRef(ix * 36u);
3906 ElementRef param = ref;
3907 State th_state[4];
3908 th_state[0] = map_element(param);
3909 for (uint i = 1u; i < 4u; i++)
3910 {
3911 ElementRef param_1 = ref;
3912 uint param_2 = i;
3913 ElementRef param_3 = Element_index(param_1, param_2);
3914 State param_4 = th_state[i - 1u];
3915 State param_5 = map_element(param_3);
3916 th_state[i] = combine_state(param_4, param_5);
3917 }
3918 State agg = th_state[3];
3919 sh_state[gl_LocalInvocationID.x] = agg;
3920 for (uint i_1 = 0u; i_1 < 5u; i_1++)
3921 {
3922 barrier();
3923 if (gl_LocalInvocationID.x >= uint(1 << int(i_1)))
3924 {
3925 State other = sh_state[gl_LocalInvocationID.x - uint(1 << int(i_1))];
3926 State param_6 = other;
3927 State param_7 = agg;
3928 agg = combine_state(param_6, param_7);
3929 }
3930 barrier();
3931 sh_state[gl_LocalInvocationID.x] = agg;
3932 }
3933 State exclusive;
3934 exclusive.bbox = vec4(0.0);
3935 exclusive.mat = vec4(1.0, 0.0, 0.0, 1.0);
3936 exclusive.translate = vec2(0.0);
3937 exclusive.linewidth = 1.0;
3938 exclusive.flags = 0u;
3939 exclusive.path_count = 0u;
3940 exclusive.pathseg_count = 0u;
3941 exclusive.trans_count = 0u;
3942 if (gl_LocalInvocationID.x == 31u)
3943 {
3944 uint param_8 = part_ix;
3945 StateRef param_9 = state_aggregate_ref(param_8);
3946 State param_10 = agg;
3947 State_write(param_9, param_10);
3948 uint flag = 1u;
3949 memoryBarrierBuffer();
3950 if (part_ix == 0u)
3951 {
3952 uint param_11 = part_ix;
3953 StateRef param_12 = state_prefix_ref(param_11);
3954 State param_13 = agg;
3955 State_write(param_12, param_13);
3956 flag = 2u;
3957 }
3958 uint param_14 = part_ix;
3959 _779.state[state_flag_index(param_14)] = flag;
3960 if (part_ix != 0u)
3961 {
3962 uint look_back_ix = part_ix - 1u;
3963 uint their_ix = 0u;
3964 State their_agg;
3965 while (true)
3966 {
3967 uint param_15 = look_back_ix;
3968 flag = _779.state[state_flag_index(param_15)];
3969 if (flag == 2u)
3970 {
3971 uint param_16 = look_back_ix;
3972 StateRef param_17 = state_prefix_ref(param_16);
3973 State their_prefix = State_read(param_17);
3974 State param_18 = their_prefix;
3975 State param_19 = exclusive;
3976 exclusive = combine_state(param_18, param_19);
3977 break;
3978 }
3979 else
3980 {
3981 if (flag == 1u)
3982 {
3983 uint param_20 = look_back_ix;
3984 StateRef param_21 = state_aggregate_ref(param_20);
3985 their_agg = State_read(param_21);
3986 State param_22 = their_agg;
3987 State param_23 = exclusive;
3988 exclusive = combine_state(param_22, param_23);
3989 look_back_ix--;
3990 their_ix = 0u;
3991 continue;
3992 }
3993 }
3994 ElementRef ref_1 = ElementRef(((look_back_ix * 128u) + their_ix) * 36u);
3995 ElementRef param_24 = ref_1;
3996 State s = map_element(param_24);
3997 if (their_ix == 0u)
3998 {
3999 their_agg = s;
4000 }
4001 else
4002 {
4003 State param_25 = their_agg;
4004 State param_26 = s;
4005 their_agg = combine_state(param_25, param_26);
4006 }
4007 their_ix++;
4008 if (their_ix == 128u)
4009 {
4010 State param_27 = their_agg;
4011 State param_28 = exclusive;
4012 exclusive = combine_state(param_27, param_28);
4013 if (look_back_ix == 0u)
4014 {
4015 break;
4016 }
4017 look_back_ix--;
4018 their_ix = 0u;
4019 }
4020 }
4021 State param_29 = exclusive;
4022 State param_30 = agg;
4023 State inclusive_prefix = combine_state(param_29, param_30);
4024 sh_prefix = exclusive;
4025 uint param_31 = part_ix;
4026 StateRef param_32 = state_prefix_ref(param_31);
4027 State param_33 = inclusive_prefix;
4028 State_write(param_32, param_33);
4029 memoryBarrierBuffer();
4030 flag = 2u;
4031 uint param_34 = part_ix;
4032 _779.state[state_flag_index(param_34)] = flag;
4033 }
4034 }
4035 barrier();
4036 if (part_ix != 0u)
4037 {
4038 exclusive = sh_prefix;
4039 }
4040 State row = exclusive;
4041 if (gl_LocalInvocationID.x > 0u)
4042 {
4043 State other_1 = sh_state[gl_LocalInvocationID.x - 1u];
4044 State param_35 = row;
4045 State param_36 = other_1;
4046 row = combine_state(param_35, param_36);
4047 }
4048 PathCubic path_cubic;
4049 PathSegRef path_out_ref;
4050 Alloc param_45;
4051 Alloc param_51;
4052 Alloc param_57;
4053 AnnoColor anno_fill;
4054 AnnotatedRef out_ref;
4055 Alloc param_63;
4056 AnnoImage anno_img;
4057 Alloc param_69;
4058 AnnoBeginClip anno_begin_clip;
4059 Alloc param_75;
4060 Alloc param_80;
4061 Alloc param_83;
4062 for (uint i_2 = 0u; i_2 < 4u; i_2++)
4063 {
4064 State param_37 = row;
4065 State param_38 = th_state[i_2];
4066 State st = combine_state(param_37, param_38);
4067 ElementRef param_39 = ref;
4068 uint param_40 = i_2;
4069 ElementRef this_ref = Element_index(param_39, param_40);
4070 ElementRef param_41 = this_ref;
4071 ElementTag tag = Element_tag(param_41);
4072 uint param_42 = st.flags >> uint(4);
4073 uint fill_mode = fill_mode_from_flags(param_42);
4074 bool is_stroke = fill_mode == 1u;
4075 switch (tag.tag)
4076 {
4077 case 1u:
4078 {
4079 ElementRef param_43 = this_ref;
4080 LineSeg line = Element_Line_read(param_43);
4081 path_cubic.p0 = line.p0;
4082 path_cubic.p1 = mix(line.p0, line.p1, vec2(0.3333333432674407958984375));
4083 path_cubic.p2 = mix(line.p1, line.p0, vec2(0.3333333432674407958984375));
4084 path_cubic.p3 = line.p1;
4085 path_cubic.path_ix = st.path_count;
4086 path_cubic.trans_ix = st.trans_count;
4087 if (is_stroke)
4088 {
4089 State param_44 = st;
4090 path_cubic.stroke = get_linewidth(param_44);
4091 }
4092 else
4093 {
4094 path_cubic.stroke = vec2(0.0);
4095 }
4096 path_out_ref = PathSegRef(_2435.conf.pathseg_alloc.offset + ((st.pathseg_count - 1u) * 52u));
4097 param_45.offset = _2435.conf.pathseg_alloc.offset;
4098 PathSegRef param_46 = path_out_ref;
4099 uint param_47 = fill_mode;
4100 PathCubic param_48 = path_cubic;
4101 PathSeg_Cubic_write(param_45, param_46, param_47, param_48);
4102 break;
4103 }
4104 case 2u:
4105 {
4106 ElementRef param_49 = this_ref;
4107 QuadSeg quad = Element_Quad_read(param_49);
4108 path_cubic.p0 = quad.p0;
4109 path_cubic.p1 = mix(quad.p1, quad.p0, vec2(0.3333333432674407958984375));
4110 path_cubic.p2 = mix(quad.p1, quad.p2, vec2(0.3333333432674407958984375));
4111 path_cubic.p3 = quad.p2;
4112 path_cubic.path_ix = st.path_count;
4113 path_cubic.trans_ix = st.trans_count;
4114 if (is_stroke)
4115 {
4116 State param_50 = st;
4117 path_cubic.stroke = get_linewidth(param_50);
4118 }
4119 else
4120 {
4121 path_cubic.stroke = vec2(0.0);
4122 }
4123 path_out_ref = PathSegRef(_2435.conf.pathseg_alloc.offset + ((st.pathseg_count - 1u) * 52u));
4124 param_51.offset = _2435.conf.pathseg_alloc.offset;
4125 PathSegRef param_52 = path_out_ref;
4126 uint param_53 = fill_mode;
4127 PathCubic param_54 = path_cubic;
4128 PathSeg_Cubic_write(param_51, param_52, param_53, param_54);
4129 break;
4130 }
4131 case 3u:
4132 {
4133 ElementRef param_55 = this_ref;
4134 CubicSeg cubic = Element_Cubic_read(param_55);
4135 path_cubic.p0 = cubic.p0;
4136 path_cubic.p1 = cubic.p1;
4137 path_cubic.p2 = cubic.p2;
4138 path_cubic.p3 = cubic.p3;
4139 path_cubic.path_ix = st.path_count;
4140 path_cubic.trans_ix = st.trans_count;
4141 if (is_stroke)
4142 {
4143 State param_56 = st;
4144 path_cubic.stroke = get_linewidth(param_56);
4145 }
4146 else
4147 {
4148 path_cubic.stroke = vec2(0.0);
4149 }
4150 path_out_ref = PathSegRef(_2435.conf.pathseg_alloc.offset + ((st.pathseg_count - 1u) * 52u));
4151 param_57.offset = _2435.conf.pathseg_alloc.offset;
4152 PathSegRef param_58 = path_out_ref;
4153 uint param_59 = fill_mode;
4154 PathCubic param_60 = path_cubic;
4155 PathSeg_Cubic_write(param_57, param_58, param_59, param_60);
4156 break;
4157 }
4158 case 4u:
4159 {
4160 ElementRef param_61 = this_ref;
4161 FillColor fill = Element_FillColor_read(param_61);
4162 anno_fill.rgba_color = fill.rgba_color;
4163 if (is_stroke)
4164 {
4165 State param_62 = st;
4166 vec2 lw = get_linewidth(param_62);
4167 anno_fill.bbox = st.bbox + vec4(-lw, lw);
4168 anno_fill.linewidth = st.linewidth * sqrt(abs((st.mat.x * st.mat.w) - (st.mat.y * st.mat.z)));
4169 }
4170 else
4171 {
4172 anno_fill.bbox = st.bbox;
4173 anno_fill.linewidth = 0.0;
4174 }
4175 out_ref = AnnotatedRef(_2435.conf.anno_alloc.offset + ((st.path_count - 1u) * 32u));
4176 param_63.offset = _2435.conf.anno_alloc.offset;
4177 AnnotatedRef param_64 = out_ref;
4178 uint param_65 = fill_mode;
4179 AnnoColor param_66 = anno_fill;
4180 Annotated_Color_write(param_63, param_64, param_65, param_66);
4181 break;
4182 }
4183 case 9u:
4184 {
4185 ElementRef param_67 = this_ref;
4186 FillImage fill_img = Element_FillImage_read(param_67);
4187 anno_img.index = fill_img.index;
4188 anno_img.offset = fill_img.offset;
4189 if (is_stroke)
4190 {
4191 State param_68 = st;
4192 vec2 lw_1 = get_linewidth(param_68);
4193 anno_img.bbox = st.bbox + vec4(-lw_1, lw_1);
4194 anno_img.linewidth = st.linewidth * sqrt(abs((st.mat.x * st.mat.w) - (st.mat.y * st.mat.z)));
4195 }
4196 else
4197 {
4198 anno_img.bbox = st.bbox;
4199 anno_img.linewidth = 0.0;
4200 }
4201 out_ref = AnnotatedRef(_2435.conf.anno_alloc.offset + ((st.path_count - 1u) * 32u));
4202 param_69.offset = _2435.conf.anno_alloc.offset;
4203 AnnotatedRef param_70 = out_ref;
4204 uint param_71 = fill_mode;
4205 AnnoImage param_72 = anno_img;
4206 Annotated_Image_write(param_69, param_70, param_71, param_72);
4207 break;
4208 }
4209 case 7u:
4210 {
4211 ElementRef param_73 = this_ref;
4212 Clip begin_clip = Element_BeginClip_read(param_73);
4213 anno_begin_clip.bbox = begin_clip.bbox;
4214 if (is_stroke)
4215 {
4216 State param_74 = st;
4217 vec2 lw_2 = get_linewidth(param_74);
4218 anno_begin_clip.linewidth = st.linewidth * sqrt(abs((st.mat.x * st.mat.w) - (st.mat.y * st.mat.z)));
4219 }
4220 else
4221 {
4222 anno_fill.linewidth = 0.0;
4223 }
4224 out_ref = AnnotatedRef(_2435.conf.anno_alloc.offset + ((st.path_count - 1u) * 32u));
4225 param_75.offset = _2435.conf.anno_alloc.offset;
4226 AnnotatedRef param_76 = out_ref;
4227 uint param_77 = fill_mode;
4228 AnnoBeginClip param_78 = anno_begin_clip;
4229 Annotated_BeginClip_write(param_75, param_76, param_77, param_78);
4230 break;
4231 }
4232 case 8u:
4233 {
4234 ElementRef param_79 = this_ref;
4235 Clip end_clip = Element_EndClip_read(param_79);
4236 AnnoEndClip anno_end_clip = AnnoEndClip(end_clip.bbox);
4237 out_ref = AnnotatedRef(_2435.conf.anno_alloc.offset + ((st.path_count - 1u) * 32u));
4238 param_80.offset = _2435.conf.anno_alloc.offset;
4239 AnnotatedRef param_81 = out_ref;
4240 AnnoEndClip param_82 = anno_end_clip;
4241 Annotated_EndClip_write(param_80, param_81, param_82);
4242 break;
4243 }
4244 case 6u:
4245 {
4246 TransformSeg transform = TransformSeg(st.mat, st.translate);
4247 TransformSegRef trans_ref = TransformSegRef(_2435.conf.trans_alloc.offset + ((st.trans_count - 1u) * 24u));
4248 param_83.offset = _2435.conf.trans_alloc.offset;
4249 TransformSegRef param_84 = trans_ref;
4250 TransformSeg param_85 = transform;
4251 TransformSeg_write(param_83, param_84, param_85);
4252 break;
4253 }
4254 }
4255 }
4256 }
4257
4258 `,
4259 }
4260 shader_intersect_frag = driver.ShaderSources{
4261 Name: "intersect.frag",
4262 Inputs: []driver.InputLocation{{Name: "vUV", Location: 0, Semantic: "TEXCOORD", SemanticIndex: 0, Type: 0x0, Size: 2}},
4263 Textures: []driver.TextureBinding{{Name: "cover", Binding: 0}},
4264 GLSL100ES: `#version 100
4265 precision mediump float;
4266 precision highp int;
4267
4268 uniform mediump sampler2D cover;
4269
4270 varying highp vec2 vUV;
4271
4272 void main()
4273 {
4274 float cover_1 = abs(texture2D(cover, vUV).x);
4275 gl_FragData[0].x = cover_1;
4276 }
4277
4278 `,
4279 GLSL300ES: `#version 300 es
4280 precision mediump float;
4281 precision highp int;
4282
4283 uniform mediump sampler2D cover;
4284
4285 in highp vec2 vUV;
4286 layout(location = 0) out vec4 fragColor;
4287
4288 void main()
4289 {
4290 float cover_1 = abs(texture(cover, vUV).x);
4291 fragColor.x = cover_1;
4292 }
4293
4294 `,
4295 GLSL130: `#version 130
4296 #ifdef GL_ARB_shading_language_420pack
4297 #extension GL_ARB_shading_language_420pack : require
4298 #endif
4299
4300 layout(binding = 0) uniform sampler2D cover;
4301
4302 in vec2 vUV;
4303 out vec4 fragColor;
4304
4305 void main()
4306 {
4307 float cover_1 = abs(texture(cover, vUV).x);
4308 fragColor.x = cover_1;
4309 }
4310
4311 `,
4312 GLSL150: `#version 150
4313 #ifdef GL_ARB_shading_language_420pack
4314 #extension GL_ARB_shading_language_420pack : require
4315 #endif
4316
4317 layout(binding = 0) uniform sampler2D cover;
4318
4319 in vec2 vUV;
4320 out vec4 fragColor;
4321
4322 void main()
4323 {
4324 float cover_1 = abs(texture(cover, vUV).x);
4325 fragColor.x = cover_1;
4326 }
4327
4328 `,
4329 HLSL: "DXBC\xe0\xe4\x03\x8c\xacVF\x82l\xe7|\xc3T\xa6'\xef\x01\x00\x00\x00\b\x03\x00\x00\x06\x00\x00\x008\x00\x00\x00\xd4\x00\x00\x00\x80\x01\x00\x00\xfc\x01\x00\x00\xa0\x02\x00\x00\xd4\x02\x00\x00Aon9\x94\x00\x00\x00\x94\x00\x00\x00\x00\x02\xff\xffl\x00\x00\x00(\x00\x00\x00\x00\x00(\x00\x00\x00(\x00\x00\x00(\x00\x01\x00$\x00\x00\x00(\x00\x00\x00\x00\x00\x00\x02\xff\xffQ\x00\x00\x05\x00\x00\x0f\xa0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\x00\x00\x02\x00\x00\x00\x80\x00\x00\x03\xb0\x1f\x00\x00\x02\x00\x00\x00\x90\x00\b\x0f\xa0B\x00\x00\x03\x00\x00\x0f\x80\x00\x00\xe4\xb0\x00\b\xe4\xa0#\x00\x00\x02\x00\x00\x01\x80\x00\x00\x00\x80\x01\x00\x00\x02\x00\x00\x0e\x80\x00\x00\x00\xa0\x01\x00\x00\x02\x00\b\x0f\x80\x00\x00\xe4\x80\xff\xff\x00\x00SHDR\xa4\x00\x00\x00@\x00\x00\x00)\x00\x00\x00Z\x00\x00\x03\x00`\x10\x00\x00\x00\x00\x00X\x18\x00\x04\x00p\x10\x00\x00\x00\x00\x00UU\x00\x00b\x10\x00\x032\x10\x10\x00\x00\x00\x00\x00e\x00\x00\x03\xf2 \x10\x00\x00\x00\x00\x00h\x00\x00\x02\x01\x00\x00\x00E\x00\x00\t\xf2\x00\x10\x00\x00\x00\x00\x00F\x10\x10\x00\x00\x00\x00\x00F~\x10\x00\x00\x00\x00\x00\x00`\x10\x00\x00\x00\x00\x006\x00\x00\x06\x12 \x10\x00\x00\x00\x00\x00\n\x00\x10\x80\x81\x00\x00\x00\x00\x00\x00\x006\x00\x00\b\xe2 \x10\x00\x00\x00\x00\x00\x02@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>\x00\x00\x01STATt\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00RDEF\x9c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x1c\x00\x00\x00\x00\x04\xff\xff\x00\x01\x00\x00q\x00\x00\x00\\\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00k\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x04\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x01\x00\x00\x00\r\x00\x00\x00_cover_sampler\x00cover\x00Microsoft (R) HLSL Shader Compiler 10.1\x00\xab\xab\xabISGN,\x00\x00\x00\x01\x00\x00\x00\b\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x03\x00\x00TEXCOORD\x00\xab\xab\xabOSGN,\x00\x00\x00\x01\x00\x00\x00\b\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00SV_Target\x00\xab\xab",
4330 }
4331 shader_intersect_vert = driver.ShaderSources{
4332 Name: "intersect.vert",
4333 Inputs: []driver.InputLocation{{Name: "pos", Location: 0, Semantic: "TEXCOORD", SemanticIndex: 0, Type: 0x0, Size: 2}, {Name: "uv", Location: 1, Semantic: "TEXCOORD", SemanticIndex: 1, Type: 0x0, Size: 2}},
4334 Uniforms: driver.UniformsReflection{
4335 Blocks: []driver.UniformBlock{{Name: "Block", Binding: 0}},
4336 Locations: []driver.UniformLocation{{Name: "_block.uvTransform", Type: 0x0, Size: 4, Offset: 0}, {Name: "_block.subUVTransform", Type: 0x0, Size: 4, Offset: 16}},
4337 Size: 32,
4338 },
4339 GLSL100ES: `#version 100
4340
4341 struct m3x2
4342 {
4343 vec3 r0;
4344 vec3 r1;
4345 };
4346
4347 struct Block
4348 {
4349 vec4 uvTransform;
4350 vec4 subUVTransform;
4351 };
4352
4353 uniform Block _block;
4354
4355 attribute vec2 pos;
4356 attribute vec2 uv;
4357 varying vec2 vUV;
4358
4359 vec3 transform3x2(m3x2 t, vec3 v)
4360 {
4361 return vec3(dot(t.r0, v), dot(t.r1, v), dot(vec3(0.0, 0.0, 1.0), v));
4362 }
4363
4364 void main()
4365 {
4366 m3x2 param = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, -1.0, 0.0));
4367 vec3 param_1 = vec3(pos, 1.0);
4368 vec3 p = transform3x2(param, param_1);
4369 gl_Position = vec4(p, 1.0);
4370 m3x2 param_2 = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0));
4371 vec3 param_3 = vec3(uv, 1.0);
4372 vec3 uv3 = transform3x2(param_2, param_3);
4373 vUV = (uv3.xy * _block.subUVTransform.xy) + _block.subUVTransform.zw;
4374 m3x2 param_4 = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0));
4375 vec3 param_5 = vec3(vUV, 1.0);
4376 vUV = transform3x2(param_4, param_5).xy;
4377 vUV = (vUV * _block.uvTransform.xy) + _block.uvTransform.zw;
4378 }
4379
4380 `,
4381 GLSL300ES: `#version 300 es
4382
4383 struct m3x2
4384 {
4385 vec3 r0;
4386 vec3 r1;
4387 };
4388
4389 layout(std140) uniform Block
4390 {
4391 vec4 uvTransform;
4392 vec4 subUVTransform;
4393 } _block;
4394
4395 layout(location = 0) in vec2 pos;
4396 layout(location = 1) in vec2 uv;
4397 out vec2 vUV;
4398
4399 vec3 transform3x2(m3x2 t, vec3 v)
4400 {
4401 return vec3(dot(t.r0, v), dot(t.r1, v), dot(vec3(0.0, 0.0, 1.0), v));
4402 }
4403
4404 void main()
4405 {
4406 m3x2 param = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, -1.0, 0.0));
4407 vec3 param_1 = vec3(pos, 1.0);
4408 vec3 p = transform3x2(param, param_1);
4409 gl_Position = vec4(p, 1.0);
4410 m3x2 param_2 = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0));
4411 vec3 param_3 = vec3(uv, 1.0);
4412 vec3 uv3 = transform3x2(param_2, param_3);
4413 vUV = (uv3.xy * _block.subUVTransform.xy) + _block.subUVTransform.zw;
4414 m3x2 param_4 = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0));
4415 vec3 param_5 = vec3(vUV, 1.0);
4416 vUV = transform3x2(param_4, param_5).xy;
4417 vUV = (vUV * _block.uvTransform.xy) + _block.uvTransform.zw;
4418 }
4419
4420 `,
4421 GLSL130: `#version 130
4422 #ifdef GL_ARB_shading_language_420pack
4423 #extension GL_ARB_shading_language_420pack : require
4424 #endif
4425
4426 struct m3x2
4427 {
4428 vec3 r0;
4429 vec3 r1;
4430 };
4431
4432 struct Block
4433 {
4434 vec4 uvTransform;
4435 vec4 subUVTransform;
4436 };
4437
4438 uniform Block _block;
4439
4440 in vec2 pos;
4441 in vec2 uv;
4442 out vec2 vUV;
4443
4444 vec3 transform3x2(m3x2 t, vec3 v)
4445 {
4446 return vec3(dot(t.r0, v), dot(t.r1, v), dot(vec3(0.0, 0.0, 1.0), v));
4447 }
4448
4449 void main()
4450 {
4451 m3x2 param = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, -1.0, 0.0));
4452 vec3 param_1 = vec3(pos, 1.0);
4453 vec3 p = transform3x2(param, param_1);
4454 gl_Position = vec4(p, 1.0);
4455 m3x2 param_2 = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0));
4456 vec3 param_3 = vec3(uv, 1.0);
4457 vec3 uv3 = transform3x2(param_2, param_3);
4458 vUV = (uv3.xy * _block.subUVTransform.xy) + _block.subUVTransform.zw;
4459 m3x2 param_4 = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0));
4460 vec3 param_5 = vec3(vUV, 1.0);
4461 vUV = transform3x2(param_4, param_5).xy;
4462 vUV = (vUV * _block.uvTransform.xy) + _block.uvTransform.zw;
4463 }
4464
4465 `,
4466 GLSL150: `#version 150
4467 #ifdef GL_ARB_shading_language_420pack
4468 #extension GL_ARB_shading_language_420pack : require
4469 #endif
4470
4471 struct m3x2
4472 {
4473 vec3 r0;
4474 vec3 r1;
4475 };
4476
4477 layout(binding = 0, std140) uniform Block
4478 {
4479 vec4 uvTransform;
4480 vec4 subUVTransform;
4481 } _block;
4482
4483 in vec2 pos;
4484 in vec2 uv;
4485 out vec2 vUV;
4486
4487 vec3 transform3x2(m3x2 t, vec3 v)
4488 {
4489 return vec3(dot(t.r0, v), dot(t.r1, v), dot(vec3(0.0, 0.0, 1.0), v));
4490 }
4491
4492 void main()
4493 {
4494 m3x2 param = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, -1.0, 0.0));
4495 vec3 param_1 = vec3(pos, 1.0);
4496 vec3 p = transform3x2(param, param_1);
4497 gl_Position = vec4(p, 1.0);
4498 m3x2 param_2 = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0));
4499 vec3 param_3 = vec3(uv, 1.0);
4500 vec3 uv3 = transform3x2(param_2, param_3);
4501 vUV = (uv3.xy * _block.subUVTransform.xy) + _block.subUVTransform.zw;
4502 m3x2 param_4 = m3x2(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0));
4503 vec3 param_5 = vec3(vUV, 1.0);
4504 vUV = transform3x2(param_4, param_5).xy;
4505 vUV = (vUV * _block.uvTransform.xy) + _block.uvTransform.zw;
4506 }
4507
4508 `,
4509 HLSL: "DXBCxH\xc4I\xbe\x0f[|\nl\x899\xe0\xb8\xcb?\x01\x00\x00\x00\xdc\x04\x00\x00\x06\x00\x00\x008\x00\x00\x00L\x01\x00\x00\xc4\x02\x00\x00@\x03\x00\x008\x04\x00\x00\x84\x04\x00\x00Aon9\f\x01\x00\x00\f\x01\x00\x00\x00\x02\xfe\xff\xd8\x00\x00\x004\x00\x00\x00\x01\x00$\x00\x00\x000\x00\x00\x000\x00\x00\x00$\x00\x01\x000\x00\x00\x00\x00\x00\x02\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xfe\xffQ\x00\x00\x05\x03\x00\x0f\xa0\x00\x00\x80?\x00\x00\x00\x00\x00\x00\x80\xbf\x00\x00\x00\x00\x1f\x00\x00\x02\x05\x00\x00\x80\x00\x00\x0f\x90\x1f\x00\x00\x02\x05\x00\x01\x80\x01\x00\x0f\x90\x04\x00\x00\x04\x00\x00\x03\x80\x01\x00U\x90\x03\x00\xe4\xa0\x03\x00\xe1\xa0\x05\x00\x00\x03\x00\x00\x03\x80\x00\x00\xe4\x80\x03\x00\xe2\xa0\x02\x00\x00\x03\x00\x00\x02\x80\x00\x00U\x80\x00\x00\x00\x80\x01\x00\x00\x02\x00\x00\x01\x80\x01\x00\x00\x90\x04\x00\x00\x04\x00\x00\x03\x80\x00\x00\xe4\x80\x02\x00\xe4\xa0\x02\x00\xee\xa0\x01\x00\x00\x02\x00\x00\x04\x80\x03\x00\x00\xa0\b\x00\x00\x03\x00\x00\b\x80\x03\x00ɠ\x00\x00\xe4\x80\x04\x00\x00\x04\x00\x00\x03\xe0\x00\x00\xec\x80\x01\x00\xe4\xa0\x01\x00\xee\xa0\x02\x00\x00\x03\x00\x00\x03\xc0\x00\x00\xe4\x90\x00\x00\xe4\xa0\x01\x00\x00\x02\x00\x00\f\xc0\x03\x00\x00\xa0\xff\xff\x00\x00SHDRp\x01\x00\x00@\x00\x01\x00\\\x00\x00\x00Y\x00\x00\x04F\x8e \x00\x00\x00\x00\x00\x02\x00\x00\x00_\x00\x00\x032\x10\x10\x00\x00\x00\x00\x00_\x00\x00\x032\x10\x10\x00\x01\x00\x00\x00e\x00\x00\x032 \x10\x00\x00\x00\x00\x00g\x00\x00\x04\xf2 \x10\x00\x01\x00\x00\x00\x01\x00\x00\x00h\x00\x00\x02\x01\x00\x00\x006\x00\x00\x05\"\x00\x10\x00\x00\x00\x00\x00\x01@\x00\x00\x00\x00\x80?6\x00\x00\x05R\x00\x10\x00\x00\x00\x00\x00V\x14\x10\x00\x01\x00\x00\x00\x0f\x00\x00\n\x82\x00\x10\x00\x00\x00\x00\x00\x02@\x00\x00\x00\x00\x80\xbf\x00\x00\x80?\x00\x00\x00\x00\x00\x00\x00\x00F\x00\x10\x00\x00\x00\x00\x002\x00\x00\v2\x00\x10\x00\x00\x00\x00\x00\xe6\n\x10\x00\x00\x00\x00\x00F\x80 \x00\x00\x00\x00\x00\x01\x00\x00\x00\xe6\x8a \x00\x00\x00\x00\x00\x01\x00\x00\x006\x00\x00\x05B\x00\x10\x00\x00\x00\x00\x00\x01@\x00\x00\x00\x00\x80?\x0f\x00\x00\n\x82\x00\x10\x00\x00\x00\x00\x00\x02@\x00\x00\x00\x00\x80\xbf\x00\x00\x80?\x00\x00\x00\x00\x00\x00\x00\x00\x96\x05\x10\x00\x00\x00\x00\x002\x00\x00\v2 \x10\x00\x00\x00\x00\x00\xc6\x00\x10\x00\x00\x00\x00\x00F\x80 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xe6\x8a \x00\x00\x00\x00\x00\x00\x00\x00\x006\x00\x00\x052 \x10\x00\x01\x00\x00\x00F\x10\x10\x00\x00\x00\x00\x006\x00\x00\b\xc2 \x10\x00\x01\x00\x00\x00\x02@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80?\x00\x00\x80?>\x00\x00\x01STATt\x00\x00\x00\n\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00RDEF\xf0\x00\x00\x00\x01\x00\x00\x00D\x00\x00\x00\x01\x00\x00\x00\x1c\x00\x00\x00\x00\x04\xfe\xff\x00\x01\x00\x00\xc6\x00\x00\x00<\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00Block\x00\xab\xab<\x00\x00\x00\x02\x00\x00\x00\\\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8c\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x02\x00\x00\x00\xa0\x00\x00\x00\x00\x00\x00\x00\xb0\x00\x00\x00\x10\x00\x00\x00\x10\x00\x00\x00\x02\x00\x00\x00\xa0\x00\x00\x00\x00\x00\x00\x00_block_uvTransform\x00\xab\x01\x00\x03\x00\x01\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00_block_subUVTransform\x00Microsoft (R) HLSL Shader Compiler 10.1\x00\xab\xabISGND\x00\x00\x00\x02\x00\x00\x00\b\x00\x00\x008\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x03\x00\x008\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x03\x03\x00\x00TEXCOORD\x00\xab\xab\xabOSGNP\x00\x00\x00\x02\x00\x00\x00\b\x00\x00\x008\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\f\x00\x00A\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x0f\x00\x00\x00TEXCOORD\x00SV_Position\x00\xab\xab\xab",
4510 }
4511 shader_kernel4_comp = driver.ShaderSources{
4512 Name: "kernel4.comp",
4513 GLSL310ES: `#version 310 es
4514 layout(local_size_x = 16, local_size_y = 8, local_size_z = 1) in;
4515
4516 struct Alloc
4517 {
4518 uint offset;
4519 };
4520
4521 struct CmdStrokeRef
4522 {
4523 uint offset;
4524 };
4525
4526 struct CmdStroke
4527 {
4528 uint tile_ref;
4529 float half_width;
4530 };
4531
4532 struct CmdFillRef
4533 {
4534 uint offset;
4535 };
4536
4537 struct CmdFill
4538 {
4539 uint tile_ref;
4540 int backdrop;
4541 };
4542
4543 struct CmdColorRef
4544 {
4545 uint offset;
4546 };
4547
4548 struct CmdColor
4549 {
4550 uint rgba_color;
4551 };
4552
4553 struct CmdImageRef
4554 {
4555 uint offset;
4556 };
4557
4558 struct CmdImage
4559 {
4560 uint index;
4561 ivec2 offset;
4562 };
4563
4564 struct CmdAlphaRef
4565 {
4566 uint offset;
4567 };
4568
4569 struct CmdAlpha
4570 {
4571 float alpha;
4572 };
4573
4574 struct CmdJumpRef
4575 {
4576 uint offset;
4577 };
4578
4579 struct CmdJump
4580 {
4581 uint new_ref;
4582 };
4583
4584 struct CmdRef
4585 {
4586 uint offset;
4587 };
4588
4589 struct CmdTag
4590 {
4591 uint tag;
4592 uint flags;
4593 };
4594
4595 struct TileSegRef
4596 {
4597 uint offset;
4598 };
4599
4600 struct TileSeg
4601 {
4602 vec2 origin;
4603 vec2 vector;
4604 float y_edge;
4605 TileSegRef next;
4606 };
4607
4608 struct Config
4609 {
4610 uint n_elements;
4611 uint n_pathseg;
4612 uint width_in_tiles;
4613 uint height_in_tiles;
4614 Alloc tile_alloc;
4615 Alloc bin_alloc;
4616 Alloc ptcl_alloc;
4617 Alloc pathseg_alloc;
4618 Alloc anno_alloc;
4619 Alloc trans_alloc;
4620 };
4621
4622 layout(binding = 0, std430) buffer Memory
4623 {
4624 uint mem_offset;
4625 uint mem_error;
4626 uint memory[];
4627 } _196;
4628
4629 layout(binding = 1, std430) readonly buffer ConfigBuf
4630 {
4631 Config conf;
4632 } _693;
4633
4634 layout(binding = 3, rgba8) uniform readonly highp image2D images[1];
4635 layout(binding = 2, rgba8) uniform writeonly highp image2D image;
4636
4637 Alloc new_alloc(uint offset, uint size)
4638 {
4639 Alloc a;
4640 a.offset = offset;
4641 return a;
4642 }
4643
4644 Alloc slice_mem(Alloc a, uint offset, uint size)
4645 {
4646 uint param = a.offset + offset;
4647 uint param_1 = size;
4648 return new_alloc(param, param_1);
4649 }
4650
4651 bool touch_mem(Alloc alloc, uint offset)
4652 {
4653 return true;
4654 }
4655
4656 uint read_mem(Alloc alloc, uint offset)
4657 {
4658 Alloc param = alloc;
4659 uint param_1 = offset;
4660 if (!touch_mem(param, param_1))
4661 {
4662 return 0u;
4663 }
4664 uint v = _196.memory[offset];
4665 return v;
4666 }
4667
4668 Alloc alloc_read(Alloc a, uint offset)
4669 {
4670 Alloc param = a;
4671 uint param_1 = offset >> uint(2);
4672 Alloc alloc;
4673 alloc.offset = read_mem(param, param_1);
4674 return alloc;
4675 }
4676
4677 CmdTag Cmd_tag(Alloc a, CmdRef ref)
4678 {
4679 Alloc param = a;
4680 uint param_1 = ref.offset >> uint(2);
4681 uint tag_and_flags = read_mem(param, param_1);
4682 return CmdTag(tag_and_flags & 65535u, tag_and_flags >> uint(16));
4683 }
4684
4685 CmdStroke CmdStroke_read(Alloc a, CmdStrokeRef ref)
4686 {
4687 uint ix = ref.offset >> uint(2);
4688 Alloc param = a;
4689 uint param_1 = ix + 0u;
4690 uint raw0 = read_mem(param, param_1);
4691 Alloc param_2 = a;
4692 uint param_3 = ix + 1u;
4693 uint raw1 = read_mem(param_2, param_3);
4694 CmdStroke s;
4695 s.tile_ref = raw0;
4696 s.half_width = uintBitsToFloat(raw1);
4697 return s;
4698 }
4699
4700 CmdStroke Cmd_Stroke_read(Alloc a, CmdRef ref)
4701 {
4702 Alloc param = a;
4703 CmdStrokeRef param_1 = CmdStrokeRef(ref.offset + 4u);
4704 return CmdStroke_read(param, param_1);
4705 }
4706
4707 TileSeg TileSeg_read(Alloc a, TileSegRef ref)
4708 {
4709 uint ix = ref.offset >> uint(2);
4710 Alloc param = a;
4711 uint param_1 = ix + 0u;
4712 uint raw0 = read_mem(param, param_1);
4713 Alloc param_2 = a;
4714 uint param_3 = ix + 1u;
4715 uint raw1 = read_mem(param_2, param_3);
4716 Alloc param_4 = a;
4717 uint param_5 = ix + 2u;
4718 uint raw2 = read_mem(param_4, param_5);
4719 Alloc param_6 = a;
4720 uint param_7 = ix + 3u;
4721 uint raw3 = read_mem(param_6, param_7);
4722 Alloc param_8 = a;
4723 uint param_9 = ix + 4u;
4724 uint raw4 = read_mem(param_8, param_9);
4725 Alloc param_10 = a;
4726 uint param_11 = ix + 5u;
4727 uint raw5 = read_mem(param_10, param_11);
4728 TileSeg s;
4729 s.origin = vec2(uintBitsToFloat(raw0), uintBitsToFloat(raw1));
4730 s.vector = vec2(uintBitsToFloat(raw2), uintBitsToFloat(raw3));
4731 s.y_edge = uintBitsToFloat(raw4);
4732 s.next = TileSegRef(raw5);
4733 return s;
4734 }
4735
4736 uvec2 chunk_offset(uint i)
4737 {
4738 return uvec2((i % 2u) * 16u, (i / 2u) * 8u);
4739 }
4740
4741 CmdFill CmdFill_read(Alloc a, CmdFillRef ref)
4742 {
4743 uint ix = ref.offset >> uint(2);
4744 Alloc param = a;
4745 uint param_1 = ix + 0u;
4746 uint raw0 = read_mem(param, param_1);
4747 Alloc param_2 = a;
4748 uint param_3 = ix + 1u;
4749 uint raw1 = read_mem(param_2, param_3);
4750 CmdFill s;
4751 s.tile_ref = raw0;
4752 s.backdrop = int(raw1);
4753 return s;
4754 }
4755
4756 CmdFill Cmd_Fill_read(Alloc a, CmdRef ref)
4757 {
4758 Alloc param = a;
4759 CmdFillRef param_1 = CmdFillRef(ref.offset + 4u);
4760 return CmdFill_read(param, param_1);
4761 }
4762
4763 CmdAlpha CmdAlpha_read(Alloc a, CmdAlphaRef ref)
4764 {
4765 uint ix = ref.offset >> uint(2);
4766 Alloc param = a;
4767 uint param_1 = ix + 0u;
4768 uint raw0 = read_mem(param, param_1);
4769 CmdAlpha s;
4770 s.alpha = uintBitsToFloat(raw0);
4771 return s;
4772 }
4773
4774 CmdAlpha Cmd_Alpha_read(Alloc a, CmdRef ref)
4775 {
4776 Alloc param = a;
4777 CmdAlphaRef param_1 = CmdAlphaRef(ref.offset + 4u);
4778 return CmdAlpha_read(param, param_1);
4779 }
4780
4781 CmdColor CmdColor_read(Alloc a, CmdColorRef ref)
4782 {
4783 uint ix = ref.offset >> uint(2);
4784 Alloc param = a;
4785 uint param_1 = ix + 0u;
4786 uint raw0 = read_mem(param, param_1);
4787 CmdColor s;
4788 s.rgba_color = raw0;
4789 return s;
4790 }
4791
4792 CmdColor Cmd_Color_read(Alloc a, CmdRef ref)
4793 {
4794 Alloc param = a;
4795 CmdColorRef param_1 = CmdColorRef(ref.offset + 4u);
4796 return CmdColor_read(param, param_1);
4797 }
4798
4799 vec3 fromsRGB(vec3 srgb)
4800 {
4801 bvec3 cutoff = greaterThanEqual(srgb, vec3(0.040449999272823333740234375));
4802 vec3 below = srgb / vec3(12.9200000762939453125);
4803 vec3 above = pow((srgb + vec3(0.054999999701976776123046875)) / vec3(1.05499994754791259765625), vec3(2.400000095367431640625));
4804 return mix(below, above, cutoff);
4805 }
4806
4807 vec4 unpacksRGB(uint srgba)
4808 {
4809 vec4 color = unpackUnorm4x8(srgba).wzyx;
4810 vec3 param = color.xyz;
4811 return vec4(fromsRGB(param), color.w);
4812 }
4813
4814 CmdImage CmdImage_read(Alloc a, CmdImageRef ref)
4815 {
4816 uint ix = ref.offset >> uint(2);
4817 Alloc param = a;
4818 uint param_1 = ix + 0u;
4819 uint raw0 = read_mem(param, param_1);
4820 Alloc param_2 = a;
4821 uint param_3 = ix + 1u;
4822 uint raw1 = read_mem(param_2, param_3);
4823 CmdImage s;
4824 s.index = raw0;
4825 s.offset = ivec2(int(raw1 << uint(16)) >> 16, int(raw1) >> 16);
4826 return s;
4827 }
4828
4829 CmdImage Cmd_Image_read(Alloc a, CmdRef ref)
4830 {
4831 Alloc param = a;
4832 CmdImageRef param_1 = CmdImageRef(ref.offset + 4u);
4833 return CmdImage_read(param, param_1);
4834 }
4835
4836 vec4[8] fillImage(uvec2 xy, CmdImage cmd_img)
4837 {
4838 vec4 rgba[8];
4839 for (uint i = 0u; i < 8u; i++)
4840 {
4841 uint param = i;
4842 ivec2 uv = ivec2(xy + chunk_offset(param)) + cmd_img.offset;
4843 vec4 fg_rgba = imageLoad(images[0], uv);
4844 vec3 param_1 = fg_rgba.xyz;
4845 vec3 _663 = fromsRGB(param_1);
4846 fg_rgba = vec4(_663.x, _663.y, _663.z, fg_rgba.w);
4847 rgba[i] = fg_rgba;
4848 }
4849 return rgba;
4850 }
4851
4852 vec3 tosRGB(vec3 rgb)
4853 {
4854 bvec3 cutoff = greaterThanEqual(rgb, vec3(0.003130800090730190277099609375));
4855 vec3 below = vec3(12.9200000762939453125) * rgb;
4856 vec3 above = (vec3(1.05499994754791259765625) * pow(rgb, vec3(0.416660010814666748046875))) - vec3(0.054999999701976776123046875);
4857 return mix(below, above, cutoff);
4858 }
4859
4860 uint packsRGB(inout vec4 rgba)
4861 {
4862 vec3 param = rgba.xyz;
4863 rgba = vec4(tosRGB(param), rgba.w);
4864 return packUnorm4x8(rgba.wzyx);
4865 }
4866
4867 void write_mem(Alloc alloc, uint offset, uint val)
4868 {
4869 Alloc param = alloc;
4870 uint param_1 = offset;
4871 if (!touch_mem(param, param_1))
4872 {
4873 return;
4874 }
4875 _196.memory[offset] = val;
4876 }
4877
4878 CmdJump CmdJump_read(Alloc a, CmdJumpRef ref)
4879 {
4880 uint ix = ref.offset >> uint(2);
4881 Alloc param = a;
4882 uint param_1 = ix + 0u;
4883 uint raw0 = read_mem(param, param_1);
4884 CmdJump s;
4885 s.new_ref = raw0;
4886 return s;
4887 }
4888
4889 CmdJump Cmd_Jump_read(Alloc a, CmdRef ref)
4890 {
4891 Alloc param = a;
4892 CmdJumpRef param_1 = CmdJumpRef(ref.offset + 4u);
4893 return CmdJump_read(param, param_1);
4894 }
4895
4896 void main()
4897 {
4898 if (_196.mem_error != 0u)
4899 {
4900 return;
4901 }
4902 uint tile_ix = (gl_WorkGroupID.y * _693.conf.width_in_tiles) + gl_WorkGroupID.x;
4903 Alloc param;
4904 param.offset = _693.conf.ptcl_alloc.offset;
4905 uint param_1 = tile_ix * 1024u;
4906 uint param_2 = 1024u;
4907 Alloc cmd_alloc = slice_mem(param, param_1, param_2);
4908 CmdRef cmd_ref = CmdRef(cmd_alloc.offset);
4909 Alloc param_3 = cmd_alloc;
4910 uint param_4 = cmd_ref.offset;
4911 Alloc scratch_alloc = alloc_read(param_3, param_4);
4912 cmd_ref.offset += 8u;
4913 uvec2 xy_uint = uvec2(gl_LocalInvocationID.x + (32u * gl_WorkGroupID.x), gl_LocalInvocationID.y + (32u * gl_WorkGroupID.y));
4914 vec2 xy = vec2(xy_uint);
4915 vec4 rgba[8];
4916 for (uint i = 0u; i < 8u; i++)
4917 {
4918 rgba[i] = vec4(0.0);
4919 }
4920 uint clip_depth = 0u;
4921 float df[8];
4922 TileSegRef tile_seg_ref;
4923 float area[8];
4924 uint base_ix;
4925 while (true)
4926 {
4927 Alloc param_5 = cmd_alloc;
4928 CmdRef param_6 = cmd_ref;
4929 uint tag = Cmd_tag(param_5, param_6).tag;
4930 if (tag == 0u)
4931 {
4932 break;
4933 }
4934 switch (tag)
4935 {
4936 case 2u:
4937 {
4938 Alloc param_7 = cmd_alloc;
4939 CmdRef param_8 = cmd_ref;
4940 CmdStroke stroke = Cmd_Stroke_read(param_7, param_8);
4941 for (uint k = 0u; k < 8u; k++)
4942 {
4943 df[k] = 1000000000.0;
4944 }
4945 tile_seg_ref = TileSegRef(stroke.tile_ref);
4946 do
4947 {
4948 uint param_9 = tile_seg_ref.offset;
4949 uint param_10 = 24u;
4950 Alloc param_11 = new_alloc(param_9, param_10);
4951 TileSegRef param_12 = tile_seg_ref;
4952 TileSeg seg = TileSeg_read(param_11, param_12);
4953 vec2 line_vec = seg.vector;
4954 for (uint k_1 = 0u; k_1 < 8u; k_1++)
4955 {
4956 vec2 dpos = (xy + vec2(0.5)) - seg.origin;
4957 uint param_13 = k_1;
4958 dpos += vec2(chunk_offset(param_13));
4959 float t = clamp(dot(line_vec, dpos) / dot(line_vec, line_vec), 0.0, 1.0);
4960 df[k_1] = min(df[k_1], length((line_vec * t) - dpos));
4961 }
4962 tile_seg_ref = seg.next;
4963 } while (tile_seg_ref.offset != 0u);
4964 for (uint k_2 = 0u; k_2 < 8u; k_2++)
4965 {
4966 area[k_2] = clamp((stroke.half_width + 0.5) - df[k_2], 0.0, 1.0);
4967 }
4968 cmd_ref.offset += 12u;
4969 break;
4970 }
4971 case 1u:
4972 {
4973 Alloc param_14 = cmd_alloc;
4974 CmdRef param_15 = cmd_ref;
4975 CmdFill fill = Cmd_Fill_read(param_14, param_15);
4976 for (uint k_3 = 0u; k_3 < 8u; k_3++)
4977 {
4978 area[k_3] = float(fill.backdrop);
4979 }
4980 tile_seg_ref = TileSegRef(fill.tile_ref);
4981 do
4982 {
4983 uint param_16 = tile_seg_ref.offset;
4984 uint param_17 = 24u;
4985 Alloc param_18 = new_alloc(param_16, param_17);
4986 TileSegRef param_19 = tile_seg_ref;
4987 TileSeg seg_1 = TileSeg_read(param_18, param_19);
4988 for (uint k_4 = 0u; k_4 < 8u; k_4++)
4989 {
4990 uint param_20 = k_4;
4991 vec2 my_xy = xy + vec2(chunk_offset(param_20));
4992 vec2 start = seg_1.origin - my_xy;
4993 vec2 end = start + seg_1.vector;
4994 vec2 window = clamp(vec2(start.y, end.y), vec2(0.0), vec2(1.0));
4995 if (!(window.x == window.y))
4996 {
4997 vec2 t_1 = (window - vec2(start.y)) / vec2(seg_1.vector.y);
4998 vec2 xs = vec2(mix(start.x, end.x, t_1.x), mix(start.x, end.x, t_1.y));
4999 float xmin = min(min(xs.x, xs.y), 1.0) - 9.9999999747524270787835121154785e-07;
5000 float xmax = max(xs.x, xs.y);
5001 float b = min(xmax, 1.0);
5002 float c = max(b, 0.0);
5003 float d = max(xmin, 0.0);
5004 float a = ((b + (0.5 * ((d * d) - (c * c)))) - xmin) / (xmax - xmin);
5005 area[k_4] += (a * (window.x - window.y));
5006 }
5007 area[k_4] += (sign(seg_1.vector.x) * clamp((my_xy.y - seg_1.y_edge) + 1.0, 0.0, 1.0));
5008 }
5009 tile_seg_ref = seg_1.next;
5010 } while (tile_seg_ref.offset != 0u);
5011 for (uint k_5 = 0u; k_5 < 8u; k_5++)
5012 {
5013 area[k_5] = min(abs(area[k_5]), 1.0);
5014 }
5015 cmd_ref.offset += 12u;
5016 break;
5017 }
5018 case 3u:
5019 {
5020 for (uint k_6 = 0u; k_6 < 8u; k_6++)
5021 {
5022 area[k_6] = 1.0;
5023 }
5024 cmd_ref.offset += 4u;
5025 break;
5026 }
5027 case 4u:
5028 {
5029 Alloc param_21 = cmd_alloc;
5030 CmdRef param_22 = cmd_ref;
5031 CmdAlpha alpha = Cmd_Alpha_read(param_21, param_22);
5032 for (uint k_7 = 0u; k_7 < 8u; k_7++)
5033 {
5034 area[k_7] = alpha.alpha;
5035 }
5036 cmd_ref.offset += 8u;
5037 break;
5038 }
5039 case 5u:
5040 {
5041 Alloc param_23 = cmd_alloc;
5042 CmdRef param_24 = cmd_ref;
5043 CmdColor color = Cmd_Color_read(param_23, param_24);
5044 uint param_25 = color.rgba_color;
5045 vec4 fg = unpacksRGB(param_25);
5046 for (uint k_8 = 0u; k_8 < 8u; k_8++)
5047 {
5048 vec4 fg_k = fg * area[k_8];
5049 rgba[k_8] = (rgba[k_8] * (1.0 - fg_k.w)) + fg_k;
5050 }
5051 cmd_ref.offset += 8u;
5052 break;
5053 }
5054 case 6u:
5055 {
5056 Alloc param_26 = cmd_alloc;
5057 CmdRef param_27 = cmd_ref;
5058 CmdImage fill_img = Cmd_Image_read(param_26, param_27);
5059 uvec2 param_28 = xy_uint;
5060 CmdImage param_29 = fill_img;
5061 vec4 img[8] = fillImage(param_28, param_29);
5062 for (uint k_9 = 0u; k_9 < 8u; k_9++)
5063 {
5064 vec4 fg_k_1 = img[k_9] * area[k_9];
5065 rgba[k_9] = (rgba[k_9] * (1.0 - fg_k_1.w)) + fg_k_1;
5066 }
5067 cmd_ref.offset += 12u;
5068 break;
5069 }
5070 case 7u:
5071 {
5072 base_ix = (scratch_alloc.offset >> uint(2)) + (2u * ((((clip_depth * 32u) * 32u) + gl_LocalInvocationID.x) + (32u * gl_LocalInvocationID.y)));
5073 for (uint k_10 = 0u; k_10 < 8u; k_10++)
5074 {
5075 uint param_30 = k_10;
5076 uvec2 offset = chunk_offset(param_30);
5077 vec4 param_31 = vec4(rgba[k_10]);
5078 uint _1286 = packsRGB(param_31);
5079 uint srgb = _1286;
5080 float alpha_1 = clamp(abs(area[k_10]), 0.0, 1.0);
5081 Alloc param_32 = scratch_alloc;
5082 uint param_33 = (base_ix + 0u) + (2u * (offset.x + (offset.y * 32u)));
5083 uint param_34 = srgb;
5084 write_mem(param_32, param_33, param_34);
5085 Alloc param_35 = scratch_alloc;
5086 uint param_36 = (base_ix + 1u) + (2u * (offset.x + (offset.y * 32u)));
5087 uint param_37 = floatBitsToUint(alpha_1);
5088 write_mem(param_35, param_36, param_37);
5089 rgba[k_10] = vec4(0.0);
5090 }
5091 clip_depth++;
5092 cmd_ref.offset += 4u;
5093 break;
5094 }
5095 case 8u:
5096 {
5097 clip_depth--;
5098 base_ix = (scratch_alloc.offset >> uint(2)) + (2u * ((((clip_depth * 32u) * 32u) + gl_LocalInvocationID.x) + (32u * gl_LocalInvocationID.y)));
5099 for (uint k_11 = 0u; k_11 < 8u; k_11++)
5100 {
5101 uint param_38 = k_11;
5102 uvec2 offset_1 = chunk_offset(param_38);
5103 Alloc param_39 = scratch_alloc;
5104 uint param_40 = (base_ix + 0u) + (2u * (offset_1.x + (offset_1.y * 32u)));
5105 uint srgb_1 = read_mem(param_39, param_40);
5106 Alloc param_41 = scratch_alloc;
5107 uint param_42 = (base_ix + 1u) + (2u * (offset_1.x + (offset_1.y * 32u)));
5108 uint alpha_2 = read_mem(param_41, param_42);
5109 uint param_43 = srgb_1;
5110 vec4 bg = unpacksRGB(param_43);
5111 vec4 fg_1 = (rgba[k_11] * area[k_11]) * uintBitsToFloat(alpha_2);
5112 rgba[k_11] = (bg * (1.0 - fg_1.w)) + fg_1;
5113 }
5114 cmd_ref.offset += 4u;
5115 break;
5116 }
5117 case 9u:
5118 {
5119 Alloc param_44 = cmd_alloc;
5120 CmdRef param_45 = cmd_ref;
5121 cmd_ref = CmdRef(Cmd_Jump_read(param_44, param_45).new_ref);
5122 cmd_alloc.offset = cmd_ref.offset;
5123 break;
5124 }
5125 }
5126 }
5127 for (uint i_1 = 0u; i_1 < 8u; i_1++)
5128 {
5129 uint param_46 = i_1;
5130 vec3 param_47 = rgba[i_1].xyz;
5131 imageStore(image, ivec2(xy_uint + chunk_offset(param_46)), vec4(tosRGB(param_47), rgba[i_1].w));
5132 }
5133 }
5134
5135 `,
5136 }
5137 shader_material_frag = driver.ShaderSources{
5138 Name: "material.frag",
5139 Inputs: []driver.InputLocation{{Name: "vUV", Location: 0, Semantic: "TEXCOORD", SemanticIndex: 0, Type: 0x0, Size: 2}},
5140 Textures: []driver.TextureBinding{{Name: "tex", Binding: 0}},
5141 GLSL100ES: `#version 100
5142 precision mediump float;
5143 precision highp int;
5144
5145 uniform mediump sampler2D tex;
5146
5147 varying vec2 vUV;
5148
5149 vec3 RGBtosRGB(vec3 rgb)
5150 {
5151 bvec3 cutoff = greaterThanEqual(rgb, vec3(0.003130800090730190277099609375));
5152 vec3 below = vec3(12.9200000762939453125) * rgb;
5153 vec3 above = (vec3(1.05499994754791259765625) * pow(rgb, vec3(0.416660010814666748046875))) - vec3(0.054999999701976776123046875);
5154 return vec3(cutoff.x ? above.x : below.x, cutoff.y ? above.y : below.y, cutoff.z ? above.z : below.z);
5155 }
5156
5157 void main()
5158 {
5159 vec4 texel = texture2D(tex, vUV);
5160 vec3 param = texel.xyz;
5161 vec3 _59 = RGBtosRGB(param);
5162 texel = vec4(_59.x, _59.y, _59.z, texel.w);
5163 gl_FragData[0] = texel;
5164 }
5165
5166 `,
5167 GLSL300ES: `#version 300 es
5168 precision mediump float;
5169 precision highp int;
5170
5171 uniform mediump sampler2D tex;
5172
5173 in vec2 vUV;
5174 layout(location = 0) out vec4 fragColor;
5175
5176 vec3 RGBtosRGB(vec3 rgb)
5177 {
5178 bvec3 cutoff = greaterThanEqual(rgb, vec3(0.003130800090730190277099609375));
5179 vec3 below = vec3(12.9200000762939453125) * rgb;
5180 vec3 above = (vec3(1.05499994754791259765625) * pow(rgb, vec3(0.416660010814666748046875))) - vec3(0.054999999701976776123046875);
5181 return vec3(cutoff.x ? above.x : below.x, cutoff.y ? above.y : below.y, cutoff.z ? above.z : below.z);
5182 }
5183
5184 void main()
5185 {
5186 vec4 texel = texture(tex, vUV);
5187 vec3 param = texel.xyz;
5188 vec3 _59 = RGBtosRGB(param);
5189 texel = vec4(_59.x, _59.y, _59.z, texel.w);
5190 fragColor = texel;
5191 }
5192
5193 `,
5194 GLSL130: `#version 130
5195 #ifdef GL_ARB_shading_language_420pack
5196 #extension GL_ARB_shading_language_420pack : require
5197 #endif
5198
5199 layout(binding = 0) uniform sampler2D tex;
5200
5201 in vec2 vUV;
5202 out vec4 fragColor;
5203
5204 vec3 RGBtosRGB(vec3 rgb)
5205 {
5206 bvec3 cutoff = greaterThanEqual(rgb, vec3(0.003130800090730190277099609375));
5207 vec3 below = vec3(12.9200000762939453125) * rgb;
5208 vec3 above = (vec3(1.05499994754791259765625) * pow(rgb, vec3(0.416660010814666748046875))) - vec3(0.054999999701976776123046875);
5209 return vec3(cutoff.x ? above.x : below.x, cutoff.y ? above.y : below.y, cutoff.z ? above.z : below.z);
5210 }
5211
5212 void main()
5213 {
5214 vec4 texel = texture(tex, vUV);
5215 vec3 param = texel.xyz;
5216 vec3 _59 = RGBtosRGB(param);
5217 texel = vec4(_59.x, _59.y, _59.z, texel.w);
5218 fragColor = texel;
5219 }
5220
5221 `,
5222 GLSL150: `#version 150
5223 #ifdef GL_ARB_shading_language_420pack
5224 #extension GL_ARB_shading_language_420pack : require
5225 #endif
5226
5227 layout(binding = 0) uniform sampler2D tex;
5228
5229 in vec2 vUV;
5230 out vec4 fragColor;
5231
5232 vec3 RGBtosRGB(vec3 rgb)
5233 {
5234 bvec3 cutoff = greaterThanEqual(rgb, vec3(0.003130800090730190277099609375));
5235 vec3 below = vec3(12.9200000762939453125) * rgb;
5236 vec3 above = (vec3(1.05499994754791259765625) * pow(rgb, vec3(0.416660010814666748046875))) - vec3(0.054999999701976776123046875);
5237 return vec3(cutoff.x ? above.x : below.x, cutoff.y ? above.y : below.y, cutoff.z ? above.z : below.z);
5238 }
5239
5240 void main()
5241 {
5242 vec4 texel = texture(tex, vUV);
5243 vec3 param = texel.xyz;
5244 vec3 _59 = RGBtosRGB(param);
5245 texel = vec4(_59.x, _59.y, _59.z, texel.w);
5246 fragColor = texel;
5247 }
5248
5249 `,
5250 HLSL: "DXBC\x9e\x87LD\xf3\x17\n\x06\\\xb7\x98\x94\xa9PKe\x01\x00\x00\x00\xc8\x04\x00\x00\x06\x00\x00\x008\x00\x00\x00\xbc\x01\x00\x00D\x03\x00\x00\xc0\x03\x00\x00`\x04\x00\x00\x94\x04\x00\x00Aon9|\x01\x00\x00|\x01\x00\x00\x00\x02\xff\xffT\x01\x00\x00(\x00\x00\x00\x00\x00(\x00\x00\x00(\x00\x00\x00(\x00\x01\x00$\x00\x00\x00(\x00\x00\x00\x00\x00\x00\x02\xff\xffQ\x00\x00\x05\x00\x00\x0f\xa0=\n\x87?\xaeGa\xbd\x00\x00\x00\x00\x00\x00\x00\x00Q\x00\x00\x05\x01\x00\x0f\xa0\x1c.M\xbbR\xb8NAvT\xd5>\x00\x00\x00\x00\x1f\x00\x00\x02\x00\x00\x00\x80\x00\x00\x03\xb0\x1f\x00\x00\x02\x00\x00\x00\x90\x00\b\x0f\xa0B\x00\x00\x03\x00\x00\x0f\x80\x00\x00\xe4\xb0\x00\b\xe4\xa0\x0f\x00\x00\x02\x01\x00\x01\x80\x00\x00\x00\x80\x0f\x00\x00\x02\x01\x00\x02\x80\x00\x00U\x80\x0f\x00\x00\x02\x01\x00\x04\x80\x00\x00\xaa\x80\x05\x00\x00\x03\x01\x00\a\x80\x01\x00\xe4\x80\x01\x00\xaa\xa0\x0e\x00\x00\x02\x02\x00\x01\x80\x01\x00\x00\x80\x0e\x00\x00\x02\x02\x00\x02\x80\x01\x00U\x80\x0e\x00\x00\x02\x02\x00\x04\x80\x01\x00\xaa\x80\x04\x00\x00\x04\x01\x00\a\x80\x02\x00\xe4\x80\x00\x00\x00\xa0\x00\x00U\xa0\x02\x00\x00\x03\x01\x00\b\x80\x00\x00\x00\x80\x01\x00\x00\xa0\x05\x00\x00\x03\x02\x00\a\x80\x00\x00\xe4\x80\x01\x00U\xa0X\x00\x00\x04\x00\x00\x01\x80\x01\x00\xff\x80\x01\x00\x00\x80\x02\x00\x00\x80\x02\x00\x00\x03\x01\x00\x01\x80\x00\x00U\x80\x01\x00\x00\xa0X\x00\x00\x04\x00\x00\x02\x80\x01\x00\x00\x80\x01\x00U\x80\x02\x00U\x80\x02\x00\x00\x03\x01\x00\x01\x80\x00\x00\xaa\x80\x01\x00\x00\xa0X\x00\x00\x04\x00\x00\x04\x80\x01\x00\x00\x80\x01\x00\xaa\x80\x02\x00\xaa\x80\x01\x00\x00\x02\x00\b\x0f\x80\x00\x00\xe4\x80\xff\xff\x00\x00SHDR\x80\x01\x00\x00@\x00\x00\x00`\x00\x00\x00Z\x00\x00\x03\x00`\x10\x00\x00\x00\x00\x00X\x18\x00\x04\x00p\x10\x00\x00\x00\x00\x00UU\x00\x00b\x10\x00\x032\x10\x10\x00\x00\x00\x00\x00e\x00\x00\x03\xf2 \x10\x00\x00\x00\x00\x00h\x00\x00\x02\x03\x00\x00\x00E\x00\x00\t\xf2\x00\x10\x00\x00\x00\x00\x00F\x10\x10\x00\x00\x00\x00\x00F~\x10\x00\x00\x00\x00\x00\x00`\x10\x00\x00\x00\x00\x00/\x00\x00\x05r\x00\x10\x00\x01\x00\x00\x00F\x02\x10\x00\x00\x00\x00\x008\x00\x00\nr\x00\x10\x00\x01\x00\x00\x00F\x02\x10\x00\x01\x00\x00\x00\x02@\x00\x00vT\xd5>vT\xd5>vT\xd5>\x00\x00\x00\x00\x19\x00\x00\x05r\x00\x10\x00\x01\x00\x00\x00F\x02\x10\x00\x01\x00\x00\x002\x00\x00\x0fr\x00\x10\x00\x01\x00\x00\x00F\x02\x10\x00\x01\x00\x00\x00\x02@\x00\x00=\n\x87?=\n\x87?=\n\x87?\x00\x00\x00\x00\x02@\x00\x00\xaeGa\xbd\xaeGa\xbd\xaeGa\xbd\x00\x00\x00\x00\x1d\x00\x00\nr\x00\x10\x00\x02\x00\x00\x00F\x02\x10\x00\x00\x00\x00\x00\x02@\x00\x00\x1c.M;\x1c.M;\x1c.M;\x00\x00\x00\x008\x00\x00\nr\x00\x10\x00\x00\x00\x00\x00F\x02\x10\x00\x00\x00\x00\x00\x02@\x00\x00R\xb8NAR\xb8NAR\xb8NA\x00\x00\x00\x006\x00\x00\x05\x82 \x10\x00\x00\x00\x00\x00:\x00\x10\x00\x00\x00\x00\x007\x00\x00\tr \x10\x00\x00\x00\x00\x00F\x02\x10\x00\x02\x00\x00\x00F\x02\x10\x00\x01\x00\x00\x00F\x02\x10\x00\x00\x00\x00\x00>\x00\x00\x01STATt\x00\x00\x00\n\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00RDEF\x98\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x1c\x00\x00\x00\x00\x04\xff\xff\x00\x01\x00\x00m\x00\x00\x00\\\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00i\x00\x00\x00\x02\x00\x00\x00\x05\x00\x00\x00\x04\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x01\x00\x00\x00\r\x00\x00\x00_tex_sampler\x00tex\x00Microsoft (R) HLSL Shader Compiler 10.1\x00\xab\xab\xabISGN,\x00\x00\x00\x01\x00\x00\x00\b\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x03\x00\x00TEXCOORD\x00\xab\xab\xabOSGN,\x00\x00\x00\x01\x00\x00\x00\b\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00SV_Target\x00\xab\xab",
5251 }
5252 shader_material_vert = driver.ShaderSources{
5253 Name: "material.vert",
5254 Inputs: []driver.InputLocation{{Name: "pos", Location: 0, Semantic: "TEXCOORD", SemanticIndex: 0, Type: 0x0, Size: 2}, {Name: "uv", Location: 1, Semantic: "TEXCOORD", SemanticIndex: 1, Type: 0x0, Size: 2}},
5255 GLSL100ES: `#version 100
5256
5257 varying vec2 vUV;
5258 attribute vec2 uv;
5259 attribute vec2 pos;
5260
5261 void main()
5262 {
5263 vUV = uv;
5264 gl_Position = vec4(pos, 0.0, 1.0);
5265 }
5266
5267 `,
5268 GLSL300ES: `#version 300 es
5269
5270 out vec2 vUV;
5271 layout(location = 1) in vec2 uv;
5272 layout(location = 0) in vec2 pos;
5273
5274 void main()
5275 {
5276 vUV = uv;
5277 gl_Position = vec4(pos, 0.0, 1.0);
5278 }
5279
5280 `,
5281 GLSL130: `#version 130
5282 #ifdef GL_ARB_shading_language_420pack
5283 #extension GL_ARB_shading_language_420pack : require
5284 #endif
5285
5286 out vec2 vUV;
5287 in vec2 uv;
5288 in vec2 pos;
5289
5290 void main()
5291 {
5292 vUV = uv;
5293 gl_Position = vec4(pos, 0.0, 1.0);
5294 }
5295
5296 `,
5297 GLSL150: `#version 150
5298 #ifdef GL_ARB_shading_language_420pack
5299 #extension GL_ARB_shading_language_420pack : require
5300 #endif
5301
5302 out vec2 vUV;
5303 in vec2 uv;
5304 in vec2 pos;
5305
5306 void main()
5307 {
5308 vUV = uv;
5309 gl_Position = vec4(pos, 0.0, 1.0);
5310 }
5311
5312 `,
5313 HLSL: "DXBCg\xc0\xae\x16\xd8\xe1\xbdl~ń\xf1\xc4\xf6dV\x01\x00\x00\x00\xc4\x02\x00\x00\x06\x00\x00\x008\x00\x00\x00\xc8\x00\x00\x00X\x01\x00\x00\xd4\x01\x00\x00 \x02\x00\x00l\x02\x00\x00Aon9\x88\x00\x00\x00\x88\x00\x00\x00\x00\x02\xfe\xff`\x00\x00\x00(\x00\x00\x00\x00\x00$\x00\x00\x00$\x00\x00\x00$\x00\x00\x00$\x00\x01\x00$\x00\x00\x00\x00\x00\x00\x02\xfe\xffQ\x00\x00\x05\x01\x00\x0f\xa0\x00\x00\x00\x00\x00\x00\x80?\x00\x00\x00\x00\x00\x00\x00\x00\x1f\x00\x00\x02\x05\x00\x00\x80\x00\x00\x0f\x90\x1f\x00\x00\x02\x05\x00\x01\x80\x01\x00\x0f\x90\x02\x00\x00\x03\x00\x00\x03\xc0\x00\x00\xe4\x90\x00\x00\xe4\xa0\x01\x00\x00\x02\x00\x00\x03\xe0\x01\x00\xe4\x90\x01\x00\x00\x02\x00\x00\f\xc0\x01\x00D\xa0\xff\xff\x00\x00SHDR\x88\x00\x00\x00@\x00\x01\x00\"\x00\x00\x00_\x00\x00\x032\x10\x10\x00\x00\x00\x00\x00_\x00\x00\x032\x10\x10\x00\x01\x00\x00\x00e\x00\x00\x032 \x10\x00\x00\x00\x00\x00g\x00\x00\x04\xf2 \x10\x00\x01\x00\x00\x00\x01\x00\x00\x006\x00\x00\x052 \x10\x00\x00\x00\x00\x00F\x10\x10\x00\x01\x00\x00\x006\x00\x00\x052 \x10\x00\x01\x00\x00\x00F\x10\x10\x00\x00\x00\x00\x006\x00\x00\b\xc2 \x10\x00\x01\x00\x00\x00\x02@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80?>\x00\x00\x01STATt\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00RDEFD\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x00\x00\x00\x00\x04\xfe\xff\x00\x01\x00\x00\x1c\x00\x00\x00Microsoft (R) HLSL Shader Compiler 10.1\x00ISGND\x00\x00\x00\x02\x00\x00\x00\b\x00\x00\x008\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x03\x00\x008\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x03\x03\x00\x00TEXCOORD\x00\xab\xab\xabOSGNP\x00\x00\x00\x02\x00\x00\x00\b\x00\x00\x008\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\f\x00\x00A\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x0f\x00\x00\x00TEXCOORD\x00SV_Position\x00\xab\xab\xab",
5314 }
5315 shader_path_coarse_comp = driver.ShaderSources{
5316 Name: "path_coarse.comp",
5317 GLSL310ES: `#version 310 es
5318 layout(local_size_x = 32, local_size_y = 1, local_size_z = 1) in;
5319
5320 struct Alloc
5321 {
5322 uint offset;
5323 };
5324
5325 struct MallocResult
5326 {
5327 Alloc alloc;
5328 bool failed;
5329 };
5330
5331 struct PathCubicRef
5332 {
5333 uint offset;
5334 };
5335
5336 struct PathCubic
5337 {
5338 vec2 p0;
5339 vec2 p1;
5340 vec2 p2;
5341 vec2 p3;
5342 uint path_ix;
5343 uint trans_ix;
5344 vec2 stroke;
5345 };
5346
5347 struct PathSegRef
5348 {
5349 uint offset;
5350 };
5351
5352 struct PathSegTag
5353 {
5354 uint tag;
5355 uint flags;
5356 };
5357
5358 struct TileRef
5359 {
5360 uint offset;
5361 };
5362
5363 struct PathRef
5364 {
5365 uint offset;
5366 };
5367
5368 struct Path
5369 {
5370 uvec4 bbox;
5371 TileRef tiles;
5372 };
5373
5374 struct TileSegRef
5375 {
5376 uint offset;
5377 };
5378
5379 struct TileSeg
5380 {
5381 vec2 origin;
5382 vec2 vector;
5383 float y_edge;
5384 TileSegRef next;
5385 };
5386
5387 struct TransformSegRef
5388 {
5389 uint offset;
5390 };
5391
5392 struct TransformSeg
5393 {
5394 vec4 mat;
5395 vec2 translate;
5396 };
5397
5398 struct SubdivResult
5399 {
5400 float val;
5401 float a0;
5402 float a2;
5403 };
5404
5405 struct Config
5406 {
5407 uint n_elements;
5408 uint n_pathseg;
5409 uint width_in_tiles;
5410 uint height_in_tiles;
5411 Alloc tile_alloc;
5412 Alloc bin_alloc;
5413 Alloc ptcl_alloc;
5414 Alloc pathseg_alloc;
5415 Alloc anno_alloc;
5416 Alloc trans_alloc;
5417 };
5418
5419 layout(binding = 0, std430) buffer Memory
5420 {
5421 uint mem_offset;
5422 uint mem_error;
5423 uint memory[];
5424 } _149;
5425
5426 layout(binding = 1, std430) readonly buffer ConfigBuf
5427 {
5428 Config conf;
5429 } _788;
5430
5431 bool touch_mem(Alloc alloc, uint offset)
5432 {
5433 return true;
5434 }
5435
5436 uint read_mem(Alloc alloc, uint offset)
5437 {
5438 Alloc param = alloc;
5439 uint param_1 = offset;
5440 if (!touch_mem(param, param_1))
5441 {
5442 return 0u;
5443 }
5444 uint v = _149.memory[offset];
5445 return v;
5446 }
5447
5448 PathSegTag PathSeg_tag(Alloc a, PathSegRef ref)
5449 {
5450 Alloc param = a;
5451 uint param_1 = ref.offset >> uint(2);
5452 uint tag_and_flags = read_mem(param, param_1);
5453 return PathSegTag(tag_and_flags & 65535u, tag_and_flags >> uint(16));
5454 }
5455
5456 PathCubic PathCubic_read(Alloc a, PathCubicRef ref)
5457 {
5458 uint ix = ref.offset >> uint(2);
5459 Alloc param = a;
5460 uint param_1 = ix + 0u;
5461 uint raw0 = read_mem(param, param_1);
5462 Alloc param_2 = a;
5463 uint param_3 = ix + 1u;
5464 uint raw1 = read_mem(param_2, param_3);
5465 Alloc param_4 = a;
5466 uint param_5 = ix + 2u;
5467 uint raw2 = read_mem(param_4, param_5);
5468 Alloc param_6 = a;
5469 uint param_7 = ix + 3u;
5470 uint raw3 = read_mem(param_6, param_7);
5471 Alloc param_8 = a;
5472 uint param_9 = ix + 4u;
5473 uint raw4 = read_mem(param_8, param_9);
5474 Alloc param_10 = a;
5475 uint param_11 = ix + 5u;
5476 uint raw5 = read_mem(param_10, param_11);
5477 Alloc param_12 = a;
5478 uint param_13 = ix + 6u;
5479 uint raw6 = read_mem(param_12, param_13);
5480 Alloc param_14 = a;
5481 uint param_15 = ix + 7u;
5482 uint raw7 = read_mem(param_14, param_15);
5483 Alloc param_16 = a;
5484 uint param_17 = ix + 8u;
5485 uint raw8 = read_mem(param_16, param_17);
5486 Alloc param_18 = a;
5487 uint param_19 = ix + 9u;
5488 uint raw9 = read_mem(param_18, param_19);
5489 Alloc param_20 = a;
5490 uint param_21 = ix + 10u;
5491 uint raw10 = read_mem(param_20, param_21);
5492 Alloc param_22 = a;
5493 uint param_23 = ix + 11u;
5494 uint raw11 = read_mem(param_22, param_23);
5495 PathCubic s;
5496 s.p0 = vec2(uintBitsToFloat(raw0), uintBitsToFloat(raw1));
5497 s.p1 = vec2(uintBitsToFloat(raw2), uintBitsToFloat(raw3));
5498 s.p2 = vec2(uintBitsToFloat(raw4), uintBitsToFloat(raw5));
5499 s.p3 = vec2(uintBitsToFloat(raw6), uintBitsToFloat(raw7));
5500 s.path_ix = raw8;
5501 s.trans_ix = raw9;
5502 s.stroke = vec2(uintBitsToFloat(raw10), uintBitsToFloat(raw11));
5503 return s;
5504 }
5505
5506 PathCubic PathSeg_Cubic_read(Alloc a, PathSegRef ref)
5507 {
5508 Alloc param = a;
5509 PathCubicRef param_1 = PathCubicRef(ref.offset + 4u);
5510 return PathCubic_read(param, param_1);
5511 }
5512
5513 TransformSeg TransformSeg_read(Alloc a, TransformSegRef ref)
5514 {
5515 uint ix = ref.offset >> uint(2);
5516 Alloc param = a;
5517 uint param_1 = ix + 0u;
5518 uint raw0 = read_mem(param, param_1);
5519 Alloc param_2 = a;
5520 uint param_3 = ix + 1u;
5521 uint raw1 = read_mem(param_2, param_3);
5522 Alloc param_4 = a;
5523 uint param_5 = ix + 2u;
5524 uint raw2 = read_mem(param_4, param_5);
5525 Alloc param_6 = a;
5526 uint param_7 = ix + 3u;
5527 uint raw3 = read_mem(param_6, param_7);
5528 Alloc param_8 = a;
5529 uint param_9 = ix + 4u;
5530 uint raw4 = read_mem(param_8, param_9);
5531 Alloc param_10 = a;
5532 uint param_11 = ix + 5u;
5533 uint raw5 = read_mem(param_10, param_11);
5534 TransformSeg s;
5535 s.mat = vec4(uintBitsToFloat(raw0), uintBitsToFloat(raw1), uintBitsToFloat(raw2), uintBitsToFloat(raw3));
5536 s.translate = vec2(uintBitsToFloat(raw4), uintBitsToFloat(raw5));
5537 return s;
5538 }
5539
5540 vec2 eval_cubic(vec2 p0, vec2 p1, vec2 p2, vec2 p3, float t)
5541 {
5542 float mt = 1.0 - t;
5543 return (p0 * ((mt * mt) * mt)) + (((p1 * ((mt * mt) * 3.0)) + (((p2 * (mt * 3.0)) + (p3 * t)) * t)) * t);
5544 }
5545
5546 float approx_parabola_integral(float x)
5547 {
5548 return x * inversesqrt(sqrt(0.3300000131130218505859375 + (0.201511204242706298828125 + ((0.25 * x) * x))));
5549 }
5550
5551 SubdivResult estimate_subdiv(vec2 p0, vec2 p1, vec2 p2, float sqrt_tol)
5552 {
5553 vec2 d01 = p1 - p0;
5554 vec2 d12 = p2 - p1;
5555 vec2 dd = d01 - d12;
5556 float _cross = ((p2.x - p0.x) * dd.y) - ((p2.y - p0.y) * dd.x);
5557 float x0 = ((d01.x * dd.x) + (d01.y * dd.y)) / _cross;
5558 float x2 = ((d12.x * dd.x) + (d12.y * dd.y)) / _cross;
5559 float scale = abs(_cross / (length(dd) * (x2 - x0)));
5560 float param = x0;
5561 float a0 = approx_parabola_integral(param);
5562 float param_1 = x2;
5563 float a2 = approx_parabola_integral(param_1);
5564 float val = 0.0;
5565 if (scale < 1000000000.0)
5566 {
5567 float da = abs(a2 - a0);
5568 float sqrt_scale = sqrt(scale);
5569 if (sign(x0) == sign(x2))
5570 {
5571 val = da * sqrt_scale;
5572 }
5573 else
5574 {
5575 float xmin = sqrt_tol / sqrt_scale;
5576 float param_2 = xmin;
5577 val = (sqrt_tol * da) / approx_parabola_integral(param_2);
5578 }
5579 }
5580 return SubdivResult(val, a0, a2);
5581 }
5582
5583 uint fill_mode_from_flags(uint flags)
5584 {
5585 return flags & 1u;
5586 }
5587
5588 Path Path_read(Alloc a, PathRef ref)
5589 {
5590 uint ix = ref.offset >> uint(2);
5591 Alloc param = a;
5592 uint param_1 = ix + 0u;
5593 uint raw0 = read_mem(param, param_1);
5594 Alloc param_2 = a;
5595 uint param_3 = ix + 1u;
5596 uint raw1 = read_mem(param_2, param_3);
5597 Alloc param_4 = a;
5598 uint param_5 = ix + 2u;
5599 uint raw2 = read_mem(param_4, param_5);
5600 Path s;
5601 s.bbox = uvec4(raw0 & 65535u, raw0 >> uint(16), raw1 & 65535u, raw1 >> uint(16));
5602 s.tiles = TileRef(raw2);
5603 return s;
5604 }
5605
5606 Alloc new_alloc(uint offset, uint size)
5607 {
5608 Alloc a;
5609 a.offset = offset;
5610 return a;
5611 }
5612
5613 float approx_parabola_inv_integral(float x)
5614 {
5615 return x * sqrt(0.61000001430511474609375 + (0.1520999968051910400390625 + ((0.25 * x) * x)));
5616 }
5617
5618 vec2 eval_quad(vec2 p0, vec2 p1, vec2 p2, float t)
5619 {
5620 float mt = 1.0 - t;
5621 return (p0 * (mt * mt)) + (((p1 * (mt * 2.0)) + (p2 * t)) * t);
5622 }
5623
5624 MallocResult malloc(uint size)
5625 {
5626 MallocResult r;
5627 r.failed = false;
5628 uint _155 = atomicAdd(_149.mem_offset, size);
5629 uint offset = _155;
5630 uint param = offset;
5631 uint param_1 = size;
5632 r.alloc = new_alloc(param, param_1);
5633 if ((offset + size) > uint(int(uint(_149.memory.length())) * 4))
5634 {
5635 r.failed = true;
5636 uint _176 = atomicMax(_149.mem_error, 1u);
5637 return r;
5638 }
5639 return r;
5640 }
5641
5642 TileRef Tile_index(TileRef ref, uint index)
5643 {
5644 return TileRef(ref.offset + (index * 8u));
5645 }
5646
5647 void write_mem(Alloc alloc, uint offset, uint val)
5648 {
5649 Alloc param = alloc;
5650 uint param_1 = offset;
5651 if (!touch_mem(param, param_1))
5652 {
5653 return;
5654 }
5655 _149.memory[offset] = val;
5656 }
5657
5658 void TileSeg_write(Alloc a, TileSegRef ref, TileSeg s)
5659 {
5660 uint ix = ref.offset >> uint(2);
5661 Alloc param = a;
5662 uint param_1 = ix + 0u;
5663 uint param_2 = floatBitsToUint(s.origin.x);
5664 write_mem(param, param_1, param_2);
5665 Alloc param_3 = a;
5666 uint param_4 = ix + 1u;
5667 uint param_5 = floatBitsToUint(s.origin.y);
5668 write_mem(param_3, param_4, param_5);
5669 Alloc param_6 = a;
5670 uint param_7 = ix + 2u;
5671 uint param_8 = floatBitsToUint(s.vector.x);
5672 write_mem(param_6, param_7, param_8);
5673 Alloc param_9 = a;
5674 uint param_10 = ix + 3u;
5675 uint param_11 = floatBitsToUint(s.vector.y);
5676 write_mem(param_9, param_10, param_11);
5677 Alloc param_12 = a;
5678 uint param_13 = ix + 4u;
5679 uint param_14 = floatBitsToUint(s.y_edge);
5680 write_mem(param_12, param_13, param_14);
5681 Alloc param_15 = a;
5682 uint param_16 = ix + 5u;
5683 uint param_17 = s.next.offset;
5684 write_mem(param_15, param_16, param_17);
5685 }
5686
5687 void main()
5688 {
5689 if (_149.mem_error != 0u)
5690 {
5691 return;
5692 }
5693 uint element_ix = gl_GlobalInvocationID.x;
5694 PathSegRef ref = PathSegRef(_788.conf.pathseg_alloc.offset + (element_ix * 52u));
5695 PathSegTag tag = PathSegTag(0u, 0u);
5696 if (element_ix < _788.conf.n_pathseg)
5697 {
5698 Alloc param;
5699 param.offset = _788.conf.pathseg_alloc.offset;
5700 PathSegRef param_1 = ref;
5701 tag = PathSeg_tag(param, param_1);
5702 }
5703 switch (tag.tag)
5704 {
5705 case 1u:
5706 {
5707 Alloc param_2;
5708 param_2.offset = _788.conf.pathseg_alloc.offset;
5709 PathSegRef param_3 = ref;
5710 PathCubic cubic = PathSeg_Cubic_read(param_2, param_3);
5711 uint trans_ix = cubic.trans_ix;
5712 if (trans_ix > 0u)
5713 {
5714 TransformSegRef trans_ref = TransformSegRef(_788.conf.trans_alloc.offset + ((trans_ix - 1u) * 24u));
5715 Alloc param_4;
5716 param_4.offset = _788.conf.trans_alloc.offset;
5717 TransformSegRef param_5 = trans_ref;
5718 TransformSeg trans = TransformSeg_read(param_4, param_5);
5719 cubic.p0 = ((trans.mat.xy * cubic.p0.x) + (trans.mat.zw * cubic.p0.y)) + trans.translate;
5720 cubic.p1 = ((trans.mat.xy * cubic.p1.x) + (trans.mat.zw * cubic.p1.y)) + trans.translate;
5721 cubic.p2 = ((trans.mat.xy * cubic.p2.x) + (trans.mat.zw * cubic.p2.y)) + trans.translate;
5722 cubic.p3 = ((trans.mat.xy * cubic.p3.x) + (trans.mat.zw * cubic.p3.y)) + trans.translate;
5723 }
5724 vec2 err_v = (((cubic.p2 - cubic.p1) * 3.0) + cubic.p0) - cubic.p3;
5725 float err = (err_v.x * err_v.x) + (err_v.y * err_v.y);
5726 uint n_quads = max(uint(ceil(pow(err * 3.7037036418914794921875, 0.16666667163372039794921875))), 1u);
5727 float val = 0.0;
5728 vec2 qp0 = cubic.p0;
5729 float _step = 1.0 / float(n_quads);
5730 for (uint i = 0u; i < n_quads; i++)
5731 {
5732 float t = float(i + 1u) * _step;
5733 vec2 param_6 = cubic.p0;
5734 vec2 param_7 = cubic.p1;
5735 vec2 param_8 = cubic.p2;
5736 vec2 param_9 = cubic.p3;
5737 float param_10 = t;
5738 vec2 qp2 = eval_cubic(param_6, param_7, param_8, param_9, param_10);
5739 vec2 param_11 = cubic.p0;
5740 vec2 param_12 = cubic.p1;
5741 vec2 param_13 = cubic.p2;
5742 vec2 param_14 = cubic.p3;
5743 float param_15 = t - (0.5 * _step);
5744 vec2 qp1 = eval_cubic(param_11, param_12, param_13, param_14, param_15);
5745 qp1 = (qp1 * 2.0) - ((qp0 + qp2) * 0.5);
5746 vec2 param_16 = qp0;
5747 vec2 param_17 = qp1;
5748 vec2 param_18 = qp2;
5749 float param_19 = 0.4743416607379913330078125;
5750 SubdivResult params = estimate_subdiv(param_16, param_17, param_18, param_19);
5751 val += params.val;
5752 qp0 = qp2;
5753 }
5754 uint n = max(uint(ceil((val * 0.5) / 0.4743416607379913330078125)), 1u);
5755 uint param_20 = tag.flags;
5756 bool is_stroke = fill_mode_from_flags(param_20) == 1u;
5757 uint path_ix = cubic.path_ix;
5758 Alloc param_21;
5759 param_21.offset = _788.conf.tile_alloc.offset;
5760 PathRef param_22 = PathRef(_788.conf.tile_alloc.offset + (path_ix * 12u));
5761 Path path = Path_read(param_21, param_22);
5762 uint param_23 = path.tiles.offset;
5763 uint param_24 = ((path.bbox.z - path.bbox.x) * (path.bbox.w - path.bbox.y)) * 8u;
5764 Alloc path_alloc = new_alloc(param_23, param_24);
5765 ivec4 bbox = ivec4(path.bbox);
5766 vec2 p0 = cubic.p0;
5767 qp0 = cubic.p0;
5768 float v_step = val / float(n);
5769 int n_out = 1;
5770 float val_sum = 0.0;
5771 vec2 p1;
5772 float _1309;
5773 TileSeg tile_seg;
5774 for (uint i_1 = 0u; i_1 < n_quads; i_1++)
5775 {
5776 float t_1 = float(i_1 + 1u) * _step;
5777 vec2 param_25 = cubic.p0;
5778 vec2 param_26 = cubic.p1;
5779 vec2 param_27 = cubic.p2;
5780 vec2 param_28 = cubic.p3;
5781 float param_29 = t_1;
5782 vec2 qp2_1 = eval_cubic(param_25, param_26, param_27, param_28, param_29);
5783 vec2 param_30 = cubic.p0;
5784 vec2 param_31 = cubic.p1;
5785 vec2 param_32 = cubic.p2;
5786 vec2 param_33 = cubic.p3;
5787 float param_34 = t_1 - (0.5 * _step);
5788 vec2 qp1_1 = eval_cubic(param_30, param_31, param_32, param_33, param_34);
5789 qp1_1 = (qp1_1 * 2.0) - ((qp0 + qp2_1) * 0.5);
5790 vec2 param_35 = qp0;
5791 vec2 param_36 = qp1_1;
5792 vec2 param_37 = qp2_1;
5793 float param_38 = 0.4743416607379913330078125;
5794 SubdivResult params_1 = estimate_subdiv(param_35, param_36, param_37, param_38);
5795 float param_39 = params_1.a0;
5796 float u0 = approx_parabola_inv_integral(param_39);
5797 float param_40 = params_1.a2;
5798 float u2 = approx_parabola_inv_integral(param_40);
5799 float uscale = 1.0 / (u2 - u0);
5800 float target = float(n_out) * v_step;
5801 for (;;)
5802 {
5803 bool _1202 = uint(n_out) == n;
5804 bool _1212;
5805 if (!_1202)
5806 {
5807 _1212 = target < (val_sum + params_1.val);
5808 }
5809 else
5810 {
5811 _1212 = _1202;
5812 }
5813 if (_1212)
5814 {
5815 if (uint(n_out) == n)
5816 {
5817 p1 = cubic.p3;
5818 }
5819 else
5820 {
5821 float u = (target - val_sum) / params_1.val;
5822 float a = mix(params_1.a0, params_1.a2, u);
5823 float param_41 = a;
5824 float au = approx_parabola_inv_integral(param_41);
5825 float t_2 = (au - u0) * uscale;
5826 vec2 param_42 = qp0;
5827 vec2 param_43 = qp1_1;
5828 vec2 param_44 = qp2_1;
5829 float param_45 = t_2;
5830 p1 = eval_quad(param_42, param_43, param_44, param_45);
5831 }
5832 float xmin = min(p0.x, p1.x) - cubic.stroke.x;
5833 float xmax = max(p0.x, p1.x) + cubic.stroke.x;
5834 float ymin = min(p0.y, p1.y) - cubic.stroke.y;
5835 float ymax = max(p0.y, p1.y) + cubic.stroke.y;
5836 float dx = p1.x - p0.x;
5837 float dy = p1.y - p0.y;
5838 if (abs(dy) < 9.999999717180685365747194737196e-10)
5839 {
5840 _1309 = 1000000000.0;
5841 }
5842 else
5843 {
5844 _1309 = dx / dy;
5845 }
5846 float invslope = _1309;
5847 float c = (cubic.stroke.x + (abs(invslope) * (16.0 + cubic.stroke.y))) * 0.03125;
5848 float b = invslope;
5849 float a_1 = (p0.x - ((p0.y - 16.0) * b)) * 0.03125;
5850 int x0 = int(floor(xmin * 0.03125));
5851 int x1 = int(floor(xmax * 0.03125) + 1.0);
5852 int y0 = int(floor(ymin * 0.03125));
5853 int y1 = int(floor(ymax * 0.03125) + 1.0);
5854 x0 = clamp(x0, bbox.x, bbox.z);
5855 y0 = clamp(y0, bbox.y, bbox.w);
5856 x1 = clamp(x1, bbox.x, bbox.z);
5857 y1 = clamp(y1, bbox.y, bbox.w);
5858 float xc = a_1 + (b * float(y0));
5859 int stride = bbox.z - bbox.x;
5860 int base = ((y0 - bbox.y) * stride) - bbox.x;
5861 uint n_tile_alloc = uint((x1 - x0) * (y1 - y0));
5862 uint param_46 = n_tile_alloc * 24u;
5863 MallocResult _1424 = malloc(param_46);
5864 MallocResult tile_alloc = _1424;
5865 if (tile_alloc.failed)
5866 {
5867 return;
5868 }
5869 uint tile_offset = tile_alloc.alloc.offset;
5870 int xray = int(floor(p0.x * 0.03125));
5871 int last_xray = int(floor(p1.x * 0.03125));
5872 if (p0.y > p1.y)
5873 {
5874 int tmp = xray;
5875 xray = last_xray;
5876 last_xray = tmp;
5877 }
5878 for (int y = y0; y < y1; y++)
5879 {
5880 float tile_y0 = float(y * 32);
5881 int xbackdrop = max((xray + 1), bbox.x);
5882 bool _1478 = !is_stroke;
5883 bool _1488;
5884 if (_1478)
5885 {
5886 _1488 = min(p0.y, p1.y) < tile_y0;
5887 }
5888 else
5889 {
5890 _1488 = _1478;
5891 }
5892 bool _1495;
5893 if (_1488)
5894 {
5895 _1495 = xbackdrop < bbox.z;
5896 }
5897 else
5898 {
5899 _1495 = _1488;
5900 }
5901 if (_1495)
5902 {
5903 int backdrop = (p1.y < p0.y) ? 1 : (-1);
5904 TileRef param_47 = path.tiles;
5905 uint param_48 = uint(base + xbackdrop);
5906 TileRef tile_ref = Tile_index(param_47, param_48);
5907 uint tile_el = tile_ref.offset >> uint(2);
5908 Alloc param_49 = path_alloc;
5909 uint param_50 = tile_el + 1u;
5910 if (touch_mem(param_49, param_50))
5911 {
5912 uint _1533 = atomicAdd(_149.memory[tile_el + 1u], uint(backdrop));
5913 }
5914 }
5915 int next_xray = last_xray;
5916 if (y < (y1 - 1))
5917 {
5918 float tile_y1 = float((y + 1) * 32);
5919 float x_edge = mix(p0.x, p1.x, (tile_y1 - p0.y) / dy);
5920 next_xray = int(floor(x_edge * 0.03125));
5921 }
5922 int min_xray = min(xray, next_xray);
5923 int max_xray = max(xray, next_xray);
5924 int xx0 = min(int(floor(xc - c)), min_xray);
5925 int xx1 = max(int(ceil(xc + c)), (max_xray + 1));
5926 xx0 = clamp(xx0, x0, x1);
5927 xx1 = clamp(xx1, x0, x1);
5928 for (int x = xx0; x < xx1; x++)
5929 {
5930 float tile_x0 = float(x * 32);
5931 TileRef param_51 = TileRef(path.tiles.offset);
5932 uint param_52 = uint(base + x);
5933 TileRef tile_ref_1 = Tile_index(param_51, param_52);
5934 uint tile_el_1 = tile_ref_1.offset >> uint(2);
5935 uint old = 0u;
5936 Alloc param_53 = path_alloc;
5937 uint param_54 = tile_el_1;
5938 if (touch_mem(param_53, param_54))
5939 {
5940 uint _1636 = atomicExchange(_149.memory[tile_el_1], tile_offset);
5941 old = _1636;
5942 }
5943 tile_seg.origin = p0;
5944 tile_seg.vector = p1 - p0;
5945 float y_edge = 0.0;
5946 if (!is_stroke)
5947 {
5948 y_edge = mix(p0.y, p1.y, (tile_x0 - p0.x) / dx);
5949 if (min(p0.x, p1.x) < tile_x0)
5950 {
5951 vec2 p = vec2(tile_x0, y_edge);
5952 if (p0.x > p1.x)
5953 {
5954 tile_seg.vector = p - p0;
5955 }
5956 else
5957 {
5958 tile_seg.origin = p;
5959 tile_seg.vector = p1 - p;
5960 }
5961 if (tile_seg.vector.x == 0.0)
5962 {
5963 tile_seg.vector.x = sign(p1.x - p0.x) * 9.999999717180685365747194737196e-10;
5964 }
5965 }
5966 if ((x <= min_xray) || (max_xray < x))
5967 {
5968 y_edge = 1000000000.0;
5969 }
5970 }
5971 tile_seg.y_edge = y_edge;
5972 tile_seg.next.offset = old;
5973 Alloc param_55 = tile_alloc.alloc;
5974 TileSegRef param_56 = TileSegRef(tile_offset);
5975 TileSeg param_57 = tile_seg;
5976 TileSeg_write(param_55, param_56, param_57);
5977 tile_offset += 24u;
5978 }
5979 xc += b;
5980 base += stride;
5981 xray = next_xray;
5982 }
5983 n_out++;
5984 target += v_step;
5985 p0 = p1;
5986 continue;
5987 }
5988 else
5989 {
5990 break;
5991 }
5992 }
5993 val_sum += params_1.val;
5994 qp0 = qp2_1;
5995 }
5996 break;
5997 }
5998 }
5999 }
6000
6001 `,
6002 }
6003 shader_stencil_frag = driver.ShaderSources{
6004 Name: "stencil.frag",
6005 Inputs: []driver.InputLocation{{Name: "vFrom", Location: 0, Semantic: "TEXCOORD", SemanticIndex: 0, Type: 0x0, Size: 2}, {Name: "vCtrl", Location: 1, Semantic: "TEXCOORD", SemanticIndex: 1, Type: 0x0, Size: 2}, {Name: "vTo", Location: 2, Semantic: "TEXCOORD", SemanticIndex: 2, Type: 0x0, Size: 2}},
6006 GLSL100ES: `#version 100
6007 precision mediump float;
6008 precision highp int;
6009
6010 varying vec2 vTo;
6011 varying vec2 vFrom;
6012 varying vec2 vCtrl;
6013
6014 void main()
6015 {
6016 float dx = vTo.x - vFrom.x;
6017 bool increasing = vTo.x >= vFrom.x;
6018 bvec2 _35 = bvec2(increasing);
6019 vec2 left = vec2(_35.x ? vFrom.x : vTo.x, _35.y ? vFrom.y : vTo.y);
6020 bvec2 _41 = bvec2(increasing);
6021 vec2 right = vec2(_41.x ? vTo.x : vFrom.x, _41.y ? vTo.y : vFrom.y);
6022 vec2 extent = clamp(vec2(vFrom.x, vTo.x), vec2(-0.5), vec2(0.5));
6023 float midx = mix(extent.x, extent.y, 0.5);
6024 float x0 = midx - left.x;
6025 vec2 p1 = vCtrl - left;
6026 vec2 v = right - vCtrl;
6027 float t = x0 / (p1.x + sqrt((p1.x * p1.x) + ((v.x - p1.x) * x0)));
6028 float y = mix(mix(left.y, vCtrl.y, t), mix(vCtrl.y, right.y, t), t);
6029 vec2 d_half = mix(p1, v, vec2(t));
6030 float dy = d_half.y / d_half.x;
6031 float width = extent.y - extent.x;
6032 dy = abs(dy * width);
6033 vec4 sides = vec4((dy * 0.5) + y, (dy * (-0.5)) + y, (0.5 - y) / dy, ((-0.5) - y) / dy);
6034 sides = clamp(sides + vec4(0.5), vec4(0.0), vec4(1.0));
6035 float area = 0.5 * ((((sides.z - (sides.z * sides.y)) + 1.0) - sides.x) + (sides.x * sides.w));
6036 area *= width;
6037 if (width == 0.0)
6038 {
6039 area = 0.0;
6040 }
6041 gl_FragData[0].x = area;
6042 }
6043
6044 `,
6045 GLSL300ES: `#version 300 es
6046 precision mediump float;
6047 precision highp int;
6048
6049 in vec2 vTo;
6050 in vec2 vFrom;
6051 in vec2 vCtrl;
6052 layout(location = 0) out vec4 fragCover;
6053
6054 void main()
6055 {
6056 float dx = vTo.x - vFrom.x;
6057 bool increasing = vTo.x >= vFrom.x;
6058 bvec2 _35 = bvec2(increasing);
6059 vec2 left = vec2(_35.x ? vFrom.x : vTo.x, _35.y ? vFrom.y : vTo.y);
6060 bvec2 _41 = bvec2(increasing);
6061 vec2 right = vec2(_41.x ? vTo.x : vFrom.x, _41.y ? vTo.y : vFrom.y);
6062 vec2 extent = clamp(vec2(vFrom.x, vTo.x), vec2(-0.5), vec2(0.5));
6063 float midx = mix(extent.x, extent.y, 0.5);
6064 float x0 = midx - left.x;
6065 vec2 p1 = vCtrl - left;
6066 vec2 v = right - vCtrl;
6067 float t = x0 / (p1.x + sqrt((p1.x * p1.x) + ((v.x - p1.x) * x0)));
6068 float y = mix(mix(left.y, vCtrl.y, t), mix(vCtrl.y, right.y, t), t);
6069 vec2 d_half = mix(p1, v, vec2(t));
6070 float dy = d_half.y / d_half.x;
6071 float width = extent.y - extent.x;
6072 dy = abs(dy * width);
6073 vec4 sides = vec4((dy * 0.5) + y, (dy * (-0.5)) + y, (0.5 - y) / dy, ((-0.5) - y) / dy);
6074 sides = clamp(sides + vec4(0.5), vec4(0.0), vec4(1.0));
6075 float area = 0.5 * ((((sides.z - (sides.z * sides.y)) + 1.0) - sides.x) + (sides.x * sides.w));
6076 area *= width;
6077 if (width == 0.0)
6078 {
6079 area = 0.0;
6080 }
6081 fragCover.x = area;
6082 }
6083
6084 `,
6085 GLSL130: `#version 130
6086 #ifdef GL_ARB_shading_language_420pack
6087 #extension GL_ARB_shading_language_420pack : require
6088 #endif
6089
6090 in vec2 vTo;
6091 in vec2 vFrom;
6092 in vec2 vCtrl;
6093 out vec4 fragCover;
6094
6095 void main()
6096 {
6097 float dx = vTo.x - vFrom.x;
6098 bool increasing = vTo.x >= vFrom.x;
6099 bvec2 _35 = bvec2(increasing);
6100 vec2 left = vec2(_35.x ? vFrom.x : vTo.x, _35.y ? vFrom.y : vTo.y);
6101 bvec2 _41 = bvec2(increasing);
6102 vec2 right = vec2(_41.x ? vTo.x : vFrom.x, _41.y ? vTo.y : vFrom.y);
6103 vec2 extent = clamp(vec2(vFrom.x, vTo.x), vec2(-0.5), vec2(0.5));
6104 float midx = mix(extent.x, extent.y, 0.5);
6105 float x0 = midx - left.x;
6106 vec2 p1 = vCtrl - left;
6107 vec2 v = right - vCtrl;
6108 float t = x0 / (p1.x + sqrt((p1.x * p1.x) + ((v.x - p1.x) * x0)));
6109 float y = mix(mix(left.y, vCtrl.y, t), mix(vCtrl.y, right.y, t), t);
6110 vec2 d_half = mix(p1, v, vec2(t));
6111 float dy = d_half.y / d_half.x;
6112 float width = extent.y - extent.x;
6113 dy = abs(dy * width);
6114 vec4 sides = vec4((dy * 0.5) + y, (dy * (-0.5)) + y, (0.5 - y) / dy, ((-0.5) - y) / dy);
6115 sides = clamp(sides + vec4(0.5), vec4(0.0), vec4(1.0));
6116 float area = 0.5 * ((((sides.z - (sides.z * sides.y)) + 1.0) - sides.x) + (sides.x * sides.w));
6117 area *= width;
6118 if (width == 0.0)
6119 {
6120 area = 0.0;
6121 }
6122 fragCover.x = area;
6123 }
6124
6125 `,
6126 GLSL150: `#version 150
6127 #ifdef GL_ARB_shading_language_420pack
6128 #extension GL_ARB_shading_language_420pack : require
6129 #endif
6130
6131 in vec2 vTo;
6132 in vec2 vFrom;
6133 in vec2 vCtrl;
6134 out vec4 fragCover;
6135
6136 void main()
6137 {
6138 float dx = vTo.x - vFrom.x;
6139 bool increasing = vTo.x >= vFrom.x;
6140 bvec2 _35 = bvec2(increasing);
6141 vec2 left = vec2(_35.x ? vFrom.x : vTo.x, _35.y ? vFrom.y : vTo.y);
6142 bvec2 _41 = bvec2(increasing);
6143 vec2 right = vec2(_41.x ? vTo.x : vFrom.x, _41.y ? vTo.y : vFrom.y);
6144 vec2 extent = clamp(vec2(vFrom.x, vTo.x), vec2(-0.5), vec2(0.5));
6145 float midx = mix(extent.x, extent.y, 0.5);
6146 float x0 = midx - left.x;
6147 vec2 p1 = vCtrl - left;
6148 vec2 v = right - vCtrl;
6149 float t = x0 / (p1.x + sqrt((p1.x * p1.x) + ((v.x - p1.x) * x0)));
6150 float y = mix(mix(left.y, vCtrl.y, t), mix(vCtrl.y, right.y, t), t);
6151 vec2 d_half = mix(p1, v, vec2(t));
6152 float dy = d_half.y / d_half.x;
6153 float width = extent.y - extent.x;
6154 dy = abs(dy * width);
6155 vec4 sides = vec4((dy * 0.5) + y, (dy * (-0.5)) + y, (0.5 - y) / dy, ((-0.5) - y) / dy);
6156 sides = clamp(sides + vec4(0.5), vec4(0.0), vec4(1.0));
6157 float area = 0.5 * ((((sides.z - (sides.z * sides.y)) + 1.0) - sides.x) + (sides.x * sides.w));
6158 area *= width;
6159 if (width == 0.0)
6160 {
6161 area = 0.0;
6162 }
6163 fragCover.x = area;
6164 }
6165
6166 `,
6167 HLSL: "DXBC\x94!\xb9\x13L\xba\r\x11\x8f\xc7\xce\x0eAs\xec\xe1\x01\x00\x00\x00\\\n\x00\x00\x06\x00\x00\x008\x00\x00\x00\x9c\x03\x00\x00\xfc\b\x00\x00x\t\x00\x00\xc4\t\x00\x00(\n\x00\x00Aon9\\\x03\x00\x00\\\x03\x00\x00\x00\x02\xff\xff8\x03\x00\x00$\x00\x00\x00\x00\x00$\x00\x00\x00$\x00\x00\x00$\x00\x00\x00$\x00\x00\x00$\x00\x00\x02\xff\xffQ\x00\x00\x05\x00\x00\x0f\xa0\x00\x00\x00\xbf\x00\x00\x00?\x00\x00\x80?\x00\x00\x00\x00\x1f\x00\x00\x02\x00\x00\x00\x80\x00\x00\x0f\xb0\x1f\x00\x00\x02\x00\x00\x00\x80\x01\x00\x03\xb0\v\x00\x00\x03\x00\x00\x01\x80\x00\x00\x00\xb0\x00\x00\x00\xa0\v\x00\x00\x03\x00\x00\x02\x80\x01\x00\x00\xb0\x00\x00\x00\xa0\n\x00\x00\x03\x01\x00\x03\x80\x00\x00\xe4\x80\x00\x00U\xa0\x02\x00\x00\x03\x00\x00\x01\x80\x01\x00\x00\x81\x01\x00U\x80\x04\x00\x00\x04\x00\x00\x02\x80\x00\x00\x00\x80\x00\x00U\xa0\x01\x00\x00\x80\x01\x00\x00\x02\x01\x00\x03\x80\x00\x00\xe4\xb0\n\x00\x00\x03\x02\x00\x01\x80\x01\x00\x00\x80\x01\x00\x00\xb0\x02\x00\x00\x03\x00\x00\x02\x80\x00\x00U\x80\x02\x00\x00\x81\v\x00\x00\x03\x03\x00\x01\x80\x01\x00\x00\xb0\x01\x00\x00\x80\x02\x00\x00\x03\x00\x00\x04\x80\x01\x00\x00\x81\x01\x00\x00\xb0X\x00\x00\x04\x03\x00\x02\x80\x00\x00\xaa\x80\x01\x00U\xb0\x01\x00U\x80X\x00\x00\x04\x02\x00\x02\x80\x00\x00\xaa\x80\x01\x00U\x80\x01\x00U\xb0\x02\x00\x00\x03\x00\x00\f\x80\x03\x00\x1b\x80\x00\x00\xe4\xb1\x02\x00\x00\x03\x01\x00\x03\x80\x02\x00\xe4\x81\x00\x00\x1b\xb0\x02\x00\x00\x03\x01\x00\x04\x80\x00\x00\xff\x80\x01\x00\x00\x81\x05\x00\x00\x03\x01\x00\x04\x80\x00\x00U\x80\x01\x00\xaa\x80\x04\x00\x00\x04\x01\x00\x04\x80\x01\x00\x00\x80\x01\x00\x00\x80\x01\x00\xaa\x80\a\x00\x00\x02\x01\x00\x04\x80\x01\x00\xaa\x80\x06\x00\x00\x02\x01\x00\x04\x80\x01\x00\xaa\x80\x02\x00\x00\x03\x01\x00\x04\x80\x01\x00\xaa\x80\x01\x00\x00\x80\x06\x00\x00\x02\x01\x00\x04\x80\x01\x00\xaa\x80\x05\x00\x00\x03\x00\x00\x02\x80\x00\x00U\x80\x01\x00\xaa\x80\x04\x00\x00\x04\x01\x00\x04\x80\x00\x00U\x80\x01\x00U\x80\x02\x00U\x80\x12\x00\x00\x04\x02\x00\x03\x80\x00\x00U\x80\x00\x00\x1b\x80\x01\x00\xe4\x80\x04\x00\x00\x04\x00\x00\x04\x80\x00\x00U\x80\x00\x00\xaa\x80\x00\x00\xaa\xb0\x12\x00\x00\x04\x02\x00\x04\x80\x00\x00U\x80\x00\x00\xaa\x80\x01\x00\xaa\x80\x06\x00\x00\x02\x00\x00\x02\x80\x02\x00\x00\x80\x05\x00\x00\x03\x00\x00\x02\x80\x00\x00U\x80\x02\x00U\x80\x05\x00\x00\x03\x00\x00\x02\x80\x00\x00\x00\x80\x00\x00U\x80#\x00\x00\x02\x00\x00\x02\x80\x00\x00U\x80\x04\x00\x00\x04\x01\x00\x01\x80\x00\x00U\x80\x00\x00U\xa0\x02\x00\xaa\x80\x04\x00\x00\x04\x01\x00\x02\x80\x00\x00U\x80\x00\x00\x00\xa0\x02\x00\xaa\x80\x06\x00\x00\x02\x00\x00\x02\x80\x00\x00U\x80\x02\x00\x00\x03\x00\x00\f\x80\x02\x00\xaa\x81\x00\x00\x1b\xa0\x05\x00\x00\x03\x01\x00\b\x80\x00\x00U\x80\x00\x00\xff\x80\x05\x00\x00\x03\x01\x00\x04\x80\x00\x00U\x80\x00\x00\xaa\x80\x02\x00\x00\x03\x01\x00\x1f\x80\x01\x00\xe4\x80\x00\x00U\xa0\x04\x00\x00\x04\x00\x00\x02\x80\x01\x00\xaa\x80\x01\x00U\x81\x01\x00\xaa\x80\x02\x00\x00\x03\x00\x00\x02\x80\x00\x00U\x80\x00\x00\xaa\xa0\x02\x00\x00\x03\x00\x00\x02\x80\x01\x00\x00\x81\x00\x00U\x80\x04\x00\x00\x04\x00\x00\x02\x80\x01\x00\x00\x80\x01\x00\xff\x80\x00\x00U\x80\x05\x00\x00\x03\x00\x00\x02\x80\x00\x00U\x80\x00\x00\x00\x80\x05\x00\x00\x03\x00\x00\x01\x80\x00\x00\x00\x80\x00\x00\x00\x80\x05\x00\x00\x03\x00\x00\x02\x80\x00\x00U\x80\x00\x00U\xa0X\x00\x00\x04\x00\x00\x01\x80\x00\x00\x00\x81\x00\x00\xff\xa0\x00\x00U\x80\x01\x00\x00\x02\x00\x00\x0e\x80\x00\x00\xff\xa0\x01\x00\x00\x02\x00\b\x0f\x80\x00\x00\xe4\x80\xff\xff\x00\x00SHDRX\x05\x00\x00@\x00\x00\x00V\x01\x00\x00b\x10\x00\x032\x10\x10\x00\x00\x00\x00\x00b\x10\x00\x03\xc2\x10\x10\x00\x00\x00\x00\x00b\x10\x00\x032\x10\x10\x00\x01\x00\x00\x00e\x00\x00\x03\xf2 \x10\x00\x00\x00\x00\x00h\x00\x00\x02\x03\x00\x00\x006\x00\x00\x05\x12\x00\x10\x00\x00\x00\x00\x00\n\x10\x10\x00\x00\x00\x00\x006\x00\x00\x05\"\x00\x10\x00\x00\x00\x00\x00\n\x10\x10\x00\x01\x00\x00\x004\x00\x00\n2\x00\x10\x00\x00\x00\x00\x00F\x00\x10\x00\x00\x00\x00\x00\x02@\x00\x00\x00\x00\x00\xbf\x00\x00\x00\xbf\x00\x00\x00\x00\x00\x00\x00\x003\x00\x00\n2\x00\x10\x00\x00\x00\x00\x00F\x00\x10\x00\x00\x00\x00\x00\x02@\x00\x00\x00\x00\x00?\x00\x00\x00?\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\b\"\x00\x10\x00\x00\x00\x00\x00\n\x00\x10\x80A\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x10\x00\x00\x00\x00\x002\x00\x00\t\x12\x00\x10\x00\x00\x00\x00\x00\x1a\x00\x10\x00\x00\x00\x00\x00\x01@\x00\x00\x00\x00\x00?\n\x00\x10\x00\x00\x00\x00\x003\x00\x00\a2\x00\x10\x00\x01\x00\x00\x00\x06\x10\x10\x00\x00\x00\x00\x00\x06\x10\x10\x00\x01\x00\x00\x00\x00\x00\x00\b\x12\x00\x10\x00\x00\x00\x00\x00\n\x00\x10\x00\x00\x00\x00\x00\n\x00\x10\x80A\x00\x00\x00\x01\x00\x00\x004\x00\x00\a2\x00\x10\x00\x02\x00\x00\x00\x06\x10\x10\x00\x00\x00\x00\x00\x06\x10\x10\x00\x01\x00\x00\x00\x1d\x00\x00\aB\x00\x10\x00\x00\x00\x00\x00\n\x10\x10\x00\x01\x00\x00\x00\n\x10\x10\x00\x00\x00\x00\x007\x00\x00\tB\x00\x10\x00\x02\x00\x00\x00*\x00\x10\x00\x00\x00\x00\x00\x1a\x10\x10\x00\x01\x00\x00\x00\x1a\x10\x10\x00\x00\x00\x00\x007\x00\x00\tB\x00\x10\x00\x01\x00\x00\x00*\x00\x10\x00\x00\x00\x00\x00\x1a\x10\x10\x00\x00\x00\x00\x00\x1a\x10\x10\x00\x01\x00\x00\x00\x00\x00\x00\br\x00\x10\x00\x02\x00\x00\x00F\x02\x10\x00\x02\x00\x00\x00\xa6\x1b\x10\x80A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\b\xc2\x00\x10\x00\x00\x00\x00\x00V\t\x10\x80A\x00\x00\x00\x01\x00\x00\x00\xa6\x1e\x10\x00\x00\x00\x00\x00\x00\x00\x00\b\xb2\x00\x10\x00\x01\x00\x00\x00\xa6\x0e\x10\x80A\x00\x00\x00\x00\x00\x00\x00F\b\x10\x00\x02\x00\x00\x008\x00\x00\a\x12\x00\x10\x00\x01\x00\x00\x00\n\x00\x10\x00\x00\x00\x00\x00\n\x00\x10\x00\x01\x00\x00\x002\x00\x00\t\x12\x00\x10\x00\x01\x00\x00\x00*\x00\x10\x00\x00\x00\x00\x00*\x00\x10\x00\x00\x00\x00\x00\n\x00\x10\x00\x01\x00\x00\x00K\x00\x00\x05\x12\x00\x10\x00\x01\x00\x00\x00\n\x00\x10\x00\x01\x00\x00\x00\x00\x00\x00\a\x12\x00\x10\x00\x01\x00\x00\x00*\x00\x10\x00\x00\x00\x00\x00\n\x00\x10\x00\x01\x00\x00\x00\x0e\x00\x00\a\x12\x00\x10\x00\x00\x00\x00\x00\n\x00\x10\x00\x00\x00\x00\x00\n\x00\x10\x00\x01\x00\x00\x002\x00\x00\t\x12\x00\x10\x00\x01\x00\x00\x00\n\x00\x10\x00\x00\x00\x00\x00:\x00\x10\x00\x00\x00\x00\x00*\x00\x10\x00\x01\x00\x00\x002\x00\x00\t\xc2\x00\x10\x00\x00\x00\x00\x00\x06\x00\x10\x00\x00\x00\x00\x00V\r\x10\x00\x01\x00\x00\x00\xa6\x0e\x10\x00\x00\x00\x00\x00\x0e\x00\x00\aB\x00\x10\x00\x00\x00\x00\x00:\x00\x10\x00\x00\x00\x00\x00*\x00\x10\x00\x00\x00\x00\x008\x00\x00\aB\x00\x10\x00\x00\x00\x00\x00\x1a\x00\x10\x00\x00\x00\x00\x00*\x00\x10\x00\x00\x00\x00\x002\x00\x00\t\x82\x00\x10\x00\x00\x00\x00\x00\n\x00\x10\x00\x00\x00\x00\x00*\x00\x10\x00\x02\x00\x00\x00:\x10\x10\x00\x00\x00\x00\x00\x00\x00\x00\b\x82\x00\x10\x00\x00\x00\x00\x00\n\x00\x10\x80A\x00\x00\x00\x01\x00\x00\x00:\x00\x10\x00\x00\x00\x00\x002\x00\x00\t\x12\x00\x10\x00\x00\x00\x00\x00\n\x00\x10\x00\x00\x00\x00\x00:\x00\x10\x00\x00\x00\x00\x00\n\x00\x10\x00\x01\x00\x00\x00\x00\x00\x00\v2\x00\x10\x00\x01\x00\x00\x00\x06\x00\x10\x80A\x00\x00\x00\x00\x00\x00\x00\x02@\x00\x00\x00\x00\x00?\x00\x00\x00\xbf\x00\x00\x00\x00\x00\x00\x00\x002\x00\x00\r2\x00\x10\x00\x02\x00\x00\x00\xa6\n\x10\x80\x81\x00\x00\x00\x00\x00\x00\x00\x02@\x00\x00\x00\x00\x00?\x00\x00\x00\xbf\x00\x00\x00\x00\x00\x00\x00\x00\x06\x00\x10\x00\x00\x00\x00\x00\x0e\x00\x00\b\xc2\x00\x10\x00\x02\x00\x00\x00\x06\x04\x10\x00\x01\x00\x00\x00\xa6\n\x10\x80\x81\x00\x00\x00\x00\x00\x00\x00\x00 \x00\n\xf2\x00\x10\x00\x01\x00\x00\x00F\x0e\x10\x00\x02\x00\x00\x00\x02@\x00\x00\x00\x00\x00?\x00\x00\x00?\x00\x00\x00?\x00\x00\x00?2\x00\x00\n\x12\x00\x10\x00\x00\x00\x00\x00*\x00\x10\x80A\x00\x00\x00\x01\x00\x00\x00\x1a\x00\x10\x00\x01\x00\x00\x00*\x00\x10\x00\x01\x00\x00\x00\x00\x00\x00\a\x12\x00\x10\x00\x00\x00\x00\x00\n\x00\x10\x00\x00\x00\x00\x00\x01@\x00\x00\x00\x00\x80?\x00\x00\x00\b\x12\x00\x10\x00\x00\x00\x00\x00\n\x00\x10\x80A\x00\x00\x00\x01\x00\x00\x00\n\x00\x10\x00\x00\x00\x00\x002\x00\x00\t\x12\x00\x10\x00\x00\x00\x00\x00\n\x00\x10\x00\x01\x00\x00\x00:\x00\x10\x00\x01\x00\x00\x00\n\x00\x10\x00\x00\x00\x00\x008\x00\x00\a\x12\x00\x10\x00\x00\x00\x00\x00\n\x00\x10\x00\x00\x00\x00\x00\x1a\x00\x10\x00\x00\x00\x00\x00\x18\x00\x00\a\"\x00\x10\x00\x00\x00\x00\x00\x1a\x00\x10\x00\x00\x00\x00\x00\x01@\x00\x00\x00\x00\x00\x008\x00\x00\a\x12\x00\x10\x00\x00\x00\x00\x00\n\x00\x10\x00\x00\x00\x00\x00\x01@\x00\x00\x00\x00\x00?7\x00\x00\t\x12 \x10\x00\x00\x00\x00\x00\x1a\x00\x10\x00\x00\x00\x00\x00\x01@\x00\x00\x00\x00\x00\x00\n\x00\x10\x00\x00\x00\x00\x006\x00\x00\b\xe2 \x10\x00\x00\x00\x00\x00\x02@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>\x00\x00\x01STATt\x00\x00\x00)\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00RDEFD\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x00\x00\x00\x00\x04\xff\xff\x00\x01\x00\x00\x1c\x00\x00\x00Microsoft (R) HLSL Shader Compiler 10.1\x00ISGN\\\x00\x00\x00\x03\x00\x00\x00\b\x00\x00\x00P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x03\x00\x00P\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\f\f\x00\x00P\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x03\x03\x00\x00TEXCOORD\x00\xab\xab\xabOSGN,\x00\x00\x00\x01\x00\x00\x00\b\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00SV_Target\x00\xab\xab",
6168 }
6169 shader_stencil_vert = driver.ShaderSources{
6170 Name: "stencil.vert",
6171 Inputs: []driver.InputLocation{{Name: "corner", Location: 0, Semantic: "TEXCOORD", SemanticIndex: 0, Type: 0x0, Size: 1}, {Name: "maxy", Location: 1, Semantic: "TEXCOORD", SemanticIndex: 1, Type: 0x0, Size: 1}, {Name: "from", Location: 2, Semantic: "TEXCOORD", SemanticIndex: 2, Type: 0x0, Size: 2}, {Name: "ctrl", Location: 3, Semantic: "TEXCOORD", SemanticIndex: 3, Type: 0x0, Size: 2}, {Name: "to", Location: 4, Semantic: "TEXCOORD", SemanticIndex: 4, Type: 0x0, Size: 2}},
6172 Uniforms: driver.UniformsReflection{
6173 Blocks: []driver.UniformBlock{{Name: "Block", Binding: 0}},
6174 Locations: []driver.UniformLocation{{Name: "_block.transform", Type: 0x0, Size: 4, Offset: 0}, {Name: "_block.pathOffset", Type: 0x0, Size: 2, Offset: 16}},
6175 Size: 24,
6176 },
6177 GLSL100ES: `#version 100
6178
6179 struct Block
6180 {
6181 vec4 transform;
6182 vec2 pathOffset;
6183 };
6184
6185 uniform Block _block;
6186
6187 attribute vec2 from;
6188 attribute vec2 ctrl;
6189 attribute vec2 to;
6190 attribute float maxy;
6191 attribute float corner;
6192 varying vec2 vFrom;
6193 varying vec2 vCtrl;
6194 varying vec2 vTo;
6195
6196 void main()
6197 {
6198 vec2 from_1 = from + _block.pathOffset;
6199 vec2 ctrl_1 = ctrl + _block.pathOffset;
6200 vec2 to_1 = to + _block.pathOffset;
6201 float maxy_1 = maxy + _block.pathOffset.y;
6202 float c = corner;
6203 vec2 pos;
6204 if (c >= 0.375)
6205 {
6206 c -= 0.5;
6207 pos.y = maxy_1 + 1.0;
6208 }
6209 else
6210 {
6211 pos.y = min(min(from_1.y, ctrl_1.y), to_1.y) - 1.0;
6212 }
6213 if (c >= 0.125)
6214 {
6215 pos.x = max(max(from_1.x, ctrl_1.x), to_1.x) + 1.0;
6216 }
6217 else
6218 {
6219 pos.x = min(min(from_1.x, ctrl_1.x), to_1.x) - 1.0;
6220 }
6221 vFrom = from_1 - pos;
6222 vCtrl = ctrl_1 - pos;
6223 vTo = to_1 - pos;
6224 pos = (pos * _block.transform.xy) + _block.transform.zw;
6225 gl_Position = vec4(pos, 1.0, 1.0);
6226 }
6227
6228 `,
6229 GLSL300ES: `#version 300 es
6230
6231 layout(std140) uniform Block
6232 {
6233 vec4 transform;
6234 vec2 pathOffset;
6235 } _block;
6236
6237 layout(location = 2) in vec2 from;
6238 layout(location = 3) in vec2 ctrl;
6239 layout(location = 4) in vec2 to;
6240 layout(location = 1) in float maxy;
6241 layout(location = 0) in float corner;
6242 out vec2 vFrom;
6243 out vec2 vCtrl;
6244 out vec2 vTo;
6245
6246 void main()
6247 {
6248 vec2 from_1 = from + _block.pathOffset;
6249 vec2 ctrl_1 = ctrl + _block.pathOffset;
6250 vec2 to_1 = to + _block.pathOffset;
6251 float maxy_1 = maxy + _block.pathOffset.y;
6252 float c = corner;
6253 vec2 pos;
6254 if (c >= 0.375)
6255 {
6256 c -= 0.5;
6257 pos.y = maxy_1 + 1.0;
6258 }
6259 else
6260 {
6261 pos.y = min(min(from_1.y, ctrl_1.y), to_1.y) - 1.0;
6262 }
6263 if (c >= 0.125)
6264 {
6265 pos.x = max(max(from_1.x, ctrl_1.x), to_1.x) + 1.0;
6266 }
6267 else
6268 {
6269 pos.x = min(min(from_1.x, ctrl_1.x), to_1.x) - 1.0;
6270 }
6271 vFrom = from_1 - pos;
6272 vCtrl = ctrl_1 - pos;
6273 vTo = to_1 - pos;
6274 pos = (pos * _block.transform.xy) + _block.transform.zw;
6275 gl_Position = vec4(pos, 1.0, 1.0);
6276 }
6277
6278 `,
6279 GLSL130: `#version 130
6280 #ifdef GL_ARB_shading_language_420pack
6281 #extension GL_ARB_shading_language_420pack : require
6282 #endif
6283
6284 struct Block
6285 {
6286 vec4 transform;
6287 vec2 pathOffset;
6288 };
6289
6290 uniform Block _block;
6291
6292 in vec2 from;
6293 in vec2 ctrl;
6294 in vec2 to;
6295 in float maxy;
6296 in float corner;
6297 out vec2 vFrom;
6298 out vec2 vCtrl;
6299 out vec2 vTo;
6300
6301 void main()
6302 {
6303 vec2 from_1 = from + _block.pathOffset;
6304 vec2 ctrl_1 = ctrl + _block.pathOffset;
6305 vec2 to_1 = to + _block.pathOffset;
6306 float maxy_1 = maxy + _block.pathOffset.y;
6307 float c = corner;
6308 vec2 pos;
6309 if (c >= 0.375)
6310 {
6311 c -= 0.5;
6312 pos.y = maxy_1 + 1.0;
6313 }
6314 else
6315 {
6316 pos.y = min(min(from_1.y, ctrl_1.y), to_1.y) - 1.0;
6317 }
6318 if (c >= 0.125)
6319 {
6320 pos.x = max(max(from_1.x, ctrl_1.x), to_1.x) + 1.0;
6321 }
6322 else
6323 {
6324 pos.x = min(min(from_1.x, ctrl_1.x), to_1.x) - 1.0;
6325 }
6326 vFrom = from_1 - pos;
6327 vCtrl = ctrl_1 - pos;
6328 vTo = to_1 - pos;
6329 pos = (pos * _block.transform.xy) + _block.transform.zw;
6330 gl_Position = vec4(pos, 1.0, 1.0);
6331 }
6332
6333 `,
6334 GLSL150: `#version 150
6335 #ifdef GL_ARB_shading_language_420pack
6336 #extension GL_ARB_shading_language_420pack : require
6337 #endif
6338
6339 layout(binding = 0, std140) uniform Block
6340 {
6341 vec4 transform;
6342 vec2 pathOffset;
6343 } _block;
6344
6345 in vec2 from;
6346 in vec2 ctrl;
6347 in vec2 to;
6348 in float maxy;
6349 in float corner;
6350 out vec2 vFrom;
6351 out vec2 vCtrl;
6352 out vec2 vTo;
6353
6354 void main()
6355 {
6356 vec2 from_1 = from + _block.pathOffset;
6357 vec2 ctrl_1 = ctrl + _block.pathOffset;
6358 vec2 to_1 = to + _block.pathOffset;
6359 float maxy_1 = maxy + _block.pathOffset.y;
6360 float c = corner;
6361 vec2 pos;
6362 if (c >= 0.375)
6363 {
6364 c -= 0.5;
6365 pos.y = maxy_1 + 1.0;
6366 }
6367 else
6368 {
6369 pos.y = min(min(from_1.y, ctrl_1.y), to_1.y) - 1.0;
6370 }
6371 if (c >= 0.125)
6372 {
6373 pos.x = max(max(from_1.x, ctrl_1.x), to_1.x) + 1.0;
6374 }
6375 else
6376 {
6377 pos.x = min(min(from_1.x, ctrl_1.x), to_1.x) - 1.0;
6378 }
6379 vFrom = from_1 - pos;
6380 vCtrl = ctrl_1 - pos;
6381 vTo = to_1 - pos;
6382 pos = (pos * _block.transform.xy) + _block.transform.zw;
6383 gl_Position = vec4(pos, 1.0, 1.0);
6384 }
6385
6386 `,
6387 HLSL: "DXBC\xa5!\xd8\x10\xb4n\x90\xe3\xd9U\xdb\xe2\xb6~I0\x01\x00\x00\x00\x10\b\x00\x00\x06\x00\x00\x008\x00\x00\x00L\x02\x00\x00t\x05\x00\x00\xf0\x05\x00\x00\xf4\x06\x00\x00\x88\a\x00\x00Aon9\f\x02\x00\x00\f\x02\x00\x00\x00\x02\xfe\xff\xd8\x01\x00\x004\x00\x00\x00\x01\x00$\x00\x00\x000\x00\x00\x000\x00\x00\x00$\x00\x01\x000\x00\x00\x00\x00\x00\x02\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xfe\xffQ\x00\x00\x05\x03\x00\x0f\xa0\x00\x00\xc0>\x00\x00\x80?\x00\x00\x80\xbf\x00\x00\x00\xbfQ\x00\x00\x05\x04\x00\x0f\xa0\x00\x00\x00>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\x00\x00\x02\x05\x00\x00\x80\x00\x00\x0f\x90\x1f\x00\x00\x02\x05\x00\x01\x80\x01\x00\x0f\x90\x1f\x00\x00\x02\x05\x00\x02\x80\x02\x00\x0f\x90\x1f\x00\x00\x02\x05\x00\x03\x80\x03\x00\x0f\x90\x1f\x00\x00\x02\x05\x00\x04\x80\x04\x00\x0f\x90\x02\x00\x00\x03\x00\x00\x01\x80\x01\x00\x00\x90\x02\x00U\xa0\x02\x00\x00\x03\x00\x00\x04\x80\x00\x00\x00\x80\x03\x00U\xa0\r\x00\x00\x03\x00\x00\x01\x80\x00\x00\x00\x90\x03\x00\x00\xa0\x01\x00\x00\x02\x01\x00\x04\x80\x00\x00\x00\x90\x02\x00\x00\x03\x00\x00\x02\x80\x00\x00\x00\x90\x03\x00\xff\xa0\x02\x00\x00\x03\x02\x00\x03\x80\x02\x00\xe4\x90\x02\x00\xe4\xa0\x02\x00\x00\x03\x02\x00\f\x80\x03\x00\x14\x90\x02\x00\x14\xa0\n\x00\x00\x03\x03\x00\x03\x80\x02\x00\xee\x80\x02\x00\xe1\x80\x02\x00\x00\x03\x03\x00\f\x80\x04\x00D\x90\x02\x00D\xa0\n\x00\x00\x03\x03\x00\x03\x80\x03\x00\xeb\x80\x03\x00\xe4\x80\x02\x00\x00\x03\x01\x00\x03\x80\x03\x00\xe4\x80\x03\x00\xaa\xa0\x12\x00\x00\x04\x04\x00\x06\x80\x00\x00\x00\x80\x00\x00\xe4\x80\x01\x00Ȁ\r\x00\x00\x03\x00\x00\x01\x80\x04\x00U\x80\x04\x00\x00\xa0\v\x00\x00\x03\x00\x00\x02\x80\x02\x00\xff\x80\x02\x00\x00\x80\v\x00\x00\x03\x00\x00\x02\x80\x03\x00\xaa\x80\x00\x00U\x80\x02\x00\x00\x03\x00\x00\x02\x80\x00\x00U\x80\x03\x00U\xa0\x12\x00\x00\x04\x04\x00\x01\x80\x00\x00\x00\x80\x00\x00U\x80\x01\x00U\x80\x02\x00\x00\x03\x00\x00\x0f\xe0\x02\x00\xe4\x80\x04\x00(\x81\x02\x00\x00\x03\x01\x00\x03\xe0\x03\x00\xee\x80\x04\x00\xe8\x81\x04\x00\x00\x04\x00\x00\x03\x80\x04\x00\xe8\x80\x01\x00\xe4\xa0\x01\x00\xee\xa0\x02\x00\x00\x03\x00\x00\x03\xc0\x00\x00\xe4\x80\x00\x00\xe4\xa0\x01\x00\x00\x02\x00\x00\f\xc0\x03\x00U\xa0\xff\xff\x00\x00SHDR \x03\x00\x00@\x00\x01\x00\xc8\x00\x00\x00Y\x00\x00\x04F\x8e \x00\x00\x00\x00\x00\x02\x00\x00\x00_\x00\x00\x03\x12\x10\x10\x00\x00\x00\x00\x00_\x00\x00\x03\x12\x10\x10\x00\x01\x00\x00\x00_\x00\x00\x032\x10\x10\x00\x02\x00\x00\x00_\x00\x00\x032\x10\x10\x00\x03\x00\x00\x00_\x00\x00\x032\x10\x10\x00\x04\x00\x00\x00e\x00\x00\x032 \x10\x00\x00\x00\x00\x00e\x00\x00\x03\xc2 \x10\x00\x00\x00\x00\x00e\x00\x00\x032 \x10\x00\x01\x00\x00\x00g\x00\x00\x04\xf2 \x10\x00\x02\x00\x00\x00\x01\x00\x00\x00h\x00\x00\x02\x04\x00\x00\x00\x00\x00\x00\b\x12\x00\x10\x00\x00\x00\x00\x00\n\x10\x10\x00\x01\x00\x00\x00\x1a\x80 \x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\aB\x00\x10\x00\x00\x00\x00\x00\n\x00\x10\x00\x00\x00\x00\x00\x01@\x00\x00\x00\x00\x80?\x1d\x00\x00\a\x12\x00\x10\x00\x00\x00\x00\x00\n\x10\x10\x00\x00\x00\x00\x00\x01@\x00\x00\x00\x00\xc0>\x00\x00\x00\a\"\x00\x10\x00\x00\x00\x00\x00\n\x10\x10\x00\x00\x00\x00\x00\x01@\x00\x00\x00\x00\x00\xbf6\x00\x00\x05B\x00\x10\x00\x01\x00\x00\x00\n\x10\x10\x00\x00\x00\x00\x00\x00\x00\x00\b2\x00\x10\x00\x02\x00\x00\x00F\x10\x10\x00\x02\x00\x00\x00F\x80 \x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\b\xc2\x00\x10\x00\x02\x00\x00\x00\x06\x14\x10\x00\x03\x00\x00\x00\x06\x84 \x00\x00\x00\x00\x00\x01\x00\x00\x003\x00\x00\a2\x00\x10\x00\x03\x00\x00\x00\xb6\x0f\x10\x00\x02\x00\x00\x00\x16\x05\x10\x00\x02\x00\x00\x00\x00\x00\x00\b\xc2\x00\x10\x00\x03\x00\x00\x00\x06\x14\x10\x00\x04\x00\x00\x00\x06\x84 \x00\x00\x00\x00\x00\x01\x00\x00\x003\x00\x00\a2\x00\x10\x00\x03\x00\x00\x00\xb6\x0f\x10\x00\x03\x00\x00\x00F\x00\x10\x00\x03\x00\x00\x00\x00\x00\x00\n2\x00\x10\x00\x01\x00\x00\x00F\x00\x10\x00\x03\x00\x00\x00\x02@\x00\x00\x00\x00\x80\xbf\x00\x00\x80\xbf\x00\x00\x00\x00\x00\x00\x00\x007\x00\x00\tb\x00\x10\x00\x00\x00\x00\x00\x06\x00\x10\x00\x00\x00\x00\x00V\x06\x10\x00\x00\x00\x00\x00\xa6\b\x10\x00\x01\x00\x00\x00\x1d\x00\x00\a\"\x00\x10\x00\x00\x00\x00\x00\x1a\x00\x10\x00\x00\x00\x00\x00\x01@\x00\x00\x00\x00\x00>4\x00\x00\a\x82\x00\x10\x00\x00\x00\x00\x00*\x00\x10\x00\x02\x00\x00\x00\n\x00\x10\x00\x02\x00\x00\x004\x00\x00\a\x82\x00\x10\x00\x00\x00\x00\x00*\x00\x10\x00\x03\x00\x00\x00:\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\a\x82\x00\x10\x00\x00\x00\x00\x00:\x00\x10\x00\x00\x00\x00\x00\x01@\x00\x00\x00\x00\x80?7\x00\x00\t\x12\x00\x10\x00\x00\x00\x00\x00\x1a\x00\x10\x00\x00\x00\x00\x00:\x00\x10\x00\x00\x00\x00\x00\x1a\x00\x10\x00\x01\x00\x00\x00\x00\x00\x00\b\xf2 \x10\x00\x00\x00\x00\x00\x86\b\x10\x80A\x00\x00\x00\x00\x00\x00\x00F\x0e\x10\x00\x02\x00\x00\x00\x00\x00\x00\b2 \x10\x00\x01\x00\x00\x00\x86\x00\x10\x80A\x00\x00\x00\x00\x00\x00\x00\xe6\n\x10\x00\x03\x00\x00\x002\x00\x00\v2 \x10\x00\x02\x00\x00\x00\x86\x00\x10\x00\x00\x00\x00\x00F\x80 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xe6\x8a \x00\x00\x00\x00\x00\x00\x00\x00\x006\x00\x00\b\xc2 \x10\x00\x02\x00\x00\x00\x02@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80?\x00\x00\x80?>\x00\x00\x01STATt\x00\x00\x00\x16\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00RDEF\xfc\x00\x00\x00\x01\x00\x00\x00D\x00\x00\x00\x01\x00\x00\x00\x1c\x00\x00\x00\x00\x04\xfe\xff\x00\x01\x00\x00\xd4\x00\x00\x00<\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00Block\x00\xab\xab<\x00\x00\x00\x02\x00\x00\x00\\\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8c\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x02\x00\x00\x00\xa0\x00\x00\x00\x00\x00\x00\x00\xb0\x00\x00\x00\x10\x00\x00\x00\b\x00\x00\x00\x02\x00\x00\x00\xc4\x00\x00\x00\x00\x00\x00\x00_block_transform\x00\xab\xab\xab\x01\x00\x03\x00\x01\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00_block_pathOffset\x00\xab\xab\x01\x00\x03\x00\x01\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00Microsoft (R) HLSL Shader Compiler 10.1\x00ISGN\x8c\x00\x00\x00\x05\x00\x00\x00\b\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00\x80\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x01\x01\x00\x00\x80\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x02\x00\x00\x00\x03\x03\x00\x00\x80\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03\x00\x00\x00\x03\x03\x00\x00\x80\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x03\x03\x00\x00TEXCOORD\x00\xab\xab\xabOSGN\x80\x00\x00\x00\x04\x00\x00\x00\b\x00\x00\x00h\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\f\x00\x00h\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\f\x03\x00\x00h\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x03\f\x00\x00q\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00\x02\x00\x00\x00\x0f\x00\x00\x00TEXCOORD\x00SV_Position\x00\xab\xab\xab",
6388 }
6389 shader_tile_alloc_comp = driver.ShaderSources{
6390 Name: "tile_alloc.comp",
6391 GLSL310ES: `#version 310 es
6392 layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
6393
6394 struct Alloc
6395 {
6396 uint offset;
6397 };
6398
6399 struct MallocResult
6400 {
6401 Alloc alloc;
6402 bool failed;
6403 };
6404
6405 struct AnnoEndClipRef
6406 {
6407 uint offset;
6408 };
6409
6410 struct AnnoEndClip
6411 {
6412 vec4 bbox;
6413 };
6414
6415 struct AnnotatedRef
6416 {
6417 uint offset;
6418 };
6419
6420 struct AnnotatedTag
6421 {
6422 uint tag;
6423 uint flags;
6424 };
6425
6426 struct PathRef
6427 {
6428 uint offset;
6429 };
6430
6431 struct TileRef
6432 {
6433 uint offset;
6434 };
6435
6436 struct Path
6437 {
6438 uvec4 bbox;
6439 TileRef tiles;
6440 };
6441
6442 struct Config
6443 {
6444 uint n_elements;
6445 uint n_pathseg;
6446 uint width_in_tiles;
6447 uint height_in_tiles;
6448 Alloc tile_alloc;
6449 Alloc bin_alloc;
6450 Alloc ptcl_alloc;
6451 Alloc pathseg_alloc;
6452 Alloc anno_alloc;
6453 Alloc trans_alloc;
6454 };
6455
6456 layout(binding = 0, std430) buffer Memory
6457 {
6458 uint mem_offset;
6459 uint mem_error;
6460 uint memory[];
6461 } _96;
6462
6463 layout(binding = 1, std430) readonly buffer ConfigBuf
6464 {
6465 Config conf;
6466 } _309;
6467
6468 shared uint sh_tile_count[128];
6469 shared MallocResult sh_tile_alloc;
6470
6471 bool touch_mem(Alloc alloc, uint offset)
6472 {
6473 return true;
6474 }
6475
6476 uint read_mem(Alloc alloc, uint offset)
6477 {
6478 Alloc param = alloc;
6479 uint param_1 = offset;
6480 if (!touch_mem(param, param_1))
6481 {
6482 return 0u;
6483 }
6484 uint v = _96.memory[offset];
6485 return v;
6486 }
6487
6488 AnnotatedTag Annotated_tag(Alloc a, AnnotatedRef ref)
6489 {
6490 Alloc param = a;
6491 uint param_1 = ref.offset >> uint(2);
6492 uint tag_and_flags = read_mem(param, param_1);
6493 return AnnotatedTag(tag_and_flags & 65535u, tag_and_flags >> uint(16));
6494 }
6495
6496 AnnoEndClip AnnoEndClip_read(Alloc a, AnnoEndClipRef ref)
6497 {
6498 uint ix = ref.offset >> uint(2);
6499 Alloc param = a;
6500 uint param_1 = ix + 0u;
6501 uint raw0 = read_mem(param, param_1);
6502 Alloc param_2 = a;
6503 uint param_3 = ix + 1u;
6504 uint raw1 = read_mem(param_2, param_3);
6505 Alloc param_4 = a;
6506 uint param_5 = ix + 2u;
6507 uint raw2 = read_mem(param_4, param_5);
6508 Alloc param_6 = a;
6509 uint param_7 = ix + 3u;
6510 uint raw3 = read_mem(param_6, param_7);
6511 AnnoEndClip s;
6512 s.bbox = vec4(uintBitsToFloat(raw0), uintBitsToFloat(raw1), uintBitsToFloat(raw2), uintBitsToFloat(raw3));
6513 return s;
6514 }
6515
6516 AnnoEndClip Annotated_EndClip_read(Alloc a, AnnotatedRef ref)
6517 {
6518 Alloc param = a;
6519 AnnoEndClipRef param_1 = AnnoEndClipRef(ref.offset + 4u);
6520 return AnnoEndClip_read(param, param_1);
6521 }
6522
6523 Alloc new_alloc(uint offset, uint size)
6524 {
6525 Alloc a;
6526 a.offset = offset;
6527 return a;
6528 }
6529
6530 MallocResult malloc(uint size)
6531 {
6532 MallocResult r;
6533 r.failed = false;
6534 uint _102 = atomicAdd(_96.mem_offset, size);
6535 uint offset = _102;
6536 uint param = offset;
6537 uint param_1 = size;
6538 r.alloc = new_alloc(param, param_1);
6539 if ((offset + size) > uint(int(uint(_96.memory.length())) * 4))
6540 {
6541 r.failed = true;
6542 uint _123 = atomicMax(_96.mem_error, 1u);
6543 return r;
6544 }
6545 return r;
6546 }
6547
6548 Alloc slice_mem(Alloc a, uint offset, uint size)
6549 {
6550 uint param = a.offset + offset;
6551 uint param_1 = size;
6552 return new_alloc(param, param_1);
6553 }
6554
6555 void write_mem(Alloc alloc, uint offset, uint val)
6556 {
6557 Alloc param = alloc;
6558 uint param_1 = offset;
6559 if (!touch_mem(param, param_1))
6560 {
6561 return;
6562 }
6563 _96.memory[offset] = val;
6564 }
6565
6566 void Path_write(Alloc a, PathRef ref, Path s)
6567 {
6568 uint ix = ref.offset >> uint(2);
6569 Alloc param = a;
6570 uint param_1 = ix + 0u;
6571 uint param_2 = s.bbox.x | (s.bbox.y << uint(16));
6572 write_mem(param, param_1, param_2);
6573 Alloc param_3 = a;
6574 uint param_4 = ix + 1u;
6575 uint param_5 = s.bbox.z | (s.bbox.w << uint(16));
6576 write_mem(param_3, param_4, param_5);
6577 Alloc param_6 = a;
6578 uint param_7 = ix + 2u;
6579 uint param_8 = s.tiles.offset;
6580 write_mem(param_6, param_7, param_8);
6581 }
6582
6583 void main()
6584 {
6585 if (_96.mem_error != 0u)
6586 {
6587 return;
6588 }
6589 uint th_ix = gl_LocalInvocationID.x;
6590 uint element_ix = gl_GlobalInvocationID.x;
6591 PathRef path_ref = PathRef(_309.conf.tile_alloc.offset + (element_ix * 12u));
6592 AnnotatedRef ref = AnnotatedRef(_309.conf.anno_alloc.offset + (element_ix * 32u));
6593 uint tag = 0u;
6594 if (element_ix < _309.conf.n_elements)
6595 {
6596 Alloc param;
6597 param.offset = _309.conf.anno_alloc.offset;
6598 AnnotatedRef param_1 = ref;
6599 tag = Annotated_tag(param, param_1).tag;
6600 }
6601 int x0 = 0;
6602 int y0 = 0;
6603 int x1 = 0;
6604 int y1 = 0;
6605 switch (tag)
6606 {
6607 case 1u:
6608 case 2u:
6609 case 3u:
6610 case 4u:
6611 {
6612 Alloc param_2;
6613 param_2.offset = _309.conf.anno_alloc.offset;
6614 AnnotatedRef param_3 = ref;
6615 AnnoEndClip clip = Annotated_EndClip_read(param_2, param_3);
6616 x0 = int(floor(clip.bbox.x * 0.03125));
6617 y0 = int(floor(clip.bbox.y * 0.03125));
6618 x1 = int(ceil(clip.bbox.z * 0.03125));
6619 y1 = int(ceil(clip.bbox.w * 0.03125));
6620 break;
6621 }
6622 }
6623 x0 = clamp(x0, 0, int(_309.conf.width_in_tiles));
6624 y0 = clamp(y0, 0, int(_309.conf.height_in_tiles));
6625 x1 = clamp(x1, 0, int(_309.conf.width_in_tiles));
6626 y1 = clamp(y1, 0, int(_309.conf.height_in_tiles));
6627 Path path;
6628 path.bbox = uvec4(uint(x0), uint(y0), uint(x1), uint(y1));
6629 uint tile_count = uint((x1 - x0) * (y1 - y0));
6630 if (tag == 4u)
6631 {
6632 tile_count = 0u;
6633 }
6634 sh_tile_count[th_ix] = tile_count;
6635 uint total_tile_count = tile_count;
6636 for (uint i = 0u; i < 7u; i++)
6637 {
6638 barrier();
6639 if (th_ix >= uint(1 << int(i)))
6640 {
6641 total_tile_count += sh_tile_count[th_ix - uint(1 << int(i))];
6642 }
6643 barrier();
6644 sh_tile_count[th_ix] = total_tile_count;
6645 }
6646 if (th_ix == 127u)
6647 {
6648 uint param_4 = total_tile_count * 8u;
6649 MallocResult _482 = malloc(param_4);
6650 sh_tile_alloc = _482;
6651 }
6652 barrier();
6653 MallocResult alloc_start = sh_tile_alloc;
6654 if (alloc_start.failed)
6655 {
6656 return;
6657 }
6658 if (element_ix < _309.conf.n_elements)
6659 {
6660 uint _499;
6661 if (th_ix > 0u)
6662 {
6663 _499 = sh_tile_count[th_ix - 1u];
6664 }
6665 else
6666 {
6667 _499 = 0u;
6668 }
6669 uint tile_subix = _499;
6670 Alloc param_5 = alloc_start.alloc;
6671 uint param_6 = 8u * tile_subix;
6672 uint param_7 = 8u * tile_count;
6673 Alloc tiles_alloc = slice_mem(param_5, param_6, param_7);
6674 path.tiles = TileRef(tiles_alloc.offset);
6675 Alloc param_8;
6676 param_8.offset = _309.conf.tile_alloc.offset;
6677 PathRef param_9 = path_ref;
6678 Path param_10 = path;
6679 Path_write(param_8, param_9, param_10);
6680 }
6681 uint total_count = sh_tile_count[127] * 2u;
6682 uint start_ix = alloc_start.alloc.offset >> uint(2);
6683 for (uint i_1 = th_ix; i_1 < total_count; i_1 += 128u)
6684 {
6685 Alloc param_11 = alloc_start.alloc;
6686 uint param_12 = start_ix + i_1;
6687 uint param_13 = 0u;
6688 write_mem(param_11, param_12, param_13);
6689 }
6690 }
6691
6692 `,
6693 }
6694 )
6695