Bug Summary

File:root/firefox-clang/obj-x86_64-pc-linux-gnu/x86_64-unknown-linux-gnu/debug/build/swgl-250521f66641ef82/out/brush_image_ADVANCED_BLEND_ALPHA_PASS_ANTIALIASING_REPETITION_TEXTURE_2D.h
Warning:line 2, column 8
Excessive padding in 'struct brush_image_ADVANCED_BLEND_ALPHA_PASS_ANTIALIASING_REPETITION_TEXTURE_2D_common::Samplers' (32 padding bytes, where 0 is optimal). Optimal fields order: sGpuBufferI_impl, sPrimitiveHeadersI_impl, sClipMask_impl, sColor0_impl, sGpuBufferF_impl, sPrimitiveHeadersF_impl, sRenderTasks_impl, sTransformPalette_impl, sClipMask_slot, sColor0_slot, sGpuBufferF_slot, sGpuBufferI_slot, sPrimitiveHeadersF_slot, sPrimitiveHeadersI_slot, sRenderTasks_slot, sTransformPalette_slot, consider reordering the fields or adding explicit padding members

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-unknown-linux-gnu -O2 -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name gl.cc -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=all -relaxed-aliasing -fapprox-func -funsafe-math-optimizations -fno-signed-zeros -mreassociate -freciprocal-math -ffp-contract=off -fno-rounding-math -mrecip=none -complex-range=basic -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/root/firefox-clang/gfx/wr/swgl -ffunction-sections -fdata-sections -fcoverage-compilation-dir=/root/firefox-clang/gfx/wr/swgl -resource-dir /usr/lib/llvm-23/lib/clang/23 -include /root/firefox-clang/config/gcc_hidden.h -include /root/firefox-clang/obj-x86_64-pc-linux-gnu/mozilla-config.h -I /root/firefox-clang/gfx/wr/swgl/../webrender/res -I src -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/x86_64-unknown-linux-gnu/debug/build/swgl-250521f66641ef82/out -D _GLIBCXX_USE_CXX11_ABI=0 -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/stl_wrappers -D _GLIBCXX_ASSERTIONS=1 -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/system_wrappers -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=2 -D DEBUG=1 -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/include -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/include/nspr -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/include/nss -D MOZILLA_CLIENT -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/15/../../../../include/c++/15 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/15/../../../../include/x86_64-linux-gnu/c++/15 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/15/../../../../include/c++/15/backward -internal-isystem /usr/lib/llvm-23/lib/clang/23/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/15/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-error=pessimizing-move -Wno-error=large-by-value-copy=128 -Wno-error=implicit-int-float-conversion -Wno-error=thread-safety-analysis -Wno-error=tautological-type-limit-compare -Wno-invalid-offsetof -Wno-range-loop-analysis -Wno-deprecated-anon-enum-enum-conversion -Wno-deprecated-enum-enum-conversion -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wno-error=atomic-alignment -Wno-error=deprecated-builtins -Wno-psabi -Wno-error=builtin-macro-redefined -Wno-vla-cxx-extension -Wno-unknown-warning-option -Wno-character-conversion -std=gnu++20 -fdeprecated-macro -ferror-limit 19 -fstrict-flex-arrays=1 -stack-protector 2 -fstack-clash-protection -ftrivial-auto-var-init=pattern -fno-rtti -fgnuc-version=4.2.1 -fno-implicit-modules -fskip-odr-check-in-gmf -fno-sized-deallocation -fno-aligned-allocation -fdiagnostics-absolute-paths -vectorize-loops -vectorize-slp -analyzer-checker optin.performance.Padding -analyzer-output=html -analyzer-config stable-report-filename=true -mllvm -dwarf-linkage-names=Abstract -faddrsig -fdwarf2-cfi-asm -o /tmp/scan-build-2026-07-16-093543-1626485-1 -x c++ src/gl.cc
1struct brush_image_ADVANCED_BLEND_ALPHA_PASS_ANTIALIASING_REPETITION_TEXTURE_2D_common {
2struct Samplers {
Excessive padding in 'struct brush_image_ADVANCED_BLEND_ALPHA_PASS_ANTIALIASING_REPETITION_TEXTURE_2D_common::Samplers' (32 padding bytes, where 0 is optimal). Optimal fields order: sGpuBufferI_impl, sPrimitiveHeadersI_impl, sClipMask_impl, sColor0_impl, sGpuBufferF_impl, sPrimitiveHeadersF_impl, sRenderTasks_impl, sTransformPalette_impl, sClipMask_slot, sColor0_slot, sGpuBufferF_slot, sGpuBufferI_slot, sPrimitiveHeadersF_slot, sPrimitiveHeadersI_slot, sRenderTasks_slot, sTransformPalette_slot, consider reordering the fields or adding explicit padding members
3 sampler2D_impl sClipMask_impl;
4 int sClipMask_slot;
5 sampler2D_impl sColor0_impl;
6 int sColor0_slot;
7 sampler2D_impl sGpuBufferF_impl;
8 int sGpuBufferF_slot;
9 isampler2D_impl sGpuBufferI_impl;
10 int sGpuBufferI_slot;
11 sampler2D_impl sPrimitiveHeadersF_impl;
12 int sPrimitiveHeadersF_slot;
13 isampler2D_impl sPrimitiveHeadersI_impl;
14 int sPrimitiveHeadersI_slot;
15 sampler2D_impl sRenderTasks_impl;
16 int sRenderTasks_slot;
17 sampler2D_impl sTransformPalette_impl;
18 int sTransformPalette_slot;
19 bool set_slot(int index, int value) {
20 switch (index) {
21 case 8:
22 sClipMask_slot = value;
23 return true;
24 case 9:
25 sColor0_slot = value;
26 return true;
27 case 3:
28 sGpuBufferF_slot = value;
29 return true;
30 case 4:
31 sGpuBufferI_slot = value;
32 return true;
33 case 5:
34 sPrimitiveHeadersF_slot = value;
35 return true;
36 case 6:
37 sPrimitiveHeadersI_slot = value;
38 return true;
39 case 1:
40 sRenderTasks_slot = value;
41 return true;
42 case 2:
43 sTransformPalette_slot = value;
44 return true;
45 }
46 return false;
47 }
48} samplers;
49struct AttribLocations {
50 int aPosition = NULL_ATTRIB16;
51 int aData = NULL_ATTRIB16;
52 void bind_loc(const char* name, int index) {
53 if (strcmp("aPosition", name) == 0) { aPosition = index; return; }
54 if (strcmp("aData", name) == 0) { aData = index; return; }
55 }
56 int get_loc(const char* name) const {
57 if (strcmp("aPosition", name) == 0) { return aPosition != NULL_ATTRIB16 ? aPosition : -1; }
58 if (strcmp("aData", name) == 0) { return aData != NULL_ATTRIB16 ? aData : -1; }
59 return -1;
60 }
61} attrib_locations;
62vec4_scalar vTransformBounds;
63vec4_scalar v_color;
64vec2_scalar v_mask_swizzle;
65vec2_scalar v_tile_repeat_bounds;
66vec4_scalar v_uv_bounds;
67vec4_scalar v_uv_sample_bounds;
68vec2_scalar v_perspective;
69sampler2D sClipMask;
70sampler2D sColor0;
71sampler2D sGpuBufferF;
72isampler2D sGpuBufferI;
73sampler2D sPrimitiveHeadersF;
74isampler2D sPrimitiveHeadersI;
75sampler2D sRenderTasks;
76sampler2D sTransformPalette;
77mat4_scalar uTransform;
78void bind_textures() {
79 sClipMask = lookup_sampler(&samplers.sClipMask_impl, samplers.sClipMask_slot);
80 sColor0 = lookup_sampler(&samplers.sColor0_impl, samplers.sColor0_slot);
81 sGpuBufferF = lookup_sampler(&samplers.sGpuBufferF_impl, samplers.sGpuBufferF_slot);
82 sGpuBufferI = lookup_isampler(&samplers.sGpuBufferI_impl, samplers.sGpuBufferI_slot);
83 sPrimitiveHeadersF = lookup_sampler(&samplers.sPrimitiveHeadersF_impl, samplers.sPrimitiveHeadersF_slot);
84 sPrimitiveHeadersI = lookup_isampler(&samplers.sPrimitiveHeadersI_impl, samplers.sPrimitiveHeadersI_slot);
85 sRenderTasks = lookup_sampler(&samplers.sRenderTasks_impl, samplers.sRenderTasks_slot);
86 sTransformPalette = lookup_sampler(&samplers.sTransformPalette_impl, samplers.sTransformPalette_slot);
87}
88};
89struct brush_image_ADVANCED_BLEND_ALPHA_PASS_ANTIALIASING_REPETITION_TEXTURE_2D_vert : VertexShaderImpl, brush_image_ADVANCED_BLEND_ALPHA_PASS_ANTIALIASING_REPETITION_TEXTURE_2D_common {
90private:
91typedef brush_image_ADVANCED_BLEND_ALPHA_PASS_ANTIALIASING_REPETITION_TEXTURE_2D_vert Self;
92// mat4_scalar uTransform;
93vec2 aPosition;
94// sampler2D sColor0;
95// sampler2D sColor1;
96// sampler2D sColor2;
97struct RectWithSize_scalar {
98vec2_scalar p0;
99vec2_scalar size;
100RectWithSize_scalar() = default;
101RectWithSize_scalar(vec2_scalar p0, vec2_scalar size) : p0(p0), size(size){}
102};
103struct RectWithSize {
104vec2 p0;
105vec2 size;
106RectWithSize() = default;
107RectWithSize(vec2 p0, vec2 size) : p0(p0), size(size){}
108RectWithSize(vec2_scalar p0, vec2_scalar size):p0(p0),size(size){
109}
110IMPLICIT RectWithSize(RectWithSize_scalar s):p0(s.p0),size(s.size){
111}
112friend RectWithSize if_then_else(I32 c, RectWithSize t, RectWithSize e) { return RectWithSize(
113if_then_else(c, t.p0, e.p0), if_then_else(c, t.size, e.size));
114}};
115struct RectWithEndpoint_scalar {
116vec2_scalar p0;
117vec2_scalar p1;
118RectWithEndpoint_scalar() = default;
119RectWithEndpoint_scalar(vec2_scalar p0, vec2_scalar p1) : p0(p0), p1(p1){}
120};
121struct RectWithEndpoint {
122vec2 p0;
123vec2 p1;
124RectWithEndpoint() = default;
125RectWithEndpoint(vec2 p0, vec2 p1) : p0(p0), p1(p1){}
126RectWithEndpoint(vec2_scalar p0, vec2_scalar p1):p0(p0),p1(p1){
127}
128IMPLICIT RectWithEndpoint(RectWithEndpoint_scalar s):p0(s.p0),p1(s.p1){
129}
130friend RectWithEndpoint if_then_else(I32 c, RectWithEndpoint t, RectWithEndpoint e) { return RectWithEndpoint(
131if_then_else(c, t.p0, e.p0), if_then_else(c, t.p1, e.p1));
132}};
133// sampler2D sRenderTasks;
134struct RenderTaskData_scalar {
135RectWithEndpoint_scalar task_rect;
136vec4_scalar user_data;
137RenderTaskData_scalar() = default;
138RenderTaskData_scalar(RectWithEndpoint_scalar task_rect, vec4_scalar user_data) : task_rect(task_rect), user_data(user_data){}
139};
140struct RenderTaskData {
141RectWithEndpoint task_rect;
142vec4 user_data;
143RenderTaskData() = default;
144RenderTaskData(RectWithEndpoint task_rect, vec4 user_data) : task_rect(task_rect), user_data(user_data){}
145RenderTaskData(RectWithEndpoint_scalar task_rect, vec4_scalar user_data):task_rect(task_rect),user_data(user_data){
146}
147IMPLICIT RenderTaskData(RenderTaskData_scalar s):task_rect(s.task_rect),user_data(s.user_data){
148}
149friend RenderTaskData if_then_else(I32 c, RenderTaskData t, RenderTaskData e) { return RenderTaskData(
150if_then_else(c, t.task_rect, e.task_rect), if_then_else(c, t.user_data, e.user_data));
151}};
152struct PictureTask_scalar {
153RectWithEndpoint_scalar task_rect;
154float device_pixel_scale;
155vec2_scalar content_origin;
156PictureTask_scalar() = default;
157PictureTask_scalar(RectWithEndpoint_scalar task_rect, float device_pixel_scale, vec2_scalar content_origin) : task_rect(task_rect), device_pixel_scale(device_pixel_scale), content_origin(content_origin){}
158};
159struct PictureTask {
160RectWithEndpoint task_rect;
161Float device_pixel_scale;
162vec2 content_origin;
163PictureTask() = default;
164PictureTask(RectWithEndpoint task_rect, Float device_pixel_scale, vec2 content_origin) : task_rect(task_rect), device_pixel_scale(device_pixel_scale), content_origin(content_origin){}
165PictureTask(RectWithEndpoint_scalar task_rect, float device_pixel_scale, vec2_scalar content_origin):task_rect(task_rect),device_pixel_scale(device_pixel_scale),content_origin(content_origin){
166}
167IMPLICIT PictureTask(PictureTask_scalar s):task_rect(s.task_rect),device_pixel_scale(s.device_pixel_scale),content_origin(s.content_origin){
168}
169friend PictureTask if_then_else(I32 c, PictureTask t, PictureTask e) { return PictureTask(
170if_then_else(c, t.task_rect, e.task_rect), if_then_else(c, t.device_pixel_scale, e.device_pixel_scale), if_then_else(c, t.content_origin, e.content_origin));
171}};
172struct ClipArea_scalar {
173RectWithEndpoint_scalar task_rect;
174float device_pixel_scale;
175vec2_scalar screen_origin;
176ClipArea_scalar() = default;
177ClipArea_scalar(RectWithEndpoint_scalar task_rect, float device_pixel_scale, vec2_scalar screen_origin) : task_rect(task_rect), device_pixel_scale(device_pixel_scale), screen_origin(screen_origin){}
178};
179struct ClipArea {
180RectWithEndpoint task_rect;
181Float device_pixel_scale;
182vec2 screen_origin;
183ClipArea() = default;
184ClipArea(RectWithEndpoint task_rect, Float device_pixel_scale, vec2 screen_origin) : task_rect(task_rect), device_pixel_scale(device_pixel_scale), screen_origin(screen_origin){}
185ClipArea(RectWithEndpoint_scalar task_rect, float device_pixel_scale, vec2_scalar screen_origin):task_rect(task_rect),device_pixel_scale(device_pixel_scale),screen_origin(screen_origin){
186}
187IMPLICIT ClipArea(ClipArea_scalar s):task_rect(s.task_rect),device_pixel_scale(s.device_pixel_scale),screen_origin(s.screen_origin){
188}
189friend ClipArea if_then_else(I32 c, ClipArea t, ClipArea e) { return ClipArea(
190if_then_else(c, t.task_rect, e.task_rect), if_then_else(c, t.device_pixel_scale, e.device_pixel_scale), if_then_else(c, t.screen_origin, e.screen_origin));
191}};
192// vec4_scalar vTransformBounds;
193// sampler2D sTransformPalette;
194struct Transform_scalar {
195mat4_scalar m;
196mat4_scalar inv_m;
197bool is_axis_aligned;
198Transform_scalar() = default;
199Transform_scalar(mat4_scalar m, mat4_scalar inv_m, bool is_axis_aligned) : m(m), inv_m(inv_m), is_axis_aligned(is_axis_aligned){}
200};
201struct Transform {
202mat4 m;
203mat4 inv_m;
204Bool is_axis_aligned;
205Transform() = default;
206Transform(mat4 m, mat4 inv_m, Bool is_axis_aligned) : m(m), inv_m(inv_m), is_axis_aligned(is_axis_aligned){}
207Transform(mat4_scalar m, mat4_scalar inv_m, bool is_axis_aligned):m(m),inv_m(inv_m),is_axis_aligned(is_axis_aligned){
208}
209IMPLICIT Transform(Transform_scalar s):m(s.m),inv_m(s.inv_m),is_axis_aligned(s.is_axis_aligned){
210}
211friend Transform if_then_else(I32 c, Transform t, Transform e) { return Transform(
212if_then_else(c, t.m, e.m), if_then_else(c, t.inv_m, e.inv_m), if_then_else(c, t.is_axis_aligned, e.is_axis_aligned));
213}};
214// sampler2D sGpuBufferF;
215// isampler2D sGpuBufferI;
216struct ImageSource_scalar {
217RectWithEndpoint_scalar uv_rect;
218vec4_scalar user_data;
219ImageSource_scalar() = default;
220ImageSource_scalar(RectWithEndpoint_scalar uv_rect, vec4_scalar user_data) : uv_rect(uv_rect), user_data(user_data){}
221};
222struct ImageSource {
223RectWithEndpoint uv_rect;
224vec4 user_data;
225ImageSource() = default;
226ImageSource(RectWithEndpoint uv_rect, vec4 user_data) : uv_rect(uv_rect), user_data(user_data){}
227ImageSource(RectWithEndpoint_scalar uv_rect, vec4_scalar user_data):uv_rect(uv_rect),user_data(user_data){
228}
229IMPLICIT ImageSource(ImageSource_scalar s):uv_rect(s.uv_rect),user_data(s.user_data){
230}
231friend ImageSource if_then_else(I32 c, ImageSource t, ImageSource e) { return ImageSource(
232if_then_else(c, t.uv_rect, e.uv_rect), if_then_else(c, t.user_data, e.user_data));
233}};
234struct ImageSourceExtra_scalar {
235vec4_scalar st_tl;
236vec4_scalar st_tr;
237vec4_scalar st_bl;
238vec4_scalar st_br;
239ImageSourceExtra_scalar() = default;
240ImageSourceExtra_scalar(vec4_scalar st_tl, vec4_scalar st_tr, vec4_scalar st_bl, vec4_scalar st_br) : st_tl(st_tl), st_tr(st_tr), st_bl(st_bl), st_br(st_br){}
241};
242struct ImageSourceExtra {
243vec4 st_tl;
244vec4 st_tr;
245vec4 st_bl;
246vec4 st_br;
247ImageSourceExtra() = default;
248ImageSourceExtra(vec4 st_tl, vec4 st_tr, vec4 st_bl, vec4 st_br) : st_tl(st_tl), st_tr(st_tr), st_bl(st_bl), st_br(st_br){}
249ImageSourceExtra(vec4_scalar st_tl, vec4_scalar st_tr, vec4_scalar st_bl, vec4_scalar st_br):st_tl(st_tl),st_tr(st_tr),st_bl(st_bl),st_br(st_br){
250}
251IMPLICIT ImageSourceExtra(ImageSourceExtra_scalar s):st_tl(s.st_tl),st_tr(s.st_tr),st_bl(s.st_bl),st_br(s.st_br){
252}
253friend ImageSourceExtra if_then_else(I32 c, ImageSourceExtra t, ImageSourceExtra e) { return ImageSourceExtra(
254if_then_else(c, t.st_tl, e.st_tl), if_then_else(c, t.st_tr, e.st_tr), if_then_else(c, t.st_bl, e.st_bl), if_then_else(c, t.st_br, e.st_br));
255}};
256// sampler2D sClipMask;
257// sampler2D sPrimitiveHeadersF;
258// isampler2D sPrimitiveHeadersI;
259ivec4_scalar aData;
260struct Instance_scalar {
261int32_t prim_header_address;
262int32_t clip_address;
263int32_t segment_index;
264int32_t flags;
265int32_t resource_address;
266int32_t brush_kind;
267Instance_scalar() = default;
268Instance_scalar(int32_t prim_header_address, int32_t clip_address, int32_t segment_index, int32_t flags, int32_t resource_address, int32_t brush_kind) : prim_header_address(prim_header_address), clip_address(clip_address), segment_index(segment_index), flags(flags), resource_address(resource_address), brush_kind(brush_kind){}
269};
270struct Instance {
271I32 prim_header_address;
272I32 clip_address;
273I32 segment_index;
274I32 flags;
275I32 resource_address;
276I32 brush_kind;
277Instance() = default;
278Instance(I32 prim_header_address, I32 clip_address, I32 segment_index, I32 flags, I32 resource_address, I32 brush_kind) : prim_header_address(prim_header_address), clip_address(clip_address), segment_index(segment_index), flags(flags), resource_address(resource_address), brush_kind(brush_kind){}
279Instance(int32_t prim_header_address, int32_t clip_address, int32_t segment_index, int32_t flags, int32_t resource_address, int32_t brush_kind):prim_header_address(prim_header_address),clip_address(clip_address),segment_index(segment_index),flags(flags),resource_address(resource_address),brush_kind(brush_kind){
280}
281IMPLICIT Instance(Instance_scalar s):prim_header_address(s.prim_header_address),clip_address(s.clip_address),segment_index(s.segment_index),flags(s.flags),resource_address(s.resource_address),brush_kind(s.brush_kind){
282}
283friend Instance if_then_else(I32 c, Instance t, Instance e) { return Instance(
284if_then_else(c, t.prim_header_address, e.prim_header_address), if_then_else(c, t.clip_address, e.clip_address), if_then_else(c, t.segment_index, e.segment_index), if_then_else(c, t.flags, e.flags), if_then_else(c, t.resource_address, e.resource_address), if_then_else(c, t.brush_kind, e.brush_kind));
285}};
286struct PrimitiveHeader_scalar {
287RectWithEndpoint_scalar local_rect;
288RectWithEndpoint_scalar local_clip_rect;
289float z;
290int32_t specific_prim_address;
291int32_t transform_id;
292int32_t picture_task_address;
293ivec4_scalar user_data;
294PrimitiveHeader_scalar() = default;
295PrimitiveHeader_scalar(RectWithEndpoint_scalar local_rect, RectWithEndpoint_scalar local_clip_rect, float z, int32_t specific_prim_address, int32_t transform_id, int32_t picture_task_address, ivec4_scalar user_data) : local_rect(local_rect), local_clip_rect(local_clip_rect), z(z), specific_prim_address(specific_prim_address), transform_id(transform_id), picture_task_address(picture_task_address), user_data(user_data){}
296};
297struct PrimitiveHeader {
298RectWithEndpoint local_rect;
299RectWithEndpoint local_clip_rect;
300Float z;
301I32 specific_prim_address;
302I32 transform_id;
303I32 picture_task_address;
304ivec4 user_data;
305PrimitiveHeader() = default;
306PrimitiveHeader(RectWithEndpoint local_rect, RectWithEndpoint local_clip_rect, Float z, I32 specific_prim_address, I32 transform_id, I32 picture_task_address, ivec4 user_data) : local_rect(local_rect), local_clip_rect(local_clip_rect), z(z), specific_prim_address(specific_prim_address), transform_id(transform_id), picture_task_address(picture_task_address), user_data(user_data){}
307PrimitiveHeader(RectWithEndpoint_scalar local_rect, RectWithEndpoint_scalar local_clip_rect, float z, int32_t specific_prim_address, int32_t transform_id, int32_t picture_task_address, ivec4_scalar user_data):local_rect(local_rect),local_clip_rect(local_clip_rect),z(z),specific_prim_address(specific_prim_address),transform_id(transform_id),picture_task_address(picture_task_address),user_data(user_data){
308}
309IMPLICIT PrimitiveHeader(PrimitiveHeader_scalar s):local_rect(s.local_rect),local_clip_rect(s.local_clip_rect),z(s.z),specific_prim_address(s.specific_prim_address),transform_id(s.transform_id),picture_task_address(s.picture_task_address),user_data(s.user_data){
310}
311friend PrimitiveHeader if_then_else(I32 c, PrimitiveHeader t, PrimitiveHeader e) { return PrimitiveHeader(
312if_then_else(c, t.local_rect, e.local_rect), if_then_else(c, t.local_clip_rect, e.local_clip_rect), if_then_else(c, t.z, e.z), if_then_else(c, t.specific_prim_address, e.specific_prim_address), if_then_else(c, t.transform_id, e.transform_id), if_then_else(c, t.picture_task_address, e.picture_task_address), if_then_else(c, t.user_data, e.user_data));
313}};
314struct VertexInfo_scalar {
315vec2_scalar local_pos;
316vec4_scalar world_pos;
317VertexInfo_scalar() = default;
318VertexInfo_scalar(vec2_scalar local_pos, vec4_scalar world_pos) : local_pos(local_pos), world_pos(world_pos){}
319};
320struct VertexInfo {
321vec2 local_pos;
322vec4 world_pos;
323VertexInfo() = default;
324VertexInfo(vec2 local_pos, vec4 world_pos) : local_pos(local_pos), world_pos(world_pos){}
325VertexInfo(vec2_scalar local_pos, vec4_scalar world_pos):local_pos(local_pos),world_pos(world_pos){
326}
327IMPLICIT VertexInfo(VertexInfo_scalar s):local_pos(s.local_pos),world_pos(s.world_pos){
328}
329friend VertexInfo if_then_else(I32 c, VertexInfo t, VertexInfo e) { return VertexInfo(
330if_then_else(c, t.local_pos, e.local_pos), if_then_else(c, t.world_pos, e.world_pos));
331}};
332vec2 v_uv;
333// vec4_scalar v_color;
334// vec2_scalar v_mask_swizzle;
335// vec2_scalar v_tile_repeat_bounds;
336// vec4_scalar v_uv_bounds;
337// vec4_scalar v_uv_sample_bounds;
338// vec2_scalar v_perspective;
339struct ImageBrushPrimitiveData_scalar {
340vec4_scalar color;
341vec4_scalar background_color;
342vec2_scalar stretch_size;
343ImageBrushPrimitiveData_scalar() = default;
344ImageBrushPrimitiveData_scalar(vec4_scalar color, vec4_scalar background_color, vec2_scalar stretch_size) : color(color), background_color(background_color), stretch_size(stretch_size){}
345};
346struct ImageBrushPrimitiveData {
347vec4 color;
348vec4 background_color;
349vec2 stretch_size;
350ImageBrushPrimitiveData() = default;
351ImageBrushPrimitiveData(vec4 color, vec4 background_color, vec2 stretch_size) : color(color), background_color(background_color), stretch_size(stretch_size){}
352ImageBrushPrimitiveData(vec4_scalar color, vec4_scalar background_color, vec2_scalar stretch_size):color(color),background_color(background_color),stretch_size(stretch_size){
353}
354IMPLICIT ImageBrushPrimitiveData(ImageBrushPrimitiveData_scalar s):color(s.color),background_color(s.background_color),stretch_size(s.stretch_size){
355}
356friend ImageBrushPrimitiveData if_then_else(I32 c, ImageBrushPrimitiveData t, ImageBrushPrimitiveData e) { return ImageBrushPrimitiveData(
357if_then_else(c, t.color, e.color), if_then_else(c, t.background_color, e.background_color), if_then_else(c, t.stretch_size, e.stretch_size));
358}};
359Instance_scalar decode_instance_attributes() {
360 Instance_scalar instance;
361 (instance).prim_header_address = (aData).x;
362 (instance).clip_address = (aData).y;
363 (instance).segment_index = ((aData).z)&(65535);
364 (instance).flags = ((aData).z)>>(16);
365 (instance).resource_address = ((aData).w)&(16777215);
366 (instance).brush_kind = ((aData).w)>>(24);
367 return instance;
368}
369PrimitiveHeader_scalar fetch_prim_header(int32_t index) {
370 PrimitiveHeader_scalar ph;
371 ivec2_scalar uv_f = make_ivec2(make_int((2u)*((make_uint(index))%((1024u)/(2u)))), make_int((make_uint(index))/((1024u)/(2u))));
372 auto sPrimitiveHeadersF_uv_f_fetch = texelFetchPtr(sPrimitiveHeadersF, uv_f, 0, 1, 0, 0);
373 vec4_scalar local_rect = texelFetchUnchecked(sPrimitiveHeadersF, sPrimitiveHeadersF_uv_f_fetch, 0, 0);
374 vec4_scalar local_clip_rect = texelFetchUnchecked(sPrimitiveHeadersF, sPrimitiveHeadersF_uv_f_fetch, 1, 0);
375 (ph).local_rect = RectWithEndpoint_scalar((local_rect).sel(X,Y), (local_rect).sel(Z,W));
376 (ph).local_clip_rect = RectWithEndpoint_scalar((local_clip_rect).sel(X,Y), (local_clip_rect).sel(Z,W));
377 ivec2_scalar uv_i = make_ivec2(make_int((2u)*((make_uint(index))%((1024u)/(2u)))), make_int((make_uint(index))/((1024u)/(2u))));
378 auto sPrimitiveHeadersI_uv_i_fetch = texelFetchPtr(sPrimitiveHeadersI, uv_i, 0, 1, 0, 0);
379 ivec4_scalar data0 = texelFetchUnchecked(sPrimitiveHeadersI, sPrimitiveHeadersI_uv_i_fetch, 0, 0);
380 ivec4_scalar data1 = texelFetchUnchecked(sPrimitiveHeadersI, sPrimitiveHeadersI_uv_i_fetch, 1, 0);
381 (ph).z = make_float((data0).x);
382 (ph).specific_prim_address = (data0).y;
383 (ph).transform_id = (data0).z;
384 (ph).picture_task_address = (data0).w;
385 (ph).user_data = data1;
386 return ph;
387}
388Transform_scalar fetch_transform(int32_t id) {
389 Transform_scalar transform;
390 (transform).is_axis_aligned = ((id)>>(23))==(0);
391 int32_t index = (id)&(4194303);
392 ivec2_scalar uv = make_ivec2(make_int((8u)*((make_uint(index))%((1024u)/(8u)))), make_int((make_uint(index))/((1024u)/(8u))));
393 ivec2_scalar uv0 = make_ivec2(((uv).x)+(0), (uv).y);
394 auto sTransformPalette_uv0_fetch = texelFetchPtr(sTransformPalette, uv0, 0, 7, 0, 0);
395 (transform).m[0] = texelFetchUnchecked(sTransformPalette, sTransformPalette_uv0_fetch, 0, 0);
396 (transform).m[1] = texelFetchUnchecked(sTransformPalette, sTransformPalette_uv0_fetch, 1, 0);
397 (transform).m[2] = texelFetchUnchecked(sTransformPalette, sTransformPalette_uv0_fetch, 2, 0);
398 (transform).m[3] = texelFetchUnchecked(sTransformPalette, sTransformPalette_uv0_fetch, 3, 0);
399 (transform).inv_m[0] = texelFetchUnchecked(sTransformPalette, sTransformPalette_uv0_fetch, 4, 0);
400 (transform).inv_m[1] = texelFetchUnchecked(sTransformPalette, sTransformPalette_uv0_fetch, 5, 0);
401 (transform).inv_m[2] = texelFetchUnchecked(sTransformPalette, sTransformPalette_uv0_fetch, 6, 0);
402 (transform).inv_m[3] = texelFetchUnchecked(sTransformPalette, sTransformPalette_uv0_fetch, 7, 0);
403 return transform;
404}
405RenderTaskData_scalar fetch_render_task_data(int32_t index) {
406 ivec2_scalar uv = make_ivec2(make_int((2u)*((make_uint(index))%((1024u)/(2u)))), make_int((make_uint(index))/((1024u)/(2u))));
407 auto sRenderTasks_uv_fetch = texelFetchPtr(sRenderTasks, uv, 0, 1, 0, 0);
408 vec4_scalar texel0 = texelFetchUnchecked(sRenderTasks, sRenderTasks_uv_fetch, 0, 0);
409 vec4_scalar texel1 = texelFetchUnchecked(sRenderTasks, sRenderTasks_uv_fetch, 1, 0);
410 RectWithEndpoint_scalar task_rect = RectWithEndpoint_scalar((texel0).sel(X,Y), (texel0).sel(Z,W));
411 RenderTaskData_scalar data = RenderTaskData_scalar(task_rect, texel1);
412 return data;
413}
414PictureTask_scalar fetch_picture_task(int32_t address) {
415 RenderTaskData_scalar task_data = fetch_render_task_data(address);
416 PictureTask_scalar task = PictureTask_scalar((task_data).task_rect, ((task_data).user_data).x, ((task_data).user_data).sel(Y,Z));
417 return task;
418}
419ClipArea_scalar fetch_clip_area(int32_t index) {
420 RenderTaskData_scalar task_data;
421 if ((index)>=(2147483647)) {
422 {
423 task_data = RenderTaskData_scalar(RectWithEndpoint_scalar(make_vec2(0.f), make_vec2(0.f)), make_vec4(0.f));
424 }
425 } else {
426 task_data = fetch_render_task_data(index);
427 }
428 return ClipArea_scalar((task_data).task_rect, ((task_data).user_data).x, ((task_data).user_data).sel(Y,Z));
429}
430ivec2_scalar get_gpu_buffer_uv(int32_t address) {
431 return make_ivec2((make_uint(address))%(1024u), (make_uint(address))/(1024u));
432}
433Array<vec4_scalar,2> fetch_from_gpu_buffer_2f_direct(ivec2_scalar uv) {
434 auto sGpuBufferF_uv_fetch = texelFetchPtr(sGpuBufferF, uv, 0, 1, 0, 0);
435 return Array<vec4_scalar,2>{{texelFetchUnchecked(sGpuBufferF, sGpuBufferF_uv_fetch, 0, 0), texelFetchUnchecked(sGpuBufferF, sGpuBufferF_uv_fetch, 1, 0)}};
436}
437Array<vec4_scalar,2> fetch_from_gpu_buffer_2f(int32_t address) {
438 ivec2_scalar uv = get_gpu_buffer_uv(address);
439 return fetch_from_gpu_buffer_2f_direct(uv);
440}
441RectWithEndpoint_scalar clip_and_init_antialiasing(RectWithEndpoint_scalar segment_rect, RectWithEndpoint_scalar prim_rect, RectWithEndpoint_scalar clip_rect, int32_t edge_flags, float z, Transform_scalar transform, PictureTask_scalar task) {
442 bvec4_scalar clipped = make_bvec4(greaterThan((clip_rect).p0, (segment_rect).p0), lessThan((clip_rect).p1, (segment_rect).p1));
443 swgl_antiAlias((edge_flags)|(((clipped).x ? 1 : 0)|(((clipped).y ? 2 : 0)|(((clipped).z ? 4 : 0)|((clipped).w ? 8 : 0)))))do { swgl_AAEdgeMask = calcAAEdgeMask((edge_flags)|(((clipped
).x ? 1 : 0)|(((clipped).y ? 2 : 0)|(((clipped).z ? 4 : 0)|((
clipped).w ? 8 : 0))))); if (swgl_AAEdgeMask) { swgl_ClipFlags
|= SWGL_CLIP_FLAG_AA; } } while (0)
;
444 (segment_rect).p0 = clamp((segment_rect).p0, (clip_rect).p0, (clip_rect).p1);
445 (segment_rect).p1 = clamp((segment_rect).p1, (clip_rect).p0, (clip_rect).p1);
446 return segment_rect;
447}
448vec2 rect_clamp(RectWithEndpoint_scalar rect, vec2 pt) {
449 return clamp(pt, (rect).p0, (rect).p1);
450}
451VertexInfo write_vertex(vec2 local_pos, RectWithEndpoint_scalar local_clip_rect, float z, Transform_scalar transform, PictureTask_scalar task) {
452 vec2 clamped_local_pos = rect_clamp(local_clip_rect, local_pos);
453 vec4 world_pos = ((transform).m)*(make_vec4(clamped_local_pos, 0.f, 1.f));
454 vec2 device_pos = ((world_pos).sel(X,Y))*((task).device_pixel_scale);
455 vec2_scalar final_offset = (-((task).content_origin))+(((task).task_rect).p0);
456 gl_Position = (uTransform)*(make_vec4((device_pos)+((final_offset)*((world_pos).w)), (z)*((world_pos).w), (world_pos).w));
457 VertexInfo vi = VertexInfo(clamped_local_pos, world_pos);
458 return vi;
459}
460vec2_scalar rect_size(RectWithEndpoint_scalar rect) {
461 return ((rect).p1)-((rect).p0);
462}
463void write_clip(vec4 world_pos, ClipArea_scalar area, PictureTask_scalar task) {
464 swgl_clipMask(sClipMask, ((((task).task_rect).p0)-((task).content_origin))-((((area).task_rect).p0)-((area).screen_origin)), ((area).task_rect).p0, rect_size((area).task_rect))do { if (rect_size((area).task_rect) != vec2_scalar(0.0f, 0.0f
)) { swgl_ClipFlags |= SWGL_CLIP_FLAG_MASK; swgl_ClipMask = sClipMask
; swgl_ClipMaskOffset = make_ivec2(((((task).task_rect).p0)-(
(task).content_origin))-((((area).task_rect).p0)-((area).screen_origin
))); swgl_ClipMaskBounds = IntRect(make_ivec2(((area).task_rect
).p0), make_ivec2(rect_size((area).task_rect))); } } while (0
)
;
465}
466Array<vec4_scalar,3> fetch_from_gpu_buffer_3f_direct(ivec2_scalar uv) {
467 auto sGpuBufferF_uv_fetch = texelFetchPtr(sGpuBufferF, uv, 0, 2, 0, 0);
468 return Array<vec4_scalar,3>{{texelFetchUnchecked(sGpuBufferF, sGpuBufferF_uv_fetch, 0, 0), texelFetchUnchecked(sGpuBufferF, sGpuBufferF_uv_fetch, 1, 0), texelFetchUnchecked(sGpuBufferF, sGpuBufferF_uv_fetch, 2, 0)}};
469}
470Array<vec4_scalar,3> fetch_from_gpu_buffer_3f(int32_t address) {
471 ivec2_scalar uv = get_gpu_buffer_uv(address);
472 return fetch_from_gpu_buffer_3f_direct(uv);
473}
474ImageBrushPrimitiveData_scalar fetch_image_data(int32_t address) {
475 Array<vec4_scalar,3> raw_data = fetch_from_gpu_buffer_3f(address);
476 ImageBrushPrimitiveData_scalar data = ImageBrushPrimitiveData_scalar(raw_data[0], raw_data[1], (raw_data[2]).sel(X,Y));
477 return data;
478}
479ImageSource_scalar fetch_image_source(int32_t address) {
480 Array<vec4_scalar,2> data = fetch_from_gpu_buffer_2f(address);
481 RectWithEndpoint_scalar uv_rect = RectWithEndpoint_scalar((data[0]).sel(X,Y), (data[0]).sel(Z,W));
482 return ImageSource_scalar(uv_rect, data[1]);
483}
484Array<vec4_scalar,4> fetch_from_gpu_buffer_4f_direct(ivec2_scalar uv) {
485 auto sGpuBufferF_uv_fetch = texelFetchPtr(sGpuBufferF, uv, 0, 3, 0, 0);
486 return Array<vec4_scalar,4>{{texelFetchUnchecked(sGpuBufferF, sGpuBufferF_uv_fetch, 0, 0), texelFetchUnchecked(sGpuBufferF, sGpuBufferF_uv_fetch, 1, 0), texelFetchUnchecked(sGpuBufferF, sGpuBufferF_uv_fetch, 2, 0), texelFetchUnchecked(sGpuBufferF, sGpuBufferF_uv_fetch, 3, 0)}};
487}
488Array<vec4_scalar,4> fetch_from_gpu_buffer_4f(int32_t address) {
489 ivec2_scalar uv = get_gpu_buffer_uv(address);
490 return fetch_from_gpu_buffer_4f_direct(uv);
491}
492ImageSourceExtra_scalar fetch_image_source_extra(int32_t address) {
493 Array<vec4_scalar,4> data = fetch_from_gpu_buffer_4f((address)+(2));
494 return ImageSourceExtra_scalar(data[0], data[1], data[2], data[3]);
495}
496vec2 get_image_quad_uv(int32_t address, vec2 f) {
497 ImageSourceExtra_scalar extra_data = fetch_image_source_extra(address);
498 vec4 x = mix((extra_data).st_tl, (extra_data).st_tr, (f).x);
499 vec4 y = mix((extra_data).st_bl, (extra_data).st_br, (f).x);
500 vec4 z = mix(x, y, (f).y);
501 return ((z).sel(X,Y))/((z).w);
502}
503void brush_vs(VertexInfo vi, int32_t prim_address, RectWithEndpoint_scalar prim_rect, RectWithEndpoint_scalar segment_rect, ivec4_scalar prim_user_data, int32_t specific_resource_address, mat4_scalar transform, PictureTask_scalar pic_task, int32_t brush_flags, vec4_scalar segment_data) {
504 ImageBrushPrimitiveData_scalar image_data = fetch_image_data(prim_address);
505 vec2_scalar texture_size = make_vec2(textureSize(sColor0, 0));
506 ImageSource_scalar res = fetch_image_source(specific_resource_address);
507 vec2_scalar uv0 = ((res).uv_rect).p0;
508 vec2_scalar uv1 = ((res).uv_rect).p1;
509 RectWithEndpoint_scalar local_rect = prim_rect;
510 vec2_scalar stretch_size = (image_data).stretch_size;
511 if (((stretch_size).x)<(0.f)) {
512 {
513 stretch_size = rect_size(local_rect);
514 }
515 }
516 if (((brush_flags)&(2))!=(0)) {
517 {
518 local_rect = segment_rect;
519 stretch_size = rect_size(local_rect);
520 if (((brush_flags)&(512))!=(0)) {
521 {
522 vec2_scalar uv_size = (((res).uv_rect).p1)-(((res).uv_rect).p0);
523 uv0 = (((res).uv_rect).p0)+(((segment_data).sel(X,Y))*(uv_size));
524 uv1 = (((res).uv_rect).p0)+(((segment_data).sel(Z,W))*(uv_size));
525 }
526 }
527 if (((brush_flags)&(512))!=(0)) {
528 {
529 vec2_scalar repeated_stretch_size = stretch_size;
530 vec2_scalar horizontal_uv_size = (uv1)-(uv0);
531 vec2_scalar vertical_uv_size = (uv1)-(uv0);
532 if (((brush_flags)&(256))!=(0)) {
533 {
534 repeated_stretch_size = ((segment_rect).p0)-((prim_rect).p0);
535 float epsilon = 0.001f;
536 (vertical_uv_size).x = ((uv0).x)-((((res).uv_rect).p0).x);
537 if ((((vertical_uv_size).x)<(epsilon))||(((repeated_stretch_size).x)<(epsilon))) {
538 {
539 (vertical_uv_size).x = ((((res).uv_rect).p1).x)-((uv1).x);
540 (repeated_stretch_size).x = (((prim_rect).p1).x)-(((segment_rect).p1).x);
541 }
542 }
543 (horizontal_uv_size).y = ((uv0).y)-((((res).uv_rect).p0).y);
544 if ((((horizontal_uv_size).y)<(epsilon))||(((repeated_stretch_size).y)<(epsilon))) {
545 {
546 (horizontal_uv_size).y = ((((res).uv_rect).p1).y)-((uv1).y);
547 (repeated_stretch_size).y = (((prim_rect).p1).y)-(((segment_rect).p1).y);
548 }
549 }
550 }
551 }
552 if (((brush_flags)&(4))!=(0)) {
553 {
554 float uv_ratio = ((horizontal_uv_size).x)/((horizontal_uv_size).y);
555 (stretch_size).x = ((repeated_stretch_size).y)*(uv_ratio);
556 }
557 }
558 if (((brush_flags)&(8))!=(0)) {
559 {
560 float uv_ratio = ((vertical_uv_size).y)/((vertical_uv_size).x);
561 (stretch_size).y = ((repeated_stretch_size).x)*(uv_ratio);
562 }
563 }
564 }
565 } else {
566 if (((brush_flags)&(4))!=(0)) {
567 {
568 (stretch_size).x = ((segment_data).z)-((segment_data).x);
569 }
570 }
571 if (((brush_flags)&(8))!=(0)) {
572 {
573 (stretch_size).y = ((segment_data).w)-((segment_data).y);
574 }
575 }
576 }
577 if (((brush_flags)&(16))!=(0)) {
578 {
579 float segment_rect_width = (((segment_rect).p1).x)-(((segment_rect).p0).x);
580 float nx = max(1.f, round__glsl_round((segment_rect_width)/((stretch_size).x)));
581 (stretch_size).x = (segment_rect_width)/(nx);
582 }
583 }
584 if (((brush_flags)&(32))!=(0)) {
585 {
586 float segment_rect_height = (((segment_rect).p1).y)-(((segment_rect).p0).y);
587 float ny = max(1.f, round__glsl_round((segment_rect_height)/((stretch_size).y)));
588 (stretch_size).y = (segment_rect_height)/(ny);
589 }
590 }
591 }
592 }
593 float perspective_interpolate = ((brush_flags)&(1))!=(0) ? 1.f : 0.f;
594 (v_perspective).x = perspective_interpolate;
595 vec2_scalar min_uv = min(uv0, uv1);
596 vec2_scalar max_uv = max(uv0, uv1);
597 v_uv_sample_bounds = (make_vec4((min_uv)+(make_vec2(0.5f)), (max_uv)-(make_vec2(0.5f))))/((texture_size).sel(X,Y,X,Y));
598 vec2 f = (((vi).local_pos)-((local_rect).p0))/(rect_size(local_rect));
599 int32_t color_mode = ((prim_user_data).x)&(65535);
600 int32_t blend_mode = ((prim_user_data).x)>>(16);
601 int32_t raster_space = (prim_user_data).y;
602 if ((raster_space)==(1)) {
603 {
604 f = get_image_quad_uv(specific_resource_address, f);
605 }
606 }
607 vec2_scalar repeat = (rect_size(local_rect))/(stretch_size);
608 v_uv = (mix(uv0, uv1, f))-(min_uv);
609 v_uv *= (repeat).sel(X,Y);
610 vec2_scalar normalized_offset = make_vec2(0.f);
611 bvec2_scalar centered = make_bvec2(((brush_flags)&(64))!=(0), ((brush_flags)&(128))!=(0));
612 normalized_offset = mix(make_vec2(0.f), (1.f)-(fract(((repeat)*(0.5f))+(0.5f))), centered);
613 v_uv += (normalized_offset)*((max_uv)-(min_uv));
614 v_uv /= texture_size;
615 if ((perspective_interpolate)==(0.f)) {
616 {
617 v_uv *= ((vi).world_pos).w;
618 }
619 }
620 v_uv_bounds = (make_vec4(min_uv, max_uv))/((texture_size).sel(X,Y,X,Y));
621 v_uv /= ((v_uv_bounds).sel(Z,W))-((v_uv_bounds).sel(X,Y));
622 v_tile_repeat_bounds = ((repeat).sel(X,Y))+(normalized_offset);
623 float opacity = (make_float((prim_user_data).z))/(65535.f);
624 switch (blend_mode) {
625 case 0:
626 ((image_data).color).w *= opacity;
627 break;
628 case 1:
629 default:
630 (image_data).color *= opacity;
631 break;
632 }
633 switch (color_mode) {
634 case 0:
635 case 2:
636 swgl_blendDropShadow((image_data).color)do { swgl_ClipFlags |= SWGL_CLIP_FLAG_BLEND_OVERRIDE; swgl_BlendOverride
= BLEND_0xB001000; swgl_BlendColorRGBA8 = packColor<uint32_t
>((image_data).color); } while (0)
;
637 v_mask_swizzle = make_vec2(1.f, 0.f);
638 v_color = make_vec4(1.f);
639 break;
640 case 4:
641 v_mask_swizzle = make_vec2(1.f, 0.f);
642 v_color = (image_data).color;
643 break;
644 case 3:
645 v_mask_swizzle = make_vec2(1.f, 0.f);
646 v_color = make_vec4(((image_data).color).w);
647 break;
648 case 1:
649 v_mask_swizzle = make_vec2(((image_data).color).w, 0.f);
650 v_color = (image_data).color;
651 break;
652 case 5:
653 v_mask_swizzle = make_vec2(-(((image_data).color).w), ((image_data).color).w);
654 v_color = (image_data).color;
655 break;
656 default:
657 v_mask_swizzle = make_vec2(0.f);
658 v_color = make_vec4(1.f);
659 }
660}
661void brush_shader_main_vs(Instance_scalar instance, PrimitiveHeader_scalar ph, Transform_scalar transform, PictureTask_scalar pic_task, ClipArea_scalar clip_area) {
662 int32_t edge_flags = (((instance).flags)>>(12))&(15);
663 int32_t brush_flags = ((instance).flags)&(4095);
664 vec4_scalar segment_data;
665 RectWithEndpoint_scalar segment_rect;
666 if (((instance).segment_index)==(65535)) {
667 {
668 segment_rect = (ph).local_rect;
669 segment_data = make_vec4(0.f);
670 }
671 } else {
672 int32_t segment_address = (((ph).specific_prim_address)+(3))+(((instance).segment_index)*(2));
673 Array<vec4_scalar,2> segment_info = fetch_from_gpu_buffer_2f(segment_address);
674 segment_rect = RectWithEndpoint_scalar((segment_info[0]).sel(X,Y), (segment_info[0]).sel(Z,W));
675 (segment_rect).p0 += ((ph).local_rect).p0;
676 (segment_rect).p1 += ((ph).local_rect).p0;
677 segment_data = segment_info[1];
678 }
679 RectWithEndpoint_scalar adjusted_segment_rect = segment_rect;
680 bool antialiased = (!((transform).is_axis_aligned))||(((brush_flags)&(1024))!=(0));
681 if (antialiased) {
682 {
683 adjusted_segment_rect = clip_and_init_antialiasing(segment_rect, (ph).local_rect, (ph).local_clip_rect, edge_flags, (ph).z, transform, pic_task);
684 ((ph).local_clip_rect).p0 = make_vec2(-(10000000000000000.f));
685 ((ph).local_clip_rect).p1 = make_vec2(10000000000000000.f);
686 }
687 } else {
688 }
689 vec2 local_pos = mix((adjusted_segment_rect).p0, (adjusted_segment_rect).p1, (aPosition).sel(X,Y));
690 VertexInfo vi = write_vertex(local_pos, (ph).local_clip_rect, (ph).z, transform, pic_task);
691 write_clip((vi).world_pos, clip_area, pic_task);
692 brush_vs(vi, (ph).specific_prim_address, (ph).local_rect, segment_rect, (ph).user_data, (instance).resource_address, (transform).m, pic_task, brush_flags, segment_data);
693}
694ALWAYS_INLINE__attribute__((always_inline)) inline void main(void) {
695 Instance_scalar instance = decode_instance_attributes();
696 PrimitiveHeader_scalar ph = fetch_prim_header((instance).prim_header_address);
697 Transform_scalar transform = fetch_transform((ph).transform_id);
698 PictureTask_scalar task = fetch_picture_task((ph).picture_task_address);
699 ClipArea_scalar clip_area = fetch_clip_area((instance).clip_address);
700 brush_shader_main_vs(instance, ph, transform, task, clip_area);
701}
702static void set_uniform_1i(VertexShaderImpl* impl, int index, int value) {
703 Self* self = (Self*)impl;
704 if (self->samplers.set_slot(index, value)) return;
705 switch (index) {
706 case 8:
707 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sClipMask
708 break;
709 case 9:
710 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sColor0
711 break;
712 case 3:
713 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sGpuBufferF
714 break;
715 case 4:
716 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sGpuBufferI
717 break;
718 case 5:
719 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sPrimitiveHeadersF
720 break;
721 case 6:
722 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sPrimitiveHeadersI
723 break;
724 case 1:
725 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sRenderTasks
726 break;
727 case 2:
728 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sTransformPalette
729 break;
730 case 7:
731 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // uTransform
732 break;
733 }
734}
735static void set_uniform_4fv(VertexShaderImpl* impl, int index, const float *value) {
736 Self* self = (Self*)impl;
737 switch (index) {
738 case 8:
739 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sClipMask
740 break;
741 case 9:
742 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sColor0
743 break;
744 case 3:
745 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sGpuBufferF
746 break;
747 case 4:
748 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sGpuBufferI
749 break;
750 case 5:
751 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sPrimitiveHeadersF
752 break;
753 case 6:
754 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sPrimitiveHeadersI
755 break;
756 case 1:
757 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sRenderTasks
758 break;
759 case 2:
760 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sTransformPalette
761 break;
762 case 7:
763 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // uTransform
764 break;
765 }
766}
767static void set_uniform_matrix4fv(VertexShaderImpl* impl, int index, const float *value) {
768 Self* self = (Self*)impl;
769 switch (index) {
770 case 8:
771 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sClipMask
772 break;
773 case 9:
774 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sColor0
775 break;
776 case 3:
777 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sGpuBufferF
778 break;
779 case 4:
780 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sGpuBufferI
781 break;
782 case 5:
783 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sPrimitiveHeadersF
784 break;
785 case 6:
786 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sPrimitiveHeadersI
787 break;
788 case 1:
789 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sRenderTasks
790 break;
791 case 2:
792 assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
; // sTransformPalette
793 break;
794 case 7:
795 self->uTransform = mat4_scalar::load_from_ptr(value);
796 break;
797 }
798}
799static void load_attribs(VertexShaderImpl* impl, VertexAttrib *attribs, uint32_t start, int instance, int count) {Self* self = (Self*)impl;
800 load_attrib(self->aPosition, attribs[self->attrib_locations.aPosition], start, instance, count);
801 load_flat_attrib(self->aData, attribs[self->attrib_locations.aData], start, instance, count);
802}
803public:
804struct InterpOutputs {
805vec2_scalar v_uv;
806};
807private:
808ALWAYS_INLINE__attribute__((always_inline)) inline void store_interp_outputs(char* dest_ptr, size_t stride) {
809 for(int n = 0; n < 4; n++) {
810 auto* dest = reinterpret_cast<InterpOutputs*>(dest_ptr);
811 dest->v_uv = get_nth(v_uv, n);
812 dest_ptr += stride;
813 }
814}
815static void run(VertexShaderImpl* impl, char* interps, size_t interp_stride) {
816 Self* self = (Self*)impl;
817 self->main();
818 self->store_interp_outputs(interps, interp_stride);
819}
820static void init_batch(VertexShaderImpl* impl) {
821 Self* self = (Self*)impl; self->bind_textures(); }
822public:
823brush_image_ADVANCED_BLEND_ALPHA_PASS_ANTIALIASING_REPETITION_TEXTURE_2D_vert() {
824 set_uniform_1i_func = &set_uniform_1i;
825 set_uniform_4fv_func = &set_uniform_4fv;
826 set_uniform_matrix4fv_func = &set_uniform_matrix4fv;
827 init_batch_func = &init_batch;
828 load_attribs_func = &load_attribs;
829 run_primitive_func = &run;
830}
831};
832
833
834struct brush_image_ADVANCED_BLEND_ALPHA_PASS_ANTIALIASING_REPETITION_TEXTURE_2D_frag : FragmentShaderImpl, brush_image_ADVANCED_BLEND_ALPHA_PASS_ANTIALIASING_REPETITION_TEXTURE_2D_vert {
835private:
836typedef brush_image_ADVANCED_BLEND_ALPHA_PASS_ANTIALIASING_REPETITION_TEXTURE_2D_frag Self;
837#define oFragColorgl_FragColor gl_FragColor
838// vec4 oFragColor;
839// sampler2D sColor0;
840// sampler2D sColor1;
841// sampler2D sColor2;
842struct RectWithSize_scalar {
843vec2_scalar p0;
844vec2_scalar size;
845RectWithSize_scalar() = default;
846RectWithSize_scalar(vec2_scalar p0, vec2_scalar size) : p0(p0), size(size){}
847};
848struct RectWithSize {
849vec2 p0;
850vec2 size;
851RectWithSize() = default;
852RectWithSize(vec2 p0, vec2 size) : p0(p0), size(size){}
853RectWithSize(vec2_scalar p0, vec2_scalar size):p0(p0),size(size){
854}
855IMPLICIT RectWithSize(RectWithSize_scalar s):p0(s.p0),size(s.size){
856}
857friend RectWithSize if_then_else(I32 c, RectWithSize t, RectWithSize e) { return RectWithSize(
858if_then_else(c, t.p0, e.p0), if_then_else(c, t.size, e.size));
859}};
860struct RectWithEndpoint_scalar {
861vec2_scalar p0;
862vec2_scalar p1;
863RectWithEndpoint_scalar() = default;
864RectWithEndpoint_scalar(vec2_scalar p0, vec2_scalar p1) : p0(p0), p1(p1){}
865};
866struct RectWithEndpoint {
867vec2 p0;
868vec2 p1;
869RectWithEndpoint() = default;
870RectWithEndpoint(vec2 p0, vec2 p1) : p0(p0), p1(p1){}
871RectWithEndpoint(vec2_scalar p0, vec2_scalar p1):p0(p0),p1(p1){
872}
873IMPLICIT RectWithEndpoint(RectWithEndpoint_scalar s):p0(s.p0),p1(s.p1){
874}
875friend RectWithEndpoint if_then_else(I32 c, RectWithEndpoint t, RectWithEndpoint e) { return RectWithEndpoint(
876if_then_else(c, t.p0, e.p0), if_then_else(c, t.p1, e.p1));
877}};
878// vec4_scalar vTransformBounds;
879// sampler2D sGpuBufferF;
880// isampler2D sGpuBufferI;
881// sampler2D sClipMask;
882struct Fragment_scalar {
883vec4_scalar color;
884Fragment_scalar() = default;
885explicit Fragment_scalar(vec4_scalar color) : color(color){}
886};
887struct Fragment {
888vec4 color;
889Fragment() = default;
890explicit Fragment(vec4 color) : color(color){}
891explicit Fragment(vec4_scalar color):color(color){
892}
893IMPLICIT Fragment(Fragment_scalar s):color(s.color){
894}
895friend Fragment if_then_else(I32 c, Fragment t, Fragment e) { return Fragment(
896if_then_else(c, t.color, e.color));
897}};
898vec2 v_uv;
899// vec4_scalar v_color;
900// vec2_scalar v_mask_swizzle;
901// vec2_scalar v_tile_repeat_bounds;
902// vec4_scalar v_uv_bounds;
903// vec4_scalar v_uv_sample_bounds;
904// vec2_scalar v_perspective;
905vec2 compute_repeated_uvs(Float perspective_divisor) {
906 vec2_scalar uv_size = ((v_uv_bounds).sel(Z,W))-((v_uv_bounds).sel(X,Y));
907 vec2 local_uv = (v_uv)*(perspective_divisor);
908 local_uv = max(local_uv, make_vec2(0.f));
909 vec2 repeated_uv = ((fract(local_uv))*(uv_size))+((v_uv_bounds).sel(X,Y));
910 auto _c3_ = ((local_uv).x)>=((v_tile_repeat_bounds).x);
911 {
912 (repeated_uv).x = if_then_else(_c3_,(v_uv_bounds).z,(repeated_uv).x);
913 }
914 auto _c4_ = ((local_uv).y)>=((v_tile_repeat_bounds).y);
915 {
916 (repeated_uv).y = if_then_else(_c4_,(v_uv_bounds).w,(repeated_uv).y);
917 }
918 return repeated_uv;
919}
920float antialias_brush() {
921 return 1.f;
922}
923Fragment brush_fs() {
924 Float perspective_divisor = mix((gl_FragCoord).w, 1.f, (v_perspective).x);
925 vec2 repeated_uv = compute_repeated_uvs(perspective_divisor);
926 vec2 uv = clamp(repeated_uv, (v_uv_sample_bounds).sel(X,Y), (v_uv_sample_bounds).sel(Z,W));
927 vec4 texel = texture(sColor0, (uv).sel(X,Y));
928 Fragment frag;
929 float alpha = antialias_brush();
930 (texel).lsel(R,G,B) = (((texel).sel(R,G,B))*((v_mask_swizzle).x))+(((texel).sel(A,A,A))*((v_mask_swizzle).y));
931 vec4 alpha_mask = (texel)*(alpha);
932 (frag).color = (v_color)*(alpha_mask);
933 return frag;
934}
935float do_clip() {
936 return 1.f;
937}
938void write_output(vec4 color) {
939 oFragColorgl_FragColor = color;
940}
941ALWAYS_INLINE__attribute__((always_inline)) inline void main(void) {
942 Fragment frag = brush_fs();
943 float clip_alpha = do_clip();
944 (frag).color *= clip_alpha;
945 write_output((frag).color);
946}
947void swgl_drawSpanRGBA8() {
948 if (!(swgl_isTextureRGBA8(sColor0))) {
949 {
950 return;
951 }
952 }
953 if ((v_mask_swizzle)!=(make_vec2(1.f, 0.f))) {
954 {
955 return;
956 }
957 }
958 float perspective_divisor = mix(swgl_forceScalar((gl_FragCoord).w), 1.f, (v_perspective).x);
959 vec2 uv = (v_uv)*(perspective_divisor);
960 if ((v_color)!=(make_vec4(1.f))) {
961 {
962 swgl_commitTextureRepeatColorRGBA8(sColor0, uv, v_tile_repeat_bounds, v_uv_bounds, v_uv_sample_bounds, v_color)do { if (sColor0->filter == TextureFilter::LINEAR) { do { auto
packed_color = packColor(swgl_OutRGBA8, v_color); int drawn =
0; if (blend_key) { drawn = blendTextureLinearRepeat<true
>(sColor0, uv, swgl_SpanLength, v_tile_repeat_bounds, v_uv_bounds
, v_uv_sample_bounds, packed_color, swgl_OutRGBA8); } else { drawn
= blendTextureLinearRepeat<false>(sColor0, uv, swgl_SpanLength
, v_tile_repeat_bounds, v_uv_bounds, v_uv_sample_bounds, packed_color
, swgl_OutRGBA8); } swgl_OutRGBA8 += drawn; swgl_SpanLength -=
drawn; } while (0); } else { do { auto packed_color = packColor
(swgl_OutRGBA8, v_color); int drawn = 0; if (blend_key) { drawn
= blendTextureNearestRepeat<true, true>( sColor0, uv, swgl_SpanLength
, v_tile_repeat_bounds, v_uv_bounds, packed_color, swgl_OutRGBA8
); } else { drawn = blendTextureNearestRepeat<false, true>
( sColor0, uv, swgl_SpanLength, v_tile_repeat_bounds, v_uv_bounds
, packed_color, swgl_OutRGBA8); } swgl_OutRGBA8 += drawn; swgl_SpanLength
-= drawn; } while (0); } } while (0)
;
963 return;
964 }
965 }
966 swgl_commitTextureRepeatRGBA8(sColor0, uv, v_tile_repeat_bounds, v_uv_bounds, v_uv_sample_bounds)do { if (sColor0->filter == TextureFilter::LINEAR) { do { auto
packed_color = packColor(swgl_OutRGBA8, NoColor()); int drawn
= 0; if (blend_key) { drawn = blendTextureLinearRepeat<true
>(sColor0, uv, swgl_SpanLength, v_tile_repeat_bounds, v_uv_bounds
, v_uv_sample_bounds, packed_color, swgl_OutRGBA8); } else { drawn
= blendTextureLinearRepeat<false>(sColor0, uv, swgl_SpanLength
, v_tile_repeat_bounds, v_uv_bounds, v_uv_sample_bounds, packed_color
, swgl_OutRGBA8); } swgl_OutRGBA8 += drawn; swgl_SpanLength -=
drawn; } while (0); } else { do { auto packed_color = packColor
(swgl_OutRGBA8, NoColor()); int drawn = 0; if (blend_key) { drawn
= blendTextureNearestRepeat<true, true>( sColor0, uv, swgl_SpanLength
, v_tile_repeat_bounds, v_uv_bounds, packed_color, swgl_OutRGBA8
); } else { drawn = blendTextureNearestRepeat<false, true>
( sColor0, uv, swgl_SpanLength, v_tile_repeat_bounds, v_uv_bounds
, packed_color, swgl_OutRGBA8); } swgl_OutRGBA8 += drawn; swgl_SpanLength
-= drawn; } while (0); } } while (0)
;
967}
968typedef brush_image_ADVANCED_BLEND_ALPHA_PASS_ANTIALIASING_REPETITION_TEXTURE_2D_vert::InterpOutputs InterpInputs;
969InterpInputs interp_step;
970struct InterpPerspective {
971vec2 v_uv;
972};
973InterpPerspective interp_perspective;
974static void read_interp_inputs(FragmentShaderImpl* impl, const void* init_, const void* step_) {Self* self = (Self*)impl;const InterpInputs* init = (const InterpInputs*)init_;const InterpInputs* step = (const InterpInputs*)step_;
975 self->v_uv = init_interp(init->v_uv, step->v_uv);
976 self->interp_step.v_uv = step->v_uv * 4.0f;
977}
978static void read_perspective_inputs(FragmentShaderImpl* impl, const void* init_, const void* step_) {Self* self = (Self*)impl;const InterpInputs* init = (const InterpInputs*)init_;const InterpInputs* step = (const InterpInputs*)step_;
979 Float w = 1.0f / self->gl_FragCoord.w;
980 self->interp_perspective.v_uv = init_interp(init->v_uv, step->v_uv);
981 self->v_uv = self->interp_perspective.v_uv * w;
982 self->interp_step.v_uv = step->v_uv * 4.0f;
983}
984ALWAYS_INLINE__attribute__((always_inline)) inline void step_interp_inputs(int steps = 4) {
985 float chunks = steps * 0.25f;
986 v_uv += interp_step.v_uv * chunks;
987}
988ALWAYS_INLINE__attribute__((always_inline)) inline void step_perspective_inputs(int steps = 4) {
989 step_perspective(steps);
990 float chunks = steps * 0.25f;
991 Float w = 1.0f / gl_FragCoord.w;
992 interp_perspective.v_uv += interp_step.v_uv * chunks;
993 v_uv = w * interp_perspective.v_uv;
994}
995static void run(FragmentShaderImpl* impl) {
996 Self* self = (Self*)impl;
997 self->main();
998 self->step_interp_inputs();
999}
1000static void skip(FragmentShaderImpl* impl, int steps) {
1001 Self* self = (Self*)impl;
1002 self->step_interp_inputs(steps);
1003}
1004static void run_perspective(FragmentShaderImpl* impl) {
1005 Self* self = (Self*)impl;
1006 self->main();
1007 self->step_perspective_inputs();
1008}
1009static void skip_perspective(FragmentShaderImpl* impl, int steps) {
1010 Self* self = (Self*)impl;
1011 self->step_perspective_inputs(steps);
1012}
1013static int draw_span_RGBA8(FragmentShaderImpl* impl) {
1014 Self* self = (Self*)impl; DISPATCH_DRAW_SPAN(self, RGBA8)do { int total = self->swgl_SpanLength; self->swgl_drawSpanRGBA8
(); int drawn = total - self->swgl_SpanLength; if (drawn) self
->step_interp_inputs(drawn); return drawn; } while (0)
; }
1015public:
1016brush_image_ADVANCED_BLEND_ALPHA_PASS_ANTIALIASING_REPETITION_TEXTURE_2D_frag() {
1017 init_span_func = &read_interp_inputs;
1018 run_func = &run;
1019 skip_func = &skip;
1020 draw_span_RGBA8_func = &draw_span_RGBA8;
1021 enable_perspective();
1022 init_span_w_func = &read_perspective_inputs;
1023 run_w_func = &run_perspective;
1024 skip_w_func = &skip_perspective;
1025}
1026};
1027
1028struct brush_image_ADVANCED_BLEND_ALPHA_PASS_ANTIALIASING_REPETITION_TEXTURE_2D_program : ProgramImpl, brush_image_ADVANCED_BLEND_ALPHA_PASS_ANTIALIASING_REPETITION_TEXTURE_2D_frag {
1029int get_uniform(const char *name) const override {
1030 if (strcmp("sClipMask", name) == 0) { return 8; }
1031 if (strcmp("sColor0", name) == 0) { return 9; }
1032 if (strcmp("sGpuBufferF", name) == 0) { return 3; }
1033 if (strcmp("sGpuBufferI", name) == 0) { return 4; }
1034 if (strcmp("sPrimitiveHeadersF", name) == 0) { return 5; }
1035 if (strcmp("sPrimitiveHeadersI", name) == 0) { return 6; }
1036 if (strcmp("sRenderTasks", name) == 0) { return 1; }
1037 if (strcmp("sTransformPalette", name) == 0) { return 2; }
1038 if (strcmp("uTransform", name) == 0) { return 7; }
1039 return -1;
1040}
1041void bind_attrib(const char* name, int index) override {
1042 attrib_locations.bind_loc(name, index);
1043}
1044int get_attrib(const char* name) const override {
1045 return attrib_locations.get_loc(name);
1046}
1047size_t interpolants_size() const override { return sizeof(InterpOutputs); }
1048VertexShaderImpl* get_vertex_shader() override {
1049 return this;
1050}
1051FragmentShaderImpl* get_fragment_shader() override {
1052 return this;
1053}
1054const char* get_name() const override { return "brush_image_ADVANCED_BLEND_ALPHA_PASS_ANTIALIASING_REPETITION_TEXTURE_2D"; }
1055static ProgramImpl* loader() { return new brush_image_ADVANCED_BLEND_ALPHA_PASS_ANTIALIASING_REPETITION_TEXTURE_2D_program; }
1056};
1057