File: | var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/x86_64-unknown-linux-gnu/debug/build/swgl-6f6517a85091acb7/out/brush_mix_blend_ALPHA_PASS.h |
Warning: | line 788, column 2 Value stored to 'ret_mask' is never read |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | struct brush_mix_blend_ALPHA_PASS_common { |
2 | struct Samplers { |
3 | sampler2D_impl sClipMask_impl; |
4 | int sClipMask_slot; |
5 | sampler2D_impl sColor0_impl; |
6 | int sColor0_slot; |
7 | sampler2D_impl sColor1_impl; |
8 | int sColor1_slot; |
9 | sampler2D_impl sGpuCache_impl; |
10 | int sGpuCache_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 7: |
22 | sClipMask_slot = value; |
23 | return true; |
24 | case 8: |
25 | sColor0_slot = value; |
26 | return true; |
27 | case 9: |
28 | sColor1_slot = value; |
29 | return true; |
30 | case 2: |
31 | sGpuCache_slot = value; |
32 | return true; |
33 | case 4: |
34 | sPrimitiveHeadersF_slot = value; |
35 | return true; |
36 | case 5: |
37 | sPrimitiveHeadersI_slot = value; |
38 | return true; |
39 | case 1: |
40 | sRenderTasks_slot = value; |
41 | return true; |
42 | case 3: |
43 | sTransformPalette_slot = value; |
44 | return true; |
45 | } |
46 | return false; |
47 | } |
48 | } samplers; |
49 | struct 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; |
62 | vec4_scalar vTransformBounds; |
63 | vec4_scalar v_src_uv_sample_bounds; |
64 | vec4_scalar v_backdrop_uv_sample_bounds; |
65 | vec2_scalar v_perspective; |
66 | ivec2_scalar v_op; |
67 | sampler2D sClipMask; |
68 | sampler2D sColor0; |
69 | sampler2D sColor1; |
70 | sampler2D sGpuCache; |
71 | sampler2D sPrimitiveHeadersF; |
72 | isampler2D sPrimitiveHeadersI; |
73 | sampler2D sRenderTasks; |
74 | sampler2D sTransformPalette; |
75 | mat4_scalar uTransform; |
76 | void bind_textures() { |
77 | sClipMask = lookup_sampler(&samplers.sClipMask_impl, samplers.sClipMask_slot); |
78 | sColor0 = lookup_sampler(&samplers.sColor0_impl, samplers.sColor0_slot); |
79 | sColor1 = lookup_sampler(&samplers.sColor1_impl, samplers.sColor1_slot); |
80 | sGpuCache = lookup_sampler(&samplers.sGpuCache_impl, samplers.sGpuCache_slot); |
81 | sPrimitiveHeadersF = lookup_sampler(&samplers.sPrimitiveHeadersF_impl, samplers.sPrimitiveHeadersF_slot); |
82 | sPrimitiveHeadersI = lookup_isampler(&samplers.sPrimitiveHeadersI_impl, samplers.sPrimitiveHeadersI_slot); |
83 | sRenderTasks = lookup_sampler(&samplers.sRenderTasks_impl, samplers.sRenderTasks_slot); |
84 | sTransformPalette = lookup_sampler(&samplers.sTransformPalette_impl, samplers.sTransformPalette_slot); |
85 | } |
86 | }; |
87 | struct brush_mix_blend_ALPHA_PASS_vert : VertexShaderImpl, brush_mix_blend_ALPHA_PASS_common { |
88 | private: |
89 | typedef brush_mix_blend_ALPHA_PASS_vert Self; |
90 | // mat4_scalar uTransform; |
91 | vec2 aPosition; |
92 | // sampler2D sColor0; |
93 | // sampler2D sColor1; |
94 | // sampler2D sColor2; |
95 | struct RectWithSize_scalar { |
96 | vec2_scalar p0; |
97 | vec2_scalar size; |
98 | RectWithSize_scalar() = default; |
99 | RectWithSize_scalar(vec2_scalar p0, vec2_scalar size) : p0(p0), size(size){} |
100 | }; |
101 | struct RectWithSize { |
102 | vec2 p0; |
103 | vec2 size; |
104 | RectWithSize() = default; |
105 | RectWithSize(vec2 p0, vec2 size) : p0(p0), size(size){} |
106 | RectWithSize(vec2_scalar p0, vec2_scalar size):p0(p0),size(size){ |
107 | } |
108 | IMPLICIT RectWithSize(RectWithSize_scalar s):p0(s.p0),size(s.size){ |
109 | } |
110 | friend RectWithSize if_then_else(I32 c, RectWithSize t, RectWithSize e) { return RectWithSize( |
111 | if_then_else(c, t.p0, e.p0), if_then_else(c, t.size, e.size)); |
112 | }}; |
113 | struct RectWithEndpoint_scalar { |
114 | vec2_scalar p0; |
115 | vec2_scalar p1; |
116 | RectWithEndpoint_scalar() = default; |
117 | RectWithEndpoint_scalar(vec2_scalar p0, vec2_scalar p1) : p0(p0), p1(p1){} |
118 | }; |
119 | struct RectWithEndpoint { |
120 | vec2 p0; |
121 | vec2 p1; |
122 | RectWithEndpoint() = default; |
123 | RectWithEndpoint(vec2 p0, vec2 p1) : p0(p0), p1(p1){} |
124 | RectWithEndpoint(vec2_scalar p0, vec2_scalar p1):p0(p0),p1(p1){ |
125 | } |
126 | IMPLICIT RectWithEndpoint(RectWithEndpoint_scalar s):p0(s.p0),p1(s.p1){ |
127 | } |
128 | friend RectWithEndpoint if_then_else(I32 c, RectWithEndpoint t, RectWithEndpoint e) { return RectWithEndpoint( |
129 | if_then_else(c, t.p0, e.p0), if_then_else(c, t.p1, e.p1)); |
130 | }}; |
131 | // sampler2D sRenderTasks; |
132 | struct RenderTaskData_scalar { |
133 | RectWithEndpoint_scalar task_rect; |
134 | vec4_scalar user_data; |
135 | RenderTaskData_scalar() = default; |
136 | RenderTaskData_scalar(RectWithEndpoint_scalar task_rect, vec4_scalar user_data) : task_rect(task_rect), user_data(user_data){} |
137 | }; |
138 | struct RenderTaskData { |
139 | RectWithEndpoint task_rect; |
140 | vec4 user_data; |
141 | RenderTaskData() = default; |
142 | RenderTaskData(RectWithEndpoint task_rect, vec4 user_data) : task_rect(task_rect), user_data(user_data){} |
143 | RenderTaskData(RectWithEndpoint_scalar task_rect, vec4_scalar user_data):task_rect(task_rect),user_data(user_data){ |
144 | } |
145 | IMPLICIT RenderTaskData(RenderTaskData_scalar s):task_rect(s.task_rect),user_data(s.user_data){ |
146 | } |
147 | friend RenderTaskData if_then_else(I32 c, RenderTaskData t, RenderTaskData e) { return RenderTaskData( |
148 | if_then_else(c, t.task_rect, e.task_rect), if_then_else(c, t.user_data, e.user_data)); |
149 | }}; |
150 | struct PictureTask_scalar { |
151 | RectWithEndpoint_scalar task_rect; |
152 | float device_pixel_scale; |
153 | vec2_scalar content_origin; |
154 | PictureTask_scalar() = default; |
155 | PictureTask_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){} |
156 | }; |
157 | struct PictureTask { |
158 | RectWithEndpoint task_rect; |
159 | Float device_pixel_scale; |
160 | vec2 content_origin; |
161 | PictureTask() = default; |
162 | PictureTask(RectWithEndpoint task_rect, Float device_pixel_scale, vec2 content_origin) : task_rect(task_rect), device_pixel_scale(device_pixel_scale), content_origin(content_origin){} |
163 | PictureTask(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){ |
164 | } |
165 | IMPLICIT PictureTask(PictureTask_scalar s):task_rect(s.task_rect),device_pixel_scale(s.device_pixel_scale),content_origin(s.content_origin){ |
166 | } |
167 | friend PictureTask if_then_else(I32 c, PictureTask t, PictureTask e) { return PictureTask( |
168 | if_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)); |
169 | }}; |
170 | struct ClipArea_scalar { |
171 | RectWithEndpoint_scalar task_rect; |
172 | float device_pixel_scale; |
173 | vec2_scalar screen_origin; |
174 | ClipArea_scalar() = default; |
175 | ClipArea_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){} |
176 | }; |
177 | struct ClipArea { |
178 | RectWithEndpoint task_rect; |
179 | Float device_pixel_scale; |
180 | vec2 screen_origin; |
181 | ClipArea() = default; |
182 | ClipArea(RectWithEndpoint task_rect, Float device_pixel_scale, vec2 screen_origin) : task_rect(task_rect), device_pixel_scale(device_pixel_scale), screen_origin(screen_origin){} |
183 | ClipArea(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){ |
184 | } |
185 | IMPLICIT ClipArea(ClipArea_scalar s):task_rect(s.task_rect),device_pixel_scale(s.device_pixel_scale),screen_origin(s.screen_origin){ |
186 | } |
187 | friend ClipArea if_then_else(I32 c, ClipArea t, ClipArea e) { return ClipArea( |
188 | if_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)); |
189 | }}; |
190 | // sampler2D sGpuCache; |
191 | struct ImageSource_scalar { |
192 | RectWithEndpoint_scalar uv_rect; |
193 | vec4_scalar user_data; |
194 | ImageSource_scalar() = default; |
195 | ImageSource_scalar(RectWithEndpoint_scalar uv_rect, vec4_scalar user_data) : uv_rect(uv_rect), user_data(user_data){} |
196 | }; |
197 | struct ImageSource { |
198 | RectWithEndpoint uv_rect; |
199 | vec4 user_data; |
200 | ImageSource() = default; |
201 | ImageSource(RectWithEndpoint uv_rect, vec4 user_data) : uv_rect(uv_rect), user_data(user_data){} |
202 | ImageSource(RectWithEndpoint_scalar uv_rect, vec4_scalar user_data):uv_rect(uv_rect),user_data(user_data){ |
203 | } |
204 | IMPLICIT ImageSource(ImageSource_scalar s):uv_rect(s.uv_rect),user_data(s.user_data){ |
205 | } |
206 | friend ImageSource if_then_else(I32 c, ImageSource t, ImageSource e) { return ImageSource( |
207 | if_then_else(c, t.uv_rect, e.uv_rect), if_then_else(c, t.user_data, e.user_data)); |
208 | }}; |
209 | struct ImageSourceExtra_scalar { |
210 | vec4_scalar st_tl; |
211 | vec4_scalar st_tr; |
212 | vec4_scalar st_bl; |
213 | vec4_scalar st_br; |
214 | ImageSourceExtra_scalar() = default; |
215 | ImageSourceExtra_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){} |
216 | }; |
217 | struct ImageSourceExtra { |
218 | vec4 st_tl; |
219 | vec4 st_tr; |
220 | vec4 st_bl; |
221 | vec4 st_br; |
222 | ImageSourceExtra() = default; |
223 | ImageSourceExtra(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){} |
224 | ImageSourceExtra(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){ |
225 | } |
226 | IMPLICIT ImageSourceExtra(ImageSourceExtra_scalar s):st_tl(s.st_tl),st_tr(s.st_tr),st_bl(s.st_bl),st_br(s.st_br){ |
227 | } |
228 | friend ImageSourceExtra if_then_else(I32 c, ImageSourceExtra t, ImageSourceExtra e) { return ImageSourceExtra( |
229 | if_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)); |
230 | }}; |
231 | // vec4_scalar vTransformBounds; |
232 | // sampler2D sTransformPalette; |
233 | struct Transform_scalar { |
234 | mat4_scalar m; |
235 | mat4_scalar inv_m; |
236 | bool is_axis_aligned; |
237 | Transform_scalar() = default; |
238 | Transform_scalar(mat4_scalar m, mat4_scalar inv_m, bool is_axis_aligned) : m(m), inv_m(inv_m), is_axis_aligned(is_axis_aligned){} |
239 | }; |
240 | struct Transform { |
241 | mat4 m; |
242 | mat4 inv_m; |
243 | Bool is_axis_aligned; |
244 | Transform() = default; |
245 | Transform(mat4 m, mat4 inv_m, Bool is_axis_aligned) : m(m), inv_m(inv_m), is_axis_aligned(is_axis_aligned){} |
246 | Transform(mat4_scalar m, mat4_scalar inv_m, bool is_axis_aligned):m(m),inv_m(inv_m),is_axis_aligned(is_axis_aligned){ |
247 | } |
248 | IMPLICIT Transform(Transform_scalar s):m(s.m),inv_m(s.inv_m),is_axis_aligned(s.is_axis_aligned){ |
249 | } |
250 | friend Transform if_then_else(I32 c, Transform t, Transform e) { return Transform( |
251 | if_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)); |
252 | }}; |
253 | // sampler2D sClipMask; |
254 | // sampler2D sPrimitiveHeadersF; |
255 | // isampler2D sPrimitiveHeadersI; |
256 | ivec4_scalar aData; |
257 | struct Instance_scalar { |
258 | int32_t prim_header_address; |
259 | int32_t clip_address; |
260 | int32_t segment_index; |
261 | int32_t flags; |
262 | int32_t resource_address; |
263 | int32_t brush_kind; |
264 | Instance_scalar() = default; |
265 | Instance_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){} |
266 | }; |
267 | struct Instance { |
268 | I32 prim_header_address; |
269 | I32 clip_address; |
270 | I32 segment_index; |
271 | I32 flags; |
272 | I32 resource_address; |
273 | I32 brush_kind; |
274 | Instance() = default; |
275 | Instance(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){} |
276 | Instance(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){ |
277 | } |
278 | IMPLICIT 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){ |
279 | } |
280 | friend Instance if_then_else(I32 c, Instance t, Instance e) { return Instance( |
281 | if_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)); |
282 | }}; |
283 | struct PrimitiveHeader_scalar { |
284 | RectWithEndpoint_scalar local_rect; |
285 | RectWithEndpoint_scalar local_clip_rect; |
286 | float z; |
287 | int32_t specific_prim_address; |
288 | int32_t transform_id; |
289 | int32_t picture_task_address; |
290 | ivec4_scalar user_data; |
291 | PrimitiveHeader_scalar() = default; |
292 | PrimitiveHeader_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){} |
293 | }; |
294 | struct PrimitiveHeader { |
295 | RectWithEndpoint local_rect; |
296 | RectWithEndpoint local_clip_rect; |
297 | Float z; |
298 | I32 specific_prim_address; |
299 | I32 transform_id; |
300 | I32 picture_task_address; |
301 | ivec4 user_data; |
302 | PrimitiveHeader() = default; |
303 | PrimitiveHeader(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){} |
304 | PrimitiveHeader(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){ |
305 | } |
306 | IMPLICIT 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){ |
307 | } |
308 | friend PrimitiveHeader if_then_else(I32 c, PrimitiveHeader t, PrimitiveHeader e) { return PrimitiveHeader( |
309 | if_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)); |
310 | }}; |
311 | struct VertexInfo_scalar { |
312 | vec2_scalar local_pos; |
313 | vec4_scalar world_pos; |
314 | VertexInfo_scalar() = default; |
315 | VertexInfo_scalar(vec2_scalar local_pos, vec4_scalar world_pos) : local_pos(local_pos), world_pos(world_pos){} |
316 | }; |
317 | struct VertexInfo { |
318 | vec2 local_pos; |
319 | vec4 world_pos; |
320 | VertexInfo() = default; |
321 | VertexInfo(vec2 local_pos, vec4 world_pos) : local_pos(local_pos), world_pos(world_pos){} |
322 | VertexInfo(vec2_scalar local_pos, vec4_scalar world_pos):local_pos(local_pos),world_pos(world_pos){ |
323 | } |
324 | IMPLICIT VertexInfo(VertexInfo_scalar s):local_pos(s.local_pos),world_pos(s.world_pos){ |
325 | } |
326 | friend VertexInfo if_then_else(I32 c, VertexInfo t, VertexInfo e) { return VertexInfo( |
327 | if_then_else(c, t.local_pos, e.local_pos), if_then_else(c, t.world_pos, e.world_pos)); |
328 | }}; |
329 | vec2 v_src_uv; |
330 | // vec4_scalar v_src_uv_sample_bounds; |
331 | vec2 v_backdrop_uv; |
332 | // vec4_scalar v_backdrop_uv_sample_bounds; |
333 | // vec2_scalar v_perspective; |
334 | // ivec2_scalar v_op; |
335 | Instance_scalar decode_instance_attributes() { |
336 | Instance_scalar instance; |
337 | (instance).prim_header_address = (aData).x; |
338 | (instance).clip_address = (aData).y; |
339 | (instance).segment_index = ((aData).z)&(65535); |
340 | (instance).flags = ((aData).z)>>(16); |
341 | (instance).resource_address = ((aData).w)&(16777215); |
342 | (instance).brush_kind = ((aData).w)>>(24); |
343 | return instance; |
344 | } |
345 | PrimitiveHeader_scalar fetch_prim_header(int32_t index) { |
346 | PrimitiveHeader_scalar ph; |
347 | ivec2_scalar uv_f = make_ivec2(make_int((2u)*((make_uint(index))%((1024u)/(2u)))), make_int((make_uint(index))/((1024u)/(2u)))); |
348 | auto sPrimitiveHeadersF_uv_f_fetch = texelFetchPtr(sPrimitiveHeadersF, uv_f, 0, 1, 0, 0); |
349 | vec4_scalar local_rect = texelFetchUnchecked(sPrimitiveHeadersF, sPrimitiveHeadersF_uv_f_fetch, 0, 0); |
350 | vec4_scalar local_clip_rect = texelFetchUnchecked(sPrimitiveHeadersF, sPrimitiveHeadersF_uv_f_fetch, 1, 0); |
351 | (ph).local_rect = RectWithEndpoint_scalar((local_rect).sel(X,Y), (local_rect).sel(Z,W)); |
352 | (ph).local_clip_rect = RectWithEndpoint_scalar((local_clip_rect).sel(X,Y), (local_clip_rect).sel(Z,W)); |
353 | ivec2_scalar uv_i = make_ivec2(make_int((2u)*((make_uint(index))%((1024u)/(2u)))), make_int((make_uint(index))/((1024u)/(2u)))); |
354 | auto sPrimitiveHeadersI_uv_i_fetch = texelFetchPtr(sPrimitiveHeadersI, uv_i, 0, 1, 0, 0); |
355 | ivec4_scalar data0 = texelFetchUnchecked(sPrimitiveHeadersI, sPrimitiveHeadersI_uv_i_fetch, 0, 0); |
356 | ivec4_scalar data1 = texelFetchUnchecked(sPrimitiveHeadersI, sPrimitiveHeadersI_uv_i_fetch, 1, 0); |
357 | (ph).z = make_float((data0).x); |
358 | (ph).specific_prim_address = (data0).y; |
359 | (ph).transform_id = (data0).z; |
360 | (ph).picture_task_address = (data0).w; |
361 | (ph).user_data = data1; |
362 | return ph; |
363 | } |
364 | Transform_scalar fetch_transform(int32_t id) { |
365 | Transform_scalar transform; |
366 | (transform).is_axis_aligned = ((id)>>(23))==(0); |
367 | int32_t index = (id)&(8388607); |
368 | ivec2_scalar uv = make_ivec2(make_int((8u)*((make_uint(index))%((1024u)/(8u)))), make_int((make_uint(index))/((1024u)/(8u)))); |
369 | ivec2_scalar uv0 = make_ivec2(((uv).x)+(0), (uv).y); |
370 | auto sTransformPalette_uv0_fetch = texelFetchPtr(sTransformPalette, uv0, 0, 7, 0, 0); |
371 | (transform).m[0] = texelFetchUnchecked(sTransformPalette, sTransformPalette_uv0_fetch, 0, 0); |
372 | (transform).m[1] = texelFetchUnchecked(sTransformPalette, sTransformPalette_uv0_fetch, 1, 0); |
373 | (transform).m[2] = texelFetchUnchecked(sTransformPalette, sTransformPalette_uv0_fetch, 2, 0); |
374 | (transform).m[3] = texelFetchUnchecked(sTransformPalette, sTransformPalette_uv0_fetch, 3, 0); |
375 | (transform).inv_m[0] = texelFetchUnchecked(sTransformPalette, sTransformPalette_uv0_fetch, 4, 0); |
376 | (transform).inv_m[1] = texelFetchUnchecked(sTransformPalette, sTransformPalette_uv0_fetch, 5, 0); |
377 | (transform).inv_m[2] = texelFetchUnchecked(sTransformPalette, sTransformPalette_uv0_fetch, 6, 0); |
378 | (transform).inv_m[3] = texelFetchUnchecked(sTransformPalette, sTransformPalette_uv0_fetch, 7, 0); |
379 | return transform; |
380 | } |
381 | RenderTaskData_scalar fetch_render_task_data(int32_t index) { |
382 | ivec2_scalar uv = make_ivec2(make_int((2u)*((make_uint(index))%((1024u)/(2u)))), make_int((make_uint(index))/((1024u)/(2u)))); |
383 | auto sRenderTasks_uv_fetch = texelFetchPtr(sRenderTasks, uv, 0, 1, 0, 0); |
384 | vec4_scalar texel0 = texelFetchUnchecked(sRenderTasks, sRenderTasks_uv_fetch, 0, 0); |
385 | vec4_scalar texel1 = texelFetchUnchecked(sRenderTasks, sRenderTasks_uv_fetch, 1, 0); |
386 | RectWithEndpoint_scalar task_rect = RectWithEndpoint_scalar((texel0).sel(X,Y), (texel0).sel(Z,W)); |
387 | RenderTaskData_scalar data = RenderTaskData_scalar(task_rect, texel1); |
388 | return data; |
389 | } |
390 | PictureTask_scalar fetch_picture_task(int32_t address) { |
391 | RenderTaskData_scalar task_data = fetch_render_task_data(address); |
392 | PictureTask_scalar task = PictureTask_scalar((task_data).task_rect, ((task_data).user_data).x, ((task_data).user_data).sel(Y,Z)); |
393 | return task; |
394 | } |
395 | ClipArea_scalar fetch_clip_area(int32_t index) { |
396 | RenderTaskData_scalar task_data; |
397 | if ((index)>=(2147483647)) { |
398 | { |
399 | task_data = RenderTaskData_scalar(RectWithEndpoint_scalar(make_vec2(0.f), make_vec2(0.f)), make_vec4(0.f)); |
400 | } |
401 | } else { |
402 | task_data = fetch_render_task_data(index); |
403 | } |
404 | return ClipArea_scalar((task_data).task_rect, ((task_data).user_data).x, ((task_data).user_data).sel(Y,Z)); |
405 | } |
406 | ivec2_scalar get_gpu_cache_uv(int32_t address) { |
407 | return make_ivec2((make_uint(address))%(1024u), (make_uint(address))/(1024u)); |
408 | } |
409 | Array<vec4_scalar,2> fetch_from_gpu_cache_2(int32_t address) { |
410 | ivec2_scalar uv = get_gpu_cache_uv(address); |
411 | auto sGpuCache_uv_fetch = texelFetchPtr(sGpuCache, uv, 0, 1, 0, 0); |
412 | return Array<vec4_scalar,2>{{texelFetchUnchecked(sGpuCache, sGpuCache_uv_fetch, 0, 0), texelFetchUnchecked(sGpuCache, sGpuCache_uv_fetch, 1, 0)}}; |
413 | } |
414 | RectWithEndpoint_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) { |
415 | bvec4_scalar clipped = make_bvec4(greaterThan((clip_rect).p0, (segment_rect).p0), lessThan((clip_rect).p1, (segment_rect).p1)); |
416 | 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); |
417 | (segment_rect).p0 = clamp((segment_rect).p0, (clip_rect).p0, (clip_rect).p1); |
418 | (segment_rect).p1 = clamp((segment_rect).p1, (clip_rect).p0, (clip_rect).p1); |
419 | return segment_rect; |
420 | } |
421 | vec2 rect_clamp(RectWithEndpoint_scalar rect, vec2 pt) { |
422 | return clamp(pt, (rect).p0, (rect).p1); |
423 | } |
424 | VertexInfo write_vertex(vec2 local_pos, RectWithEndpoint_scalar local_clip_rect, float z, Transform_scalar transform, PictureTask_scalar task) { |
425 | vec2 clamped_local_pos = rect_clamp(local_clip_rect, local_pos); |
426 | vec4 world_pos = ((transform).m)*(make_vec4(clamped_local_pos, 0.f, 1.f)); |
427 | vec2 device_pos = ((world_pos).sel(X,Y))*((task).device_pixel_scale); |
428 | vec2_scalar final_offset = (-((task).content_origin))+(((task).task_rect).p0); |
429 | gl_Position = (uTransform)*(make_vec4((device_pos)+((final_offset)*((world_pos).w)), (z)*((world_pos).w), (world_pos).w)); |
430 | VertexInfo vi = VertexInfo(clamped_local_pos, world_pos); |
431 | return vi; |
432 | } |
433 | vec2_scalar rect_size(RectWithEndpoint_scalar rect) { |
434 | return ((rect).p1)-((rect).p0); |
435 | } |
436 | void write_clip(vec4 world_pos, ClipArea_scalar area, PictureTask_scalar task) { |
437 | 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 ); |
438 | } |
439 | ImageSource_scalar fetch_image_source(int32_t address) { |
440 | Array<vec4_scalar,2> data = fetch_from_gpu_cache_2(address); |
441 | RectWithEndpoint_scalar uv_rect = RectWithEndpoint_scalar((data[0]).sel(X,Y), (data[0]).sel(Z,W)); |
442 | return ImageSource_scalar(uv_rect, data[1]); |
443 | } |
444 | Array<vec4_scalar,4> fetch_from_gpu_cache_4(int32_t address) { |
445 | ivec2_scalar uv = get_gpu_cache_uv(address); |
446 | auto sGpuCache_uv_fetch = texelFetchPtr(sGpuCache, uv, 0, 3, 0, 0); |
447 | return Array<vec4_scalar,4>{{texelFetchUnchecked(sGpuCache, sGpuCache_uv_fetch, 0, 0), texelFetchUnchecked(sGpuCache, sGpuCache_uv_fetch, 1, 0), texelFetchUnchecked(sGpuCache, sGpuCache_uv_fetch, 2, 0), texelFetchUnchecked(sGpuCache, sGpuCache_uv_fetch, 3, 0)}}; |
448 | } |
449 | ImageSourceExtra_scalar fetch_image_source_extra(int32_t address) { |
450 | Array<vec4_scalar,4> data = fetch_from_gpu_cache_4((address)+(2)); |
451 | return ImageSourceExtra_scalar(data[0], data[1], data[2], data[3]); |
452 | } |
453 | vec2 get_image_quad_uv(int32_t address, vec2 f) { |
454 | ImageSourceExtra_scalar extra_data = fetch_image_source_extra(address); |
455 | vec4 x = mix((extra_data).st_tl, (extra_data).st_tr, (f).x); |
456 | vec4 y = mix((extra_data).st_bl, (extra_data).st_br, (f).x); |
457 | vec4 z = mix(x, y, (f).y); |
458 | return ((z).sel(X,Y))/((z).w); |
459 | } |
460 | void get_uv(int32_t res_address, vec2 f, ivec2_scalar texture_size, float perspective_f, vec2& out_uv, vec4_scalar& out_uv_sample_bounds) { |
461 | ImageSource_scalar res = fetch_image_source(res_address); |
462 | vec2_scalar uv0 = ((res).uv_rect).p0; |
463 | vec2_scalar uv1 = ((res).uv_rect).p1; |
464 | vec2_scalar inv_texture_size = (make_vec2(1.f))/(make_vec2(texture_size)); |
465 | f = get_image_quad_uv(res_address, f); |
466 | vec2 uv = mix(uv0, uv1, f); |
467 | out_uv = ((uv)*(inv_texture_size))*(perspective_f); |
468 | out_uv_sample_bounds = (make_vec4((uv0)+(make_vec2(0.5f)), (uv1)-(make_vec2(0.5f))))*((inv_texture_size).sel(X,Y,X,Y)); |
469 | } |
470 | void get_uv(int32_t res_address, vec2 f, ivec2_scalar texture_size, Float perspective_f, vec2& out_uv, vec4_scalar& out_uv_sample_bounds) { |
471 | ImageSource_scalar res = fetch_image_source(res_address); |
472 | vec2_scalar uv0 = ((res).uv_rect).p0; |
473 | vec2_scalar uv1 = ((res).uv_rect).p1; |
474 | vec2_scalar inv_texture_size = (make_vec2(1.f))/(make_vec2(texture_size)); |
475 | f = get_image_quad_uv(res_address, f); |
476 | vec2 uv = mix(uv0, uv1, f); |
477 | out_uv = ((uv)*(inv_texture_size))*(perspective_f); |
478 | out_uv_sample_bounds = (make_vec4((uv0)+(make_vec2(0.5f)), (uv1)-(make_vec2(0.5f))))*((inv_texture_size).sel(X,Y,X,Y)); |
479 | } |
480 | void brush_vs(VertexInfo vi, int32_t prim_address, RectWithEndpoint_scalar local_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 unused) { |
481 | vec2 f = (((vi).local_pos)-((local_rect).p0))/(rect_size(local_rect)); |
482 | float perspective_interpolate = ((brush_flags)&(1))!=(0) ? 1.f : 0.f; |
483 | Float perspective_f = mix(((vi).world_pos).w, 1.f, perspective_interpolate); |
484 | (v_perspective).x = perspective_interpolate; |
485 | (v_op).x = (prim_user_data).x; |
486 | get_uv((prim_user_data).y, f, (textureSize(sColor0, 0)).sel(X,Y), 1.f, v_backdrop_uv, v_backdrop_uv_sample_bounds); |
487 | get_uv((prim_user_data).z, f, (textureSize(sColor1, 0)).sel(X,Y), perspective_f, v_src_uv, v_src_uv_sample_bounds); |
488 | } |
489 | void brush_shader_main_vs(Instance_scalar instance, PrimitiveHeader_scalar ph, Transform_scalar transform, PictureTask_scalar pic_task, ClipArea_scalar clip_area) { |
490 | int32_t edge_flags = (((instance).flags)>>(12))&(15); |
491 | int32_t brush_flags = ((instance).flags)&(4095); |
492 | vec4_scalar segment_data; |
493 | RectWithEndpoint_scalar segment_rect; |
494 | if (((instance).segment_index)==(65535)) { |
495 | { |
496 | segment_rect = (ph).local_rect; |
497 | segment_data = make_vec4(0.f); |
498 | } |
499 | } else { |
500 | int32_t segment_address = (((ph).specific_prim_address)+(3))+(((instance).segment_index)*(2)); |
501 | Array<vec4_scalar,2> segment_info = fetch_from_gpu_cache_2(segment_address); |
502 | segment_rect = RectWithEndpoint_scalar((segment_info[0]).sel(X,Y), (segment_info[0]).sel(Z,W)); |
503 | (segment_rect).p0 += ((ph).local_rect).p0; |
504 | (segment_rect).p1 += ((ph).local_rect).p0; |
505 | segment_data = segment_info[1]; |
506 | } |
507 | RectWithEndpoint_scalar adjusted_segment_rect = segment_rect; |
508 | bool antialiased = (!((transform).is_axis_aligned))||(((brush_flags)&(1024))!=(0)); |
509 | if (antialiased) { |
510 | { |
511 | adjusted_segment_rect = clip_and_init_antialiasing(segment_rect, (ph).local_rect, (ph).local_clip_rect, edge_flags, (ph).z, transform, pic_task); |
512 | ((ph).local_clip_rect).p0 = make_vec2(-(10000000000000000.f)); |
513 | ((ph).local_clip_rect).p1 = make_vec2(10000000000000000.f); |
514 | } |
515 | } else { |
516 | } |
517 | vec2 local_pos = mix((adjusted_segment_rect).p0, (adjusted_segment_rect).p1, (aPosition).sel(X,Y)); |
518 | VertexInfo vi = write_vertex(local_pos, (ph).local_clip_rect, (ph).z, transform, pic_task); |
519 | write_clip((vi).world_pos, clip_area, pic_task); |
520 | 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); |
521 | } |
522 | ALWAYS_INLINE__attribute__((always_inline)) inline void main(void) { |
523 | Instance_scalar instance = decode_instance_attributes(); |
524 | PrimitiveHeader_scalar ph = fetch_prim_header((instance).prim_header_address); |
525 | Transform_scalar transform = fetch_transform((ph).transform_id); |
526 | PictureTask_scalar task = fetch_picture_task((ph).picture_task_address); |
527 | ClipArea_scalar clip_area = fetch_clip_area((instance).clip_address); |
528 | brush_shader_main_vs(instance, ph, transform, task, clip_area); |
529 | } |
530 | static void set_uniform_1i(VertexShaderImpl* impl, int index, int value) { |
531 | Self* self = (Self*)impl; |
532 | if (self->samplers.set_slot(index, value)) return; |
533 | switch (index) { |
534 | case 7: |
535 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sClipMask |
536 | break; |
537 | case 8: |
538 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sColor0 |
539 | break; |
540 | case 9: |
541 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sColor1 |
542 | break; |
543 | case 2: |
544 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sGpuCache |
545 | break; |
546 | case 4: |
547 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sPrimitiveHeadersF |
548 | break; |
549 | case 5: |
550 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sPrimitiveHeadersI |
551 | break; |
552 | case 1: |
553 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sRenderTasks |
554 | break; |
555 | case 3: |
556 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sTransformPalette |
557 | break; |
558 | case 6: |
559 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // uTransform |
560 | break; |
561 | } |
562 | } |
563 | static void set_uniform_4fv(VertexShaderImpl* impl, int index, const float *value) { |
564 | Self* self = (Self*)impl; |
565 | switch (index) { |
566 | case 7: |
567 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sClipMask |
568 | break; |
569 | case 8: |
570 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sColor0 |
571 | break; |
572 | case 9: |
573 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sColor1 |
574 | break; |
575 | case 2: |
576 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sGpuCache |
577 | break; |
578 | case 4: |
579 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sPrimitiveHeadersF |
580 | break; |
581 | case 5: |
582 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sPrimitiveHeadersI |
583 | break; |
584 | case 1: |
585 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sRenderTasks |
586 | break; |
587 | case 3: |
588 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sTransformPalette |
589 | break; |
590 | case 6: |
591 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // uTransform |
592 | break; |
593 | } |
594 | } |
595 | static void set_uniform_matrix4fv(VertexShaderImpl* impl, int index, const float *value) { |
596 | Self* self = (Self*)impl; |
597 | switch (index) { |
598 | case 7: |
599 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sClipMask |
600 | break; |
601 | case 8: |
602 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sColor0 |
603 | break; |
604 | case 9: |
605 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sColor1 |
606 | break; |
607 | case 2: |
608 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sGpuCache |
609 | break; |
610 | case 4: |
611 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sPrimitiveHeadersF |
612 | break; |
613 | case 5: |
614 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sPrimitiveHeadersI |
615 | break; |
616 | case 1: |
617 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sRenderTasks |
618 | break; |
619 | case 3: |
620 | assert(0)(static_cast <bool> (0) ? void (0) : __assert_fail ("0" , __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__ )); // sTransformPalette |
621 | break; |
622 | case 6: |
623 | self->uTransform = mat4_scalar::load_from_ptr(value); |
624 | break; |
625 | } |
626 | } |
627 | static void load_attribs(VertexShaderImpl* impl, VertexAttrib *attribs, uint32_t start, int instance, int count) {Self* self = (Self*)impl; |
628 | load_attrib(self->aPosition, attribs[self->attrib_locations.aPosition], start, instance, count); |
629 | load_flat_attrib(self->aData, attribs[self->attrib_locations.aData], start, instance, count); |
630 | } |
631 | public: |
632 | struct InterpOutputs { |
633 | vec2_scalar v_src_uv; |
634 | vec2_scalar v_backdrop_uv; |
635 | }; |
636 | private: |
637 | ALWAYS_INLINE__attribute__((always_inline)) inline void store_interp_outputs(char* dest_ptr, size_t stride) { |
638 | for(int n = 0; n < 4; n++) { |
639 | auto* dest = reinterpret_cast<InterpOutputs*>(dest_ptr); |
640 | dest->v_src_uv = get_nth(v_src_uv, n); |
641 | dest->v_backdrop_uv = get_nth(v_backdrop_uv, n); |
642 | dest_ptr += stride; |
643 | } |
644 | } |
645 | static void run(VertexShaderImpl* impl, char* interps, size_t interp_stride) { |
646 | Self* self = (Self*)impl; |
647 | self->main(); |
648 | self->store_interp_outputs(interps, interp_stride); |
649 | } |
650 | static void init_batch(VertexShaderImpl* impl) { |
651 | Self* self = (Self*)impl; self->bind_textures(); } |
652 | public: |
653 | brush_mix_blend_ALPHA_PASS_vert() { |
654 | set_uniform_1i_func = &set_uniform_1i; |
655 | set_uniform_4fv_func = &set_uniform_4fv; |
656 | set_uniform_matrix4fv_func = &set_uniform_matrix4fv; |
657 | init_batch_func = &init_batch; |
658 | load_attribs_func = &load_attribs; |
659 | run_primitive_func = &run; |
660 | } |
661 | }; |
662 | |
663 | |
664 | struct brush_mix_blend_ALPHA_PASS_frag : FragmentShaderImpl, brush_mix_blend_ALPHA_PASS_vert { |
665 | private: |
666 | typedef brush_mix_blend_ALPHA_PASS_frag Self; |
667 | #define oFragColorgl_FragColor gl_FragColor |
668 | // vec4 oFragColor; |
669 | // sampler2D sColor0; |
670 | // sampler2D sColor1; |
671 | // sampler2D sColor2; |
672 | struct RectWithSize_scalar { |
673 | vec2_scalar p0; |
674 | vec2_scalar size; |
675 | RectWithSize_scalar() = default; |
676 | RectWithSize_scalar(vec2_scalar p0, vec2_scalar size) : p0(p0), size(size){} |
677 | }; |
678 | struct RectWithSize { |
679 | vec2 p0; |
680 | vec2 size; |
681 | RectWithSize() = default; |
682 | RectWithSize(vec2 p0, vec2 size) : p0(p0), size(size){} |
683 | RectWithSize(vec2_scalar p0, vec2_scalar size):p0(p0),size(size){ |
684 | } |
685 | IMPLICIT RectWithSize(RectWithSize_scalar s):p0(s.p0),size(s.size){ |
686 | } |
687 | friend RectWithSize if_then_else(I32 c, RectWithSize t, RectWithSize e) { return RectWithSize( |
688 | if_then_else(c, t.p0, e.p0), if_then_else(c, t.size, e.size)); |
689 | }}; |
690 | struct RectWithEndpoint_scalar { |
691 | vec2_scalar p0; |
692 | vec2_scalar p1; |
693 | RectWithEndpoint_scalar() = default; |
694 | RectWithEndpoint_scalar(vec2_scalar p0, vec2_scalar p1) : p0(p0), p1(p1){} |
695 | }; |
696 | struct RectWithEndpoint { |
697 | vec2 p0; |
698 | vec2 p1; |
699 | RectWithEndpoint() = default; |
700 | RectWithEndpoint(vec2 p0, vec2 p1) : p0(p0), p1(p1){} |
701 | RectWithEndpoint(vec2_scalar p0, vec2_scalar p1):p0(p0),p1(p1){ |
702 | } |
703 | IMPLICIT RectWithEndpoint(RectWithEndpoint_scalar s):p0(s.p0),p1(s.p1){ |
704 | } |
705 | friend RectWithEndpoint if_then_else(I32 c, RectWithEndpoint t, RectWithEndpoint e) { return RectWithEndpoint( |
706 | if_then_else(c, t.p0, e.p0), if_then_else(c, t.p1, e.p1)); |
707 | }}; |
708 | // sampler2D sGpuCache; |
709 | // vec4_scalar vTransformBounds; |
710 | // sampler2D sClipMask; |
711 | struct Fragment_scalar { |
712 | vec4_scalar color; |
713 | Fragment_scalar() = default; |
714 | explicit Fragment_scalar(vec4_scalar color) : color(color){} |
715 | }; |
716 | struct Fragment { |
717 | vec4 color; |
718 | Fragment() = default; |
719 | explicit Fragment(vec4 color) : color(color){} |
720 | explicit Fragment(vec4_scalar color):color(color){ |
721 | } |
722 | IMPLICIT Fragment(Fragment_scalar s):color(s.color){ |
723 | } |
724 | friend Fragment if_then_else(I32 c, Fragment t, Fragment e) { return Fragment( |
725 | if_then_else(c, t.color, e.color)); |
726 | }}; |
727 | vec2 v_src_uv; |
728 | // vec4_scalar v_src_uv_sample_bounds; |
729 | vec2 v_backdrop_uv; |
730 | // vec4_scalar v_backdrop_uv_sample_bounds; |
731 | // vec2_scalar v_perspective; |
732 | // ivec2_scalar v_op; |
733 | int32_t static constexpr MixBlendMode_Multiply = 1; |
734 | int32_t static constexpr MixBlendMode_Screen = 2; |
735 | int32_t static constexpr MixBlendMode_Overlay = 3; |
736 | int32_t static constexpr MixBlendMode_Darken = 4; |
737 | int32_t static constexpr MixBlendMode_Lighten = 5; |
738 | int32_t static constexpr MixBlendMode_ColorDodge = 6; |
739 | int32_t static constexpr MixBlendMode_ColorBurn = 7; |
740 | int32_t static constexpr MixBlendMode_HardLight = 8; |
741 | int32_t static constexpr MixBlendMode_SoftLight = 9; |
742 | int32_t static constexpr MixBlendMode_Difference = 10; |
743 | int32_t static constexpr MixBlendMode_Exclusion = 11; |
744 | int32_t static constexpr MixBlendMode_Hue = 12; |
745 | int32_t static constexpr MixBlendMode_Saturation = 13; |
746 | int32_t static constexpr MixBlendMode_Color = 14; |
747 | int32_t static constexpr MixBlendMode_Luminosity = 15; |
748 | int32_t static constexpr MixBlendMode_PlusLighter = 16; |
749 | vec3 Multiply(vec3 Cb, vec3 Cs) { |
750 | return (Cb)*(Cs); |
751 | } |
752 | vec3 Screen(vec3 Cb, vec3 Cs) { |
753 | return ((Cb)+(Cs))-((Cb)*(Cs)); |
754 | } |
755 | vec3 HardLight(vec3 Cb, vec3 Cs) { |
756 | vec3 m = Multiply(Cb, (2.f)*(Cs)); |
757 | vec3 s = Screen(Cb, ((2.f)*(Cs))-(1.f)); |
758 | vec3_scalar edge = make_vec3(0.5f, 0.5f, 0.5f); |
759 | return mix(m, s, step(edge, Cs)); |
760 | } |
761 | Float ColorDodge(Float Cb, Float Cs) { |
762 | I32 ret_mask = ~0; |
763 | Float ret; |
764 | auto _c8_ = (Cb)==(0.f); |
765 | ret = 0.f; |
766 | ret_mask = ~I32(_c8_); |
767 | auto _c9_ = (Cs)==(1.f); |
768 | auto _c10_ = (~(_c8_))&(_c9_); |
769 | ret = if_then_else(ret_mask & I32(_c10_), 1.f, ret); |
770 | ret_mask &= ~I32(_c10_); |
771 | _c9_ = (~(_c8_))&(~(_c9_)); |
772 | ret = if_then_else(ret_mask & I32(_c9_), min(1.f, (Cb)/((1.f)-(Cs))), ret); |
773 | ret_mask &= ~I32(_c9_); |
774 | return ret; |
775 | } |
776 | Float ColorBurn(Float Cb, Float Cs) { |
777 | I32 ret_mask = ~0; |
778 | Float ret; |
779 | auto _c14_ = (Cb)==(1.f); |
780 | ret = 1.f; |
781 | ret_mask = ~I32(_c14_); |
782 | auto _c15_ = (Cs)==(0.f); |
783 | auto _c16_ = (~(_c14_))&(_c15_); |
784 | ret = if_then_else(ret_mask & I32(_c16_), 0.f, ret); |
785 | ret_mask &= ~I32(_c16_); |
786 | _c15_ = (~(_c14_))&(~(_c15_)); |
787 | ret = if_then_else(ret_mask & I32(_c15_), (1.f)-(min(1.f, ((1.f)-(Cb))/(Cs))), ret); |
788 | ret_mask &= ~I32(_c15_); |
Value stored to 'ret_mask' is never read | |
789 | return ret; |
790 | } |
791 | Float SoftLight(Float Cb, Float Cs) { |
792 | I32 ret_mask = ~0; |
793 | Float ret; |
794 | auto _c20_ = (Cs)<=(0.5f); |
795 | { |
796 | ret = (Cb)-((((1.f)-((2.f)*(Cs)))*(Cb))*((1.f)-(Cb))); |
797 | ret_mask = ~I32(_c20_); |
798 | } |
799 | { |
800 | Float D; |
801 | auto _c21_ = (Cb)<=(0.25f); |
802 | auto _c22_ = (~(_c20_))&(_c21_); |
803 | D = if_then_else(_c22_,(((((16.f)*(Cb))-(12.f))*(Cb))+(4.f))*(Cb),D); |
804 | _c21_ = (~(_c20_))&(~(_c21_)); |
805 | D = if_then_else(_c21_,sqrt__glsl_sqrt(Cb),D); |
806 | ret = if_then_else(ret_mask & I32(~(_c20_)), (Cb)+((((2.f)*(Cs))-(1.f))*((D)-(Cb))), ret); |
807 | ret_mask &= ~I32(~(_c20_)); |
808 | } |
809 | return ret; |
810 | } |
811 | vec3 Difference(vec3 Cb, vec3 Cs) { |
812 | return abs__glsl_abs((Cb)-(Cs)); |
813 | } |
814 | Float Lum(vec3 c) { |
815 | vec3_scalar f = make_vec3(0.3f, 0.59f, 0.11f); |
816 | return dot(c, f); |
817 | } |
818 | vec3 ClipColor(vec3 C) { |
819 | Float L = Lum(C); |
820 | Float n = min((C).x, min((C).y, (C).z)); |
821 | Float x = max((C).x, max((C).y, (C).z)); |
822 | auto _c25_ = (n)<(0.f); |
823 | C = if_then_else(_c25_,(L)+((((C)-(L))*(L))/((L)-(n))),C); |
824 | auto _c26_ = (x)>(1.f); |
825 | C = if_then_else(_c26_,(L)+((((C)-(L))*((1.f)-(L)))/((x)-(L))),C); |
826 | return C; |
827 | } |
828 | vec3 SetLum(vec3 C, Float l) { |
829 | Float d = (l)-(Lum(C)); |
830 | return ClipColor((C)+(d)); |
831 | } |
832 | void SetSatInner(Float& Cmin, Float& Cmid, Float& Cmax, Float s, I32 _cond_mask_) { |
833 | auto _c47_ = (Cmax)>(Cmin); |
834 | auto _c48_ = (_cond_mask_)&(_c47_); |
835 | { |
836 | Cmid = if_then_else(_c48_,(((Cmid)-(Cmin))*(s))/((Cmax)-(Cmin)),Cmid); |
837 | Cmax = if_then_else(_c48_,s,Cmax); |
838 | } |
839 | _c47_ = (_cond_mask_)&(~(_c47_)); |
840 | { |
841 | Cmid = if_then_else(_c47_,0.f,Cmid); |
842 | Cmax = if_then_else(_c47_,0.f,Cmax); |
843 | } |
844 | Cmin = if_then_else(_cond_mask_,0.f,Cmin); |
845 | } |
846 | vec3 SetSat(vec3 C, Float s) { |
847 | auto _c36_ = ((C).x)<=((C).y); |
848 | { |
849 | auto _c37_ = ((C).y)<=((C).z); |
850 | auto _c38_ = (_c36_)&(_c37_); |
851 | { |
852 | SetSatInner((C).x, (C).y, (C).z, s, _c38_); |
853 | } |
854 | _c37_ = (_c36_)&(~(_c37_)); |
855 | { |
856 | auto _c39_ = ((C).x)<=((C).z); |
857 | auto _c40_ = (_c37_)&(_c39_); |
858 | { |
859 | SetSatInner((C).x, (C).z, (C).y, s, _c40_); |
860 | } |
861 | _c39_ = (_c37_)&(~(_c39_)); |
862 | { |
863 | SetSatInner((C).z, (C).x, (C).y, s, _c39_); |
864 | } |
865 | } |
866 | } |
867 | { |
868 | auto _c41_ = ((C).x)<=((C).z); |
869 | auto _c42_ = (~(_c36_))&(_c41_); |
870 | { |
871 | SetSatInner((C).y, (C).x, (C).z, s, _c42_); |
872 | } |
873 | _c41_ = (~(_c36_))&(~(_c41_)); |
874 | { |
875 | auto _c43_ = ((C).y)<=((C).z); |
876 | auto _c44_ = (_c41_)&(_c43_); |
877 | { |
878 | SetSatInner((C).y, (C).z, (C).x, s, _c44_); |
879 | } |
880 | _c43_ = (_c41_)&(~(_c43_)); |
881 | { |
882 | SetSatInner((C).z, (C).y, (C).x, s, _c43_); |
883 | } |
884 | } |
885 | } |
886 | return C; |
887 | } |
888 | Float Sat(vec3 c) { |
889 | return (max((c).x, max((c).y, (c).z)))-(min((c).x, min((c).y, (c).z))); |
890 | } |
891 | vec3 Hue(vec3 Cb, vec3 Cs) { |
892 | return SetLum(SetSat(Cs, Sat(Cb)), Lum(Cb)); |
893 | } |
894 | vec3 Saturation(vec3 Cb, vec3 Cs) { |
895 | return SetLum(SetSat(Cb, Sat(Cs)), Lum(Cb)); |
896 | } |
897 | vec3 Color(vec3 Cb, vec3 Cs) { |
898 | return SetLum(Cs, Lum(Cb)); |
899 | } |
900 | vec3 Luminosity(vec3 Cb, vec3 Cs) { |
901 | return SetLum(Cb, Lum(Cs)); |
902 | } |
903 | Fragment brush_fs() { |
904 | Float perspective_divisor = mix((gl_FragCoord).w, 1.f, (v_perspective).x); |
905 | vec2 src_uv = (v_src_uv)*(perspective_divisor); |
906 | src_uv = clamp(src_uv, (v_src_uv_sample_bounds).sel(X,Y), (v_src_uv_sample_bounds).sel(Z,W)); |
907 | vec2 backdrop_uv = clamp(v_backdrop_uv, (v_backdrop_uv_sample_bounds).sel(X,Y), (v_backdrop_uv_sample_bounds).sel(Z,W)); |
908 | vec4 Cb = texture(sColor0, backdrop_uv); |
909 | vec4 Cs = texture(sColor1, src_uv); |
910 | auto _c3_ = ((Cb).w)!=(0.f); |
911 | { |
912 | (Cb).lsel(R,G,B) = if_then_else(_c3_,(Cb).sel(R,G,B)/(Cb).w,(Cb).sel(R,G,B)); |
913 | } |
914 | auto _c4_ = ((Cs).w)!=(0.f); |
915 | { |
916 | (Cs).lsel(R,G,B) = if_then_else(_c4_,(Cs).sel(R,G,B)/(Cs).w,(Cs).sel(R,G,B)); |
917 | } |
918 | vec4 result = make_vec4(1.f, 1.f, 0.f, 1.f); |
919 | switch (((v_op).x)&(255)) { |
920 | case MixBlendMode_Multiply: |
921 | (result).lsel(R,G,B) = Multiply((Cb).sel(R,G,B), (Cs).sel(R,G,B)); |
922 | break; |
923 | case MixBlendMode_Overlay: |
924 | (result).lsel(R,G,B) = HardLight((Cs).sel(R,G,B), (Cb).sel(R,G,B)); |
925 | break; |
926 | case MixBlendMode_Darken: |
927 | (result).lsel(R,G,B) = min((Cs).sel(R,G,B), (Cb).sel(R,G,B)); |
928 | break; |
929 | case MixBlendMode_Lighten: |
930 | (result).lsel(R,G,B) = max((Cs).sel(R,G,B), (Cb).sel(R,G,B)); |
931 | break; |
932 | case MixBlendMode_ColorDodge: |
933 | (result).x = ColorDodge((Cb).x, (Cs).x); |
934 | (result).y = ColorDodge((Cb).y, (Cs).y); |
935 | (result).z = ColorDodge((Cb).z, (Cs).z); |
936 | break; |
937 | case MixBlendMode_ColorBurn: |
938 | (result).x = ColorBurn((Cb).x, (Cs).x); |
939 | (result).y = ColorBurn((Cb).y, (Cs).y); |
940 | (result).z = ColorBurn((Cb).z, (Cs).z); |
941 | break; |
942 | case MixBlendMode_HardLight: |
943 | (result).lsel(R,G,B) = HardLight((Cb).sel(R,G,B), (Cs).sel(R,G,B)); |
944 | break; |
945 | case MixBlendMode_SoftLight: |
946 | (result).x = SoftLight((Cb).x, (Cs).x); |
947 | (result).y = SoftLight((Cb).y, (Cs).y); |
948 | (result).z = SoftLight((Cb).z, (Cs).z); |
949 | break; |
950 | case MixBlendMode_Difference: |
951 | (result).lsel(R,G,B) = Difference((Cb).sel(R,G,B), (Cs).sel(R,G,B)); |
952 | break; |
953 | case MixBlendMode_Hue: |
954 | (result).lsel(R,G,B) = Hue((Cb).sel(R,G,B), (Cs).sel(R,G,B)); |
955 | break; |
956 | case MixBlendMode_Saturation: |
957 | (result).lsel(R,G,B) = Saturation((Cb).sel(R,G,B), (Cs).sel(R,G,B)); |
958 | break; |
959 | case MixBlendMode_Color: |
960 | (result).lsel(R,G,B) = Color((Cb).sel(R,G,B), (Cs).sel(R,G,B)); |
961 | break; |
962 | case MixBlendMode_Luminosity: |
963 | (result).lsel(R,G,B) = Luminosity((Cb).sel(R,G,B), (Cs).sel(R,G,B)); |
964 | break; |
965 | case MixBlendMode_Screen: |
966 | case MixBlendMode_Exclusion: |
967 | case MixBlendMode_PlusLighter: |
968 | break; |
969 | default: |
970 | break; |
971 | } |
972 | (result).lsel(R,G,B) = (((1.f)-((Cb).w))*((Cs).sel(R,G,B)))+(((Cb).w)*((result).sel(R,G,B))); |
973 | (result).w = (Cs).w; |
974 | (result).lsel(R,G,B) *= (result).w; |
975 | return Fragment(result); |
976 | } |
977 | float do_clip() { |
978 | return 1.f; |
979 | } |
980 | void write_output(vec4 color) { |
981 | oFragColorgl_FragColor = color; |
982 | } |
983 | ALWAYS_INLINE__attribute__((always_inline)) inline void main(void) { |
984 | Fragment frag = brush_fs(); |
985 | float clip_alpha = do_clip(); |
986 | (frag).color *= clip_alpha; |
987 | write_output((frag).color); |
988 | } |
989 | typedef brush_mix_blend_ALPHA_PASS_vert::InterpOutputs InterpInputs; |
990 | InterpInputs interp_step; |
991 | struct InterpPerspective { |
992 | vec2 v_src_uv; |
993 | vec2 v_backdrop_uv; |
994 | }; |
995 | InterpPerspective interp_perspective; |
996 | static 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_; |
997 | self->v_src_uv = init_interp(init->v_src_uv, step->v_src_uv); |
998 | self->interp_step.v_src_uv = step->v_src_uv * 4.0f; |
999 | self->v_backdrop_uv = init_interp(init->v_backdrop_uv, step->v_backdrop_uv); |
1000 | self->interp_step.v_backdrop_uv = step->v_backdrop_uv * 4.0f; |
1001 | } |
1002 | static 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_; |
1003 | Float w = 1.0f / self->gl_FragCoord.w; |
1004 | self->interp_perspective.v_src_uv = init_interp(init->v_src_uv, step->v_src_uv); |
1005 | self->v_src_uv = self->interp_perspective.v_src_uv * w; |
1006 | self->interp_step.v_src_uv = step->v_src_uv * 4.0f; |
1007 | self->interp_perspective.v_backdrop_uv = init_interp(init->v_backdrop_uv, step->v_backdrop_uv); |
1008 | self->v_backdrop_uv = self->interp_perspective.v_backdrop_uv * w; |
1009 | self->interp_step.v_backdrop_uv = step->v_backdrop_uv * 4.0f; |
1010 | } |
1011 | ALWAYS_INLINE__attribute__((always_inline)) inline void step_interp_inputs(int steps = 4) { |
1012 | float chunks = steps * 0.25f; |
1013 | v_src_uv += interp_step.v_src_uv * chunks; |
1014 | v_backdrop_uv += interp_step.v_backdrop_uv * chunks; |
1015 | } |
1016 | ALWAYS_INLINE__attribute__((always_inline)) inline void step_perspective_inputs(int steps = 4) { |
1017 | step_perspective(steps); |
1018 | float chunks = steps * 0.25f; |
1019 | Float w = 1.0f / gl_FragCoord.w; |
1020 | interp_perspective.v_src_uv += interp_step.v_src_uv * chunks; |
1021 | v_src_uv = w * interp_perspective.v_src_uv; |
1022 | interp_perspective.v_backdrop_uv += interp_step.v_backdrop_uv * chunks; |
1023 | v_backdrop_uv = w * interp_perspective.v_backdrop_uv; |
1024 | } |
1025 | static void run(FragmentShaderImpl* impl) { |
1026 | Self* self = (Self*)impl; |
1027 | self->main(); |
1028 | self->step_interp_inputs(); |
1029 | } |
1030 | static void skip(FragmentShaderImpl* impl, int steps) { |
1031 | Self* self = (Self*)impl; |
1032 | self->step_interp_inputs(steps); |
1033 | } |
1034 | static void run_perspective(FragmentShaderImpl* impl) { |
1035 | Self* self = (Self*)impl; |
1036 | self->main(); |
1037 | self->step_perspective_inputs(); |
1038 | } |
1039 | static void skip_perspective(FragmentShaderImpl* impl, int steps) { |
1040 | Self* self = (Self*)impl; |
1041 | self->step_perspective_inputs(steps); |
1042 | } |
1043 | public: |
1044 | brush_mix_blend_ALPHA_PASS_frag() { |
1045 | init_span_func = &read_interp_inputs; |
1046 | run_func = &run; |
1047 | skip_func = &skip; |
1048 | enable_perspective(); |
1049 | init_span_w_func = &read_perspective_inputs; |
1050 | run_w_func = &run_perspective; |
1051 | skip_w_func = &skip_perspective; |
1052 | } |
1053 | }; |
1054 | |
1055 | struct brush_mix_blend_ALPHA_PASS_program : ProgramImpl, brush_mix_blend_ALPHA_PASS_frag { |
1056 | int get_uniform(const char *name) const override { |
1057 | if (strcmp("sClipMask", name) == 0) { return 7; } |
1058 | if (strcmp("sColor0", name) == 0) { return 8; } |
1059 | if (strcmp("sColor1", name) == 0) { return 9; } |
1060 | if (strcmp("sGpuCache", name) == 0) { return 2; } |
1061 | if (strcmp("sPrimitiveHeadersF", name) == 0) { return 4; } |
1062 | if (strcmp("sPrimitiveHeadersI", name) == 0) { return 5; } |
1063 | if (strcmp("sRenderTasks", name) == 0) { return 1; } |
1064 | if (strcmp("sTransformPalette", name) == 0) { return 3; } |
1065 | if (strcmp("uTransform", name) == 0) { return 6; } |
1066 | return -1; |
1067 | } |
1068 | void bind_attrib(const char* name, int index) override { |
1069 | attrib_locations.bind_loc(name, index); |
1070 | } |
1071 | int get_attrib(const char* name) const override { |
1072 | return attrib_locations.get_loc(name); |
1073 | } |
1074 | size_t interpolants_size() const override { return sizeof(InterpOutputs); } |
1075 | VertexShaderImpl* get_vertex_shader() override { |
1076 | return this; |
1077 | } |
1078 | FragmentShaderImpl* get_fragment_shader() override { |
1079 | return this; |
1080 | } |
1081 | const char* get_name() const override { return "brush_mix_blend_ALPHA_PASS"; } |
1082 | static ProgramImpl* loader() { return new brush_mix_blend_ALPHA_PASS_program; } |
1083 | }; |
1084 | |
1085 | int32_t constexpr brush_mix_blend_ALPHA_PASS_frag::MixBlendMode_Multiply; |
1086 | int32_t constexpr brush_mix_blend_ALPHA_PASS_frag::MixBlendMode_Screen; |
1087 | int32_t constexpr brush_mix_blend_ALPHA_PASS_frag::MixBlendMode_Overlay; |
1088 | int32_t constexpr brush_mix_blend_ALPHA_PASS_frag::MixBlendMode_Darken; |
1089 | int32_t constexpr brush_mix_blend_ALPHA_PASS_frag::MixBlendMode_Lighten; |
1090 | int32_t constexpr brush_mix_blend_ALPHA_PASS_frag::MixBlendMode_ColorDodge; |
1091 | int32_t constexpr brush_mix_blend_ALPHA_PASS_frag::MixBlendMode_ColorBurn; |
1092 | int32_t constexpr brush_mix_blend_ALPHA_PASS_frag::MixBlendMode_HardLight; |
1093 | int32_t constexpr brush_mix_blend_ALPHA_PASS_frag::MixBlendMode_SoftLight; |
1094 | int32_t constexpr brush_mix_blend_ALPHA_PASS_frag::MixBlendMode_Difference; |
1095 | int32_t constexpr brush_mix_blend_ALPHA_PASS_frag::MixBlendMode_Exclusion; |
1096 | int32_t constexpr brush_mix_blend_ALPHA_PASS_frag::MixBlendMode_Hue; |
1097 | int32_t constexpr brush_mix_blend_ALPHA_PASS_frag::MixBlendMode_Saturation; |
1098 | int32_t constexpr brush_mix_blend_ALPHA_PASS_frag::MixBlendMode_Color; |
1099 | int32_t constexpr brush_mix_blend_ALPHA_PASS_frag::MixBlendMode_Luminosity; |
1100 | int32_t constexpr brush_mix_blend_ALPHA_PASS_frag::MixBlendMode_PlusLighter; |