Welcome to mirror list, hosted at ThFree Co, Russian Federation.

overlay_edit_mode_info.hh « infos « shaders « overlay « engines « draw « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9396a6d3f2f1d4d513ebb5afb518b766e6ca39af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
/* SPDX-License-Identifier: GPL-2.0-or-later */

#include "gpu_shader_create_info.hh"

GPU_SHADER_INTERFACE_INFO(overlay_edit_flat_color_iface, "").flat(Type::VEC4, "finalColor");
GPU_SHADER_INTERFACE_INFO(overlay_edit_smooth_color_iface, "").smooth(Type::VEC4, "finalColor");
GPU_SHADER_INTERFACE_INFO(overlay_edit_nopersp_color_iface, "")
    .no_perspective(Type::VEC4, "finalColor");

/* -------------------------------------------------------------------- */
/** \name Edit Mesh
 * \{ */

GPU_SHADER_CREATE_INFO(overlay_edit_mesh_common)
    .define("blender_srgb_to_framebuffer_space(a)", "a")
    .sampler(0, ImageType::DEPTH_2D, "depthTex")
    .fragment_out(0, Type::VEC4, "fragColor")
    .push_constant(Type::BOOL, "selectFaces")
    .push_constant(Type::BOOL, "selectEdges")
    .push_constant(Type::FLOAT, "alpha")
    .push_constant(Type::IVEC4, "dataMask")
    .vertex_source("overlay_edit_mesh_vert.glsl")
    .additional_info("draw_modelmat", "draw_globals");

GPU_SHADER_INTERFACE_INFO(overlay_edit_mesh_vert_iface, "")
    .smooth(Type::VEC4, "finalColor")
    .smooth(Type::FLOAT, "vertexCrease");

GPU_SHADER_CREATE_INFO(overlay_edit_mesh_vert)
    .do_static_compilation(true)
    .builtins(BuiltinBits::POINT_SIZE)
    .define("VERT")
    .vertex_in(0, Type::VEC3, "pos")
    .vertex_in(1, Type::IVEC4, "data")
    .vertex_in(2, Type::VEC3, "vnor")
    .vertex_out(overlay_edit_mesh_vert_iface)
    .fragment_source("overlay_point_varying_color_frag.glsl")
    .additional_info("overlay_edit_mesh_common");

GPU_SHADER_INTERFACE_INFO(overlay_edit_mesh_edge_iface, "geometry_in")
    .smooth(Type::VEC4, "finalColor_")
    .smooth(Type::VEC4, "finalColorOuter_")
    .smooth(Type::INT, "selectOverride_");

GPU_SHADER_INTERFACE_INFO(overlay_edit_mesh_edge_geom_iface, "geometry_out")
    .smooth(Type::VEC4, "finalColor")
    .flat(Type::VEC4, "finalColorOuter")
    .no_perspective(Type::FLOAT, "edgeCoord");

GPU_SHADER_CREATE_INFO(overlay_edit_mesh_edge)
    .do_static_compilation(true)
    .define("EDGE")
    .vertex_in(0, Type::VEC3, "pos")
    .vertex_in(1, Type::IVEC4, "data")
    .vertex_in(2, Type::VEC3, "vnor")
    .push_constant(Type::BOOL, "do_smooth_wire")
    .vertex_out(overlay_edit_mesh_edge_iface)
    .geometry_out(overlay_edit_mesh_edge_geom_iface)
    .geometry_layout(PrimitiveIn::LINES, PrimitiveOut::TRIANGLE_STRIP, 4)
    .geometry_source("overlay_edit_mesh_geom.glsl")
    .fragment_source("overlay_edit_mesh_frag.glsl")
    .additional_info("overlay_edit_mesh_common");

GPU_SHADER_CREATE_INFO(overlay_edit_mesh_edge_flat)
    .do_static_compilation(true)
    .define("FLAT")
    .additional_info("overlay_edit_mesh_edge");

GPU_SHADER_CREATE_INFO(overlay_edit_mesh_face)
    .do_static_compilation(true)
    .define("FACE")
    .vertex_in(0, Type::VEC3, "pos")
    .vertex_in(1, Type::IVEC4, "data")
    .vertex_in(2, Type::VEC3, "vnor")
    .vertex_out(overlay_edit_flat_color_iface)
    .fragment_source("overlay_varying_color.glsl")
    .additional_info("overlay_edit_mesh_common");

GPU_SHADER_CREATE_INFO(overlay_edit_mesh_facedot)
    .do_static_compilation(true)
    .define("FACEDOT")
    .vertex_in(0, Type::VEC3, "pos")
    .vertex_in(1, Type::IVEC4, "data")
    .vertex_in(2, Type::VEC4, "norAndFlag")
    .define("vnor", "norAndFlag.xyz")
    .vertex_out(overlay_edit_flat_color_iface)
    .fragment_source("overlay_point_varying_color_frag.glsl")
    .additional_info("overlay_edit_mesh_common");

GPU_SHADER_CREATE_INFO(overlay_edit_mesh_normal)
    .do_static_compilation(true)
    .vertex_in(0, Type::VEC3, "pos")
    .vertex_in(1, Type::VEC4, "lnor")
    .vertex_in(2, Type::VEC4, "vnor")
    .vertex_in(3, Type::VEC4, "norAndFlag")
    .sampler(0, ImageType::DEPTH_2D, "depthTex")
    .push_constant(Type::FLOAT, "normalSize")
    .push_constant(Type::FLOAT, "normalScreenSize")
    .push_constant(Type::FLOAT, "alpha")
    .push_constant(Type::BOOL, "isConstantScreenSizeNormals")
    .vertex_out(overlay_edit_flat_color_iface)
    .fragment_out(0, Type::VEC4, "fragColor")
    .vertex_source("overlay_edit_mesh_normal_vert.glsl")
    .fragment_source("overlay_varying_color.glsl")
    .additional_info("draw_modelmat_instanced_attr", "draw_globals");

GPU_SHADER_INTERFACE_INFO(overlay_edit_mesh_analysis_iface, "").smooth(Type::VEC4, "weightColor");

GPU_SHADER_CREATE_INFO(overlay_edit_mesh_analysis)
    .do_static_compilation(true)
    .vertex_in(0, Type::VEC3, "pos")
    .vertex_in(1, Type::FLOAT, "weight")
    .sampler(0, ImageType::FLOAT_1D, "weightTex")
    .fragment_out(0, Type::VEC4, "fragColor")
    .vertex_out(overlay_edit_mesh_analysis_iface)
    .vertex_source("overlay_edit_mesh_analysis_vert.glsl")
    .fragment_source("overlay_edit_mesh_analysis_frag.glsl")
    .additional_info("draw_modelmat");

GPU_SHADER_CREATE_INFO(overlay_edit_mesh_skin_root)
    .do_static_compilation(true)
    .vertex_in(0, Type::VEC3, "pos")
    .vertex_in(1, Type::FLOAT, "size")
    .vertex_in(2, Type::VEC3, "local_pos")
    .vertex_out(overlay_edit_flat_color_iface)
    .fragment_out(0, Type::VEC4, "fragColor")
    .vertex_source("overlay_edit_mesh_skin_root_vert.glsl")
    .fragment_source("overlay_varying_color.glsl")
    .additional_info("draw_modelmat_instanced_attr", "draw_globals");

GPU_SHADER_CREATE_INFO(overlay_edit_mesh_vert_clipped)
    .do_static_compilation(true)
    .additional_info("overlay_edit_mesh_vert", "drw_clipped");

GPU_SHADER_CREATE_INFO(overlay_edit_mesh_edge_clipped)
    .do_static_compilation(true)
    .additional_info("overlay_edit_mesh_edge", "drw_clipped");

GPU_SHADER_CREATE_INFO(overlay_edit_mesh_edge_flat_clipped)
    .do_static_compilation(true)
    .additional_info("overlay_edit_mesh_edge_flat", "drw_clipped");

GPU_SHADER_CREATE_INFO(overlay_edit_mesh_face_clipped)
    .do_static_compilation(true)
    .additional_info("overlay_edit_mesh_face", "drw_clipped");

GPU_SHADER_CREATE_INFO(overlay_edit_mesh_facedot_clipped)
    .do_static_compilation(true)
    .additional_info("overlay_edit_mesh_facedot", "drw_clipped");

GPU_SHADER_CREATE_INFO(overlay_edit_mesh_normal_clipped)
    .do_static_compilation(true)
    .additional_info("overlay_edit_mesh_normal", "drw_clipped");

GPU_SHADER_CREATE_INFO(overlay_edit_mesh_analysis_clipped)
    .do_static_compilation(true)
    .additional_info("overlay_edit_mesh_analysis", "drw_clipped");

GPU_SHADER_CREATE_INFO(overlay_edit_mesh_skin_root_clipped)
    .do_static_compilation(true)
    .additional_info("overlay_edit_mesh_skin_root", "drw_clipped");

/** \} */

/* -------------------------------------------------------------------- */
/** \name Edit UV
 * \{ */

GPU_SHADER_INTERFACE_INFO(overlay_edit_uv_iface, "geom_in")
    .smooth(Type::FLOAT, "selectionFac")
    .no_perspective(Type::VEC2, "stipplePos")
    .flat(Type::VEC2, "stippleStart");

GPU_SHADER_INTERFACE_INFO(overlay_edit_uv_geom_iface, "geom_out")
    .smooth(Type::FLOAT, "selectionFac")
    .no_perspective(Type::FLOAT, "edgeCoord")
    .no_perspective(Type::VEC2, "stipplePos")
    .flat(Type::VEC2, "stippleStart");

GPU_SHADER_CREATE_INFO(overlay_edit_uv_edges)
    .do_static_compilation(true)
    .vertex_in(0, Type::VEC2, "au")
    .vertex_in(1, Type::INT, "flag")
    .vertex_out(overlay_edit_uv_iface)
    .geometry_layout(PrimitiveIn::LINES, PrimitiveOut::TRIANGLE_STRIP, 4)
    .geometry_out(overlay_edit_uv_geom_iface)
    .push_constant(Type::INT, "lineStyle")
    .push_constant(Type::BOOL, "doSmoothWire")
    .push_constant(Type::FLOAT, "alpha")
    .push_constant(Type::FLOAT, "dashLength")
    .fragment_out(0, Type::VEC4, "fragColor")
    .vertex_source("overlay_edit_uv_edges_vert.glsl")
    .geometry_source("overlay_edit_uv_edges_geom.glsl")
    .fragment_source("overlay_edit_uv_edges_frag.glsl")
    .additional_info("draw_mesh", "draw_globals");

GPU_SHADER_CREATE_INFO(overlay_edit_uv_edges_select)
    .do_static_compilation(true)
    .define("USE_EDGE_SELECT")
    .additional_info("overlay_edit_uv_edges");

GPU_SHADER_CREATE_INFO(overlay_edit_uv_faces)
    .do_static_compilation(true)
    .vertex_in(0, Type::VEC2, "au")
    .vertex_in(1, Type::INT, "flag")
    .push_constant(Type::FLOAT, "uvOpacity")
    .vertex_out(overlay_edit_flat_color_iface)
    .fragment_out(0, Type::VEC4, "fragColor")
    .vertex_source("overlay_edit_uv_faces_vert.glsl")
    .fragment_source("overlay_varying_color.glsl")
    .additional_info("draw_mesh", "draw_globals");

GPU_SHADER_CREATE_INFO(overlay_edit_uv_face_dots)
    .do_static_compilation(true)
    .vertex_in(0, Type::VEC2, "au")
    .vertex_in(1, Type::INT, "flag")
    .push_constant(Type::FLOAT, "pointSize")
    .vertex_out(overlay_edit_flat_color_iface)
    .fragment_out(0, Type::VEC4, "fragColor")
    .vertex_source("overlay_edit_uv_face_dots_vert.glsl")
    .fragment_source("overlay_varying_color.glsl")
    .additional_info("draw_mesh", "draw_globals");

GPU_SHADER_INTERFACE_INFO(overlay_edit_uv_vert_iface, "")
    .smooth(Type::VEC4, "fillColor")
    .smooth(Type::VEC4, "outlineColor")
    .smooth(Type::VEC4, "radii");

GPU_SHADER_CREATE_INFO(overlay_edit_uv_verts)
    .do_static_compilation(true)
    .vertex_in(0, Type::VEC2, "au")
    .vertex_in(1, Type::INT, "flag")
    .push_constant(Type::FLOAT, "pointSize")
    .push_constant(Type::FLOAT, "outlineWidth")
    .push_constant(Type::VEC4, "color")
    .vertex_out(overlay_edit_uv_vert_iface)
    .fragment_out(0, Type::VEC4, "fragColor")
    .vertex_source("overlay_edit_uv_verts_vert.glsl")
    .fragment_source("overlay_edit_uv_verts_frag.glsl")
    .additional_info("draw_mesh", "draw_globals");

GPU_SHADER_CREATE_INFO(overlay_edit_uv_tiled_image_borders)
    .do_static_compilation(true)
    .vertex_in(0, Type::VEC3, "pos")
    .push_constant(Type::VEC4, "color")
    .fragment_out(0, Type::VEC4, "fragColor")
    .vertex_source("overlay_edit_uv_tiled_image_borders_vert.glsl")
    .fragment_source("overlay_uniform_color_frag.glsl")
    .additional_info("draw_mesh");

GPU_SHADER_INTERFACE_INFO(edit_uv_image_iface, "").smooth(Type::VEC2, "uvs");

GPU_SHADER_CREATE_INFO(overlay_edit_uv_stencil_image)
    .do_static_compilation(true)
    .vertex_in(0, Type::VEC3, "pos")
    .vertex_out(edit_uv_image_iface)
    .vertex_source("overlay_edit_uv_image_vert.glsl")
    .sampler(0, ImageType::FLOAT_2D, "imgTexture")
    .push_constant(Type::BOOL, "imgPremultiplied")
    .push_constant(Type::BOOL, "imgAlphaBlend")
    .push_constant(Type::VEC4, "color")
    .fragment_out(0, Type::VEC4, "fragColor")
    .fragment_source("overlay_image_frag.glsl")
    .additional_info("draw_mesh");

GPU_SHADER_CREATE_INFO(overlay_edit_uv_mask_image)
    .do_static_compilation(true)
    .vertex_in(0, Type::VEC3, "pos")
    .vertex_out(edit_uv_image_iface)
    .sampler(0, ImageType::FLOAT_2D, "imgTexture")
    .push_constant(Type::VEC4, "color")
    .fragment_out(0, Type::VEC4, "fragColor")
    .vertex_source("overlay_edit_uv_image_vert.glsl")
    .fragment_source("overlay_edit_uv_image_mask_frag.glsl")
    .additional_info("draw_mesh");

/** \} */

/* -------------------------------------------------------------------- */
/** \name UV Stretching
 * \{ */

GPU_SHADER_CREATE_INFO(overlay_edit_uv_stretching)
    .vertex_in(0, Type::VEC2, "pos")
    .push_constant(Type::VEC2, "aspect")
    .vertex_out(overlay_edit_nopersp_color_iface)
    .fragment_out(0, Type::VEC4, "fragColor")
    .vertex_source("overlay_edit_uv_stretching_vert.glsl")
    .fragment_source("overlay_varying_color.glsl")
    .additional_info("draw_mesh", "draw_globals");

GPU_SHADER_CREATE_INFO(overlay_edit_uv_stretching_area)
    .do_static_compilation(true)
    .vertex_in(1, Type::FLOAT, "ratio")
    .push_constant(Type::FLOAT, "totalAreaRatio")
    .additional_info("overlay_edit_uv_stretching");

GPU_SHADER_CREATE_INFO(overlay_edit_uv_stretching_angle)
    .do_static_compilation(true)
    .define("STRETCH_ANGLE")
    .vertex_in(1, Type::VEC2, "uv_angles")
    .vertex_in(2, Type::FLOAT, "angle")
    .additional_info("overlay_edit_uv_stretching");

/** \} */

/* -------------------------------------------------------------------- */
/** \name Edit Curve
 * \{ */

GPU_SHADER_INTERFACE_INFO(overlay_edit_curve_handle_iface, "vert").flat(Type::INT, "flag");

GPU_SHADER_CREATE_INFO(overlay_edit_curve_handle)
    .do_static_compilation(true)
    .typedef_source("overlay_shader_shared.h")
    .vertex_in(0, Type::VEC3, "pos")
    .vertex_in(1, Type::INT, "data")
    .vertex_out(overlay_edit_curve_handle_iface)
    .geometry_layout(PrimitiveIn::LINES, PrimitiveOut::TRIANGLE_STRIP, 10)
    .geometry_out(overlay_edit_smooth_color_iface)
    .push_constant(Type::BOOL, "showCurveHandles")
    .push_constant(Type::INT, "curveHandleDisplay")
    .fragment_out(0, Type::VEC4, "fragColor")
    .vertex_source("overlay_edit_curve_handle_vert.glsl")
    .geometry_source("overlay_edit_curve_handle_geom.glsl")
    .fragment_source("overlay_varying_color.glsl")
    .additional_info("draw_mesh", "draw_globals");

GPU_SHADER_CREATE_INFO(overlay_edit_curve_handle_clipped)
    .do_static_compilation(true)
    .additional_info("overlay_edit_curve_handle", "drw_clipped");

GPU_SHADER_CREATE_INFO(overlay_edit_curve_point)
    .do_static_compilation(true)
    .typedef_source("overlay_shader_shared.h")
    .vertex_in(0, Type::VEC3, "pos")
    .vertex_in(1, Type::INT, "data")
    .vertex_out(overlay_edit_flat_color_iface)
    .push_constant(Type::BOOL, "showCurveHandles")
    .push_constant(Type::INT, "curveHandleDisplay")
    .fragment_out(0, Type::VEC4, "fragColor")
    .vertex_source("overlay_edit_curve_point_vert.glsl")
    .fragment_source("overlay_point_varying_color_frag.glsl")
    .additional_info("draw_mesh", "draw_globals");

GPU_SHADER_CREATE_INFO(overlay_edit_curve_point_clipped)
    .do_static_compilation(true)
    .additional_info("overlay_edit_curve_point", "drw_clipped");

GPU_SHADER_CREATE_INFO(overlay_edit_curve_wire)
    .do_static_compilation(true)
    .vertex_in(0, Type::VEC3, "pos")
    .vertex_in(1, Type::VEC3, "nor")
    .vertex_in(2, Type::VEC3, "tan")
    .vertex_in(3, Type::FLOAT, "rad")
    .push_constant(Type::FLOAT, "normalSize")
    .vertex_out(overlay_edit_flat_color_iface)
    .fragment_out(0, Type::VEC4, "fragColor")
    .vertex_source("overlay_edit_curve_wire_vert.glsl")
    .fragment_source("overlay_varying_color.glsl")
    .additional_info("draw_modelmat", "draw_resource_id_uniform", "draw_globals");

GPU_SHADER_CREATE_INFO(overlay_edit_curve_wire_clipped)
    .do_static_compilation(true)
    .additional_info("overlay_edit_curve_wire", "drw_clipped");

/** \} */

/* -------------------------------------------------------------------- */
/** \name Edit Curve
 * \{ */

GPU_SHADER_CREATE_INFO(overlay_edit_lattice_point)
    .do_static_compilation(true)
    .vertex_in(0, Type::VEC3, "pos")
    .vertex_in(1, Type::INT, "data")
    .vertex_out(overlay_edit_flat_color_iface)
    .fragment_out(0, Type::VEC4, "fragColor")
    .vertex_source("overlay_edit_lattice_point_vert.glsl")
    .fragment_source("overlay_point_varying_color_frag.glsl")
    .additional_info("draw_mesh", "draw_globals");

GPU_SHADER_CREATE_INFO(overlay_edit_lattice_point_clipped)
    .do_static_compilation(true)
    .additional_info("overlay_edit_lattice_point", "drw_clipped");

GPU_SHADER_CREATE_INFO(overlay_edit_lattice_wire)
    .do_static_compilation(true)
    .vertex_in(0, Type::VEC3, "pos")
    .vertex_in(1, Type::FLOAT, "weight")
    .sampler(0, ImageType::FLOAT_1D, "weightTex")
    .vertex_out(overlay_edit_smooth_color_iface)
    .fragment_out(0, Type::VEC4, "fragColor")
    .vertex_source("overlay_edit_lattice_wire_vert.glsl")
    .fragment_source("overlay_varying_color.glsl")
    .additional_info("draw_mesh", "draw_globals");

GPU_SHADER_CREATE_INFO(overlay_edit_lattice_wire_clipped)
    .do_static_compilation(true)
    .additional_info("overlay_edit_lattice_wire", "drw_clipped");

/** \} */

/* -------------------------------------------------------------------- */
/** \name Edit Particle
 * \{ */

GPU_SHADER_CREATE_INFO(overlay_edit_particle_strand)
    .do_static_compilation(true)
    .vertex_in(0, Type::VEC3, "pos")
    .vertex_in(1, Type::FLOAT, "color")
    .sampler(0, ImageType::FLOAT_1D, "weightTex")
    .push_constant(Type::BOOL, "useWeight")
    .vertex_out(overlay_edit_smooth_color_iface)
    .fragment_out(0, Type::VEC4, "fragColor")
    .vertex_source("overlay_edit_particle_strand_vert.glsl")
    .fragment_source("overlay_varying_color.glsl")
    .additional_info("draw_mesh", "draw_globals");

GPU_SHADER_CREATE_INFO(overlay_edit_particle_strand_clipped)
    .do_static_compilation(true)
    .additional_info("overlay_edit_particle_strand", "drw_clipped");

GPU_SHADER_CREATE_INFO(overlay_edit_particle_point)
    .do_static_compilation(true)
    .vertex_in(0, Type::VEC3, "pos")
    .vertex_in(1, Type::FLOAT, "color")
    .vertex_out(overlay_edit_flat_color_iface)
    .fragment_out(0, Type::VEC4, "fragColor")
    .vertex_source("overlay_edit_particle_point_vert.glsl")
    .fragment_source("overlay_point_varying_color_frag.glsl")
    .additional_info("draw_mesh", "draw_globals");

GPU_SHADER_CREATE_INFO(overlay_edit_particle_point_clipped)
    .do_static_compilation(true)
    .additional_info("overlay_edit_particle_point", "drw_clipped");

/** \} */

/* -------------------------------------------------------------------- */
/** \name Edit GPencil
 * \{ */

GPU_SHADER_CREATE_INFO(overlay_edit_gpencil)
    .typedef_source("overlay_shader_shared.h")
    .vertex_in(0, Type::VEC3, "pos")
    .vertex_in(1, Type::INT, "ma")
    .vertex_in(2, Type::UINT, "vflag")
    .vertex_in(3, Type::FLOAT, "weight")
    .push_constant(Type::FLOAT, "normalSize")
    .push_constant(Type::BOOL, "doMultiframe")
    .push_constant(Type::BOOL, "doStrokeEndpoints")
    .push_constant(Type::BOOL, "hideSelect")
    .push_constant(Type::BOOL, "doWeightColor")
    .push_constant(Type::FLOAT, "gpEditOpacity")
    .push_constant(Type::VEC4, "gpEditColor")
    .sampler(0, ImageType::FLOAT_1D, "weightTex")
    .fragment_out(0, Type::VEC4, "fragColor")
    .vertex_source("overlay_edit_gpencil_vert.glsl")
    .additional_info("draw_mesh", "draw_globals");

GPU_SHADER_CREATE_INFO(overlay_edit_gpencil_wire)
    .do_static_compilation(true)
    .vertex_out(overlay_edit_smooth_color_iface)
    .fragment_source("overlay_varying_color.glsl")
    .additional_info("overlay_edit_gpencil");

GPU_SHADER_CREATE_INFO(overlay_edit_gpencil_wire_clipped)
    .do_static_compilation(true)
    .additional_info("overlay_edit_gpencil_wire", "drw_clipped");

GPU_SHADER_CREATE_INFO(overlay_edit_gpencil_point)
    .do_static_compilation(true)
    .define("USE_POINTS")
    .vertex_out(overlay_edit_flat_color_iface)
    .fragment_source("overlay_point_varying_color_frag.glsl")
    .additional_info("overlay_edit_gpencil");

GPU_SHADER_CREATE_INFO(overlay_edit_gpencil_point_clipped)
    .do_static_compilation(true)
    .additional_info("overlay_edit_gpencil_point", "drw_clipped");

/* TODO(fclem): Refactor this to take list of point instead of drawing 1 point per drawcall. */
GPU_SHADER_CREATE_INFO(overlay_edit_gpencil_guide_point)
    .do_static_compilation(true)
    .vertex_in(0, Type::VEC3, "pos")
    .vertex_in(1, Type::INT, "data")
    .vertex_out(overlay_edit_flat_color_iface)
    .push_constant(Type::VEC3, "pPosition")
    .push_constant(Type::FLOAT, "pSize")
    .push_constant(Type::VEC4, "pColor")
    .fragment_out(0, Type::VEC4, "fragColor")
    .vertex_source("overlay_edit_gpencil_guide_vert.glsl")
    .fragment_source("overlay_point_varying_color_frag.glsl")
    .additional_info("draw_mesh", "draw_globals");

GPU_SHADER_CREATE_INFO(overlay_edit_gpencil_guide_point_clipped)
    .do_static_compilation(true)
    .additional_info("overlay_edit_gpencil_guide_point", "drw_clipped");

/** \} */

/* -------------------------------------------------------------------- */
/** \name Depth Only Shader
 *
 * Used to occlude edit geometry which might not be rendered by the render engine.
 * \{ */

GPU_SHADER_CREATE_INFO(overlay_depth_only)
    .do_static_compilation(true)
    .vertex_in(0, Type::VEC3, "pos")
    .vertex_source("overlay_depth_only_vert.glsl")
    .fragment_source("overlay_depth_only_frag.glsl")
    .additional_info("draw_mesh");

GPU_SHADER_CREATE_INFO(overlay_depth_only_clipped)
    .do_static_compilation(true)
    .additional_info("overlay_depth_only", "drw_clipped");

/** \} */

/* -------------------------------------------------------------------- */
/** \name Uniform color
 * \{ */

GPU_SHADER_CREATE_INFO(overlay_uniform_color)
    .do_static_compilation(true)
    .vertex_in(0, Type::VEC3, "pos")
    .push_constant(Type::VEC4, "color")
    .fragment_out(0, Type::VEC4, "fragColor")
    .vertex_source("overlay_depth_only_vert.glsl")
    .fragment_source("overlay_uniform_color_frag.glsl")
    .additional_info("draw_mesh");

GPU_SHADER_CREATE_INFO(overlay_uniform_color_clipped)
    .do_static_compilation(true)
    .additional_info("overlay_depth_only", "drw_clipped");

/** \} */