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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jbakker>2022-01-17 16:32:03 +0300
committerJeroen Bakker <jeroen@blender.org>2022-01-17 16:32:28 +0300
commit8fb2ff458ba579dba08bfdf57d043ad158b5db07 (patch)
treee6324c08c69de3e8ed34c1f85d0b2982fa1d38ed /source/blender/gpu/shaders
parent08822801acf648d23791fa308ec8c1c26f86963e (diff)
GPUShaderCreateInfo for interface abstraction
This is a first part of the Shader Create Info system could be. A shader create info provides a way to define shader structure, resources and interfaces. This makes for a quick way to provide backend agnostic binding informations while also making shader variations easy to declare. - Clear source input (only one file). Cleans up the GPU api since we can create a shader from one descriptor - Resources and interfaces are generated by the backend (much simpler than parsing). - Bindings are explicit from position in the array. - GPUShaderInterface becomes a trivial translation of enums and string copy. - No external dependency to third party lib. - Cleaner code, less fragmentation of resources in several libs. - Easy to modify / extend at runtime. - no parser involve, very easy to code. - Does not hold any data, can be static and kept on disc. - Could hold precompiled bytecode for static shaders. This also includes a new global dependency system. GLSL shaders can include other sources by using #pragma BLENDER_REQUIRE(...). This patch already migrated several builtin shaders. Other shaders should be migrated one at a time, and could be done inside master. There is a new compile directive `WITH_GPU_SHADER_BUILDER` this is an optional directive for linting shaders to increase turn around time. What is remaining: - pyGPU API {T94975} - Migration of other shaders. This could be a community effort. Reviewed By: jbakker Maniphest Tasks: T94975 Differential Revision: https://developer.blender.org/D13360
Diffstat (limited to 'source/blender/gpu/shaders')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_area_borders_frag.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_area_borders_vert.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_flat_color_vert.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_image_multi_rect_vert.glsl4
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_image_rect_vert.glsl2
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_image_vert.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_line_dashed_frag.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_line_dashed_uniform_color_vert.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_nodelink_frag.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_nodelink_vert.glsl54
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_aa_vert.glsl2
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_outline_aa_vert.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_point_varying_size_varying_color_vert.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_smooth_color_frag.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_smooth_color_vert.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_vert.glsl8
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_widget_base_frag.glsl2
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl15
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_widget_shadow_frag.glsl2
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_widget_shadow_vert.glsl5
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_clipped_uniform_color_vert.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl9
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_image_vert.glsl2
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_line_dashed_uniform_color_vert.glsl7
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_normal_vert.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_passthrough_vert.glsl6
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_point_fixed_size_varying_color_vert.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_aa_vert.glsl9
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_point_varying_size_varying_color_vert.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl7
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl11
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_polyline_vert.glsl9
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_smooth_color_frag.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_smooth_color_vert.glsl9
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_vert.glsl9
-rw-r--r--source/blender/gpu/shaders/gpu_shader_cfg_world_clip_lib.glsl6
-rw-r--r--source/blender/gpu/shaders/gpu_shader_checker_frag.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_colorspace_lib.glsl2
-rw-r--r--source/blender/gpu/shaders/gpu_shader_common_obinfos_lib.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_diag_stripes_frag.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_flat_color_alpha_test_0_frag.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_flat_color_frag.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_flat_id_frag.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_geometry.glsl5
-rw-r--r--source/blender/gpu/shaders/gpu_shader_gpencil_stroke_frag.glsl8
-rw-r--r--source/blender/gpu/shaders/gpu_shader_gpencil_stroke_geom.glsl138
-rw-r--r--source/blender/gpu/shaders/gpu_shader_gpencil_stroke_vert.glsl14
-rw-r--r--source/blender/gpu/shaders/gpu_shader_image_color_frag.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_image_desaturate_frag.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_image_frag.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_image_modulate_alpha_frag.glsl2
-rw-r--r--source/blender/gpu/shaders/gpu_shader_image_overlays_merge_frag.glsl2
-rw-r--r--source/blender/gpu/shaders/gpu_shader_image_overlays_stereo_merge_frag.glsl8
-rw-r--r--source/blender/gpu/shaders/gpu_shader_image_shuffle_color_frag.glsl9
-rw-r--r--source/blender/gpu/shaders/gpu_shader_image_varying_color_frag.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl9
-rw-r--r--source/blender/gpu/shaders/gpu_shader_keyframe_shape_frag.glsl2
-rw-r--r--source/blender/gpu/shaders/gpu_shader_keyframe_shape_vert.glsl10
-rw-r--r--source/blender/gpu/shaders/gpu_shader_point_uniform_color_aa_frag.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_point_uniform_color_outline_aa_frag.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_point_varying_color_frag.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_point_varying_color_varying_outline_aa_frag.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_simple_lighting_frag.glsl17
-rw-r--r--source/blender/gpu/shaders/gpu_shader_text_frag.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_text_vert.glsl3
-rw-r--r--source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl3
-rw-r--r--source/blender/gpu/shaders/infos/gpu_clip_planes_info.hh29
-rw-r--r--source/blender/gpu/shaders/infos/gpu_interface_info.hh33
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_2D_area_borders_info.hh39
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_2D_checker_info.hh36
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_2D_diag_stripes_info.hh37
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_2D_flat_color_info.hh38
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_2D_image_color_info.hh30
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_2D_image_desaturate_color_info.hh31
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_2D_image_info.hh39
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_2D_image_overlays_merge_info.hh39
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_2D_image_overlays_stereo_merge_info.hh36
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_2D_image_rect_color_info.hh40
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_2D_image_shuffle_color_info.hh31
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_2D_line_dashed_uniform_color_info.hh35
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_2D_nodelink_info.hh72
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_2D_point_uniform_size_uniform_color_aa_info.hh36
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_2D_point_uniform_size_uniform_color_outline_aa_info.hh38
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_2D_point_varying_size_varying_color_info.hh36
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_2D_smooth_color_info.hh37
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_2D_uniform_color_info.hh35
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_3D_depth_only_info.hh38
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_3D_flat_color_info.hh42
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_3D_image_modulate_alpha_info.hh38
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_3D_line_dashed_uniform_color_info.hh35
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_3D_point_info.hh62
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_3D_polyline_info.hh33
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_3D_smooth_color_info.hh41
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_3D_uniform_color_info.hh39
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_gpencil_stroke_info.hh51
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_instance_varying_color_varying_size_info.hh39
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_keyframe_shape_info.hh47
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_simple_lighting_info.hh40
-rw-r--r--source/blender/gpu/shaders/infos/gpu_shader_text_info.hh46
-rw-r--r--source/blender/gpu/shaders/infos/gpu_srgb_to_framebuffer_space_info.hh27
100 files changed, 1645 insertions, 183 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_area_borders_frag.glsl b/source/blender/gpu/shaders/gpu_shader_2D_area_borders_frag.glsl
index 5a36b414229..4ebcb9c397f 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_area_borders_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_area_borders_frag.glsl
@@ -1,10 +1,11 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform vec4 color;
uniform float scale;
in vec2 uv;
out vec4 fragColor;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_area_borders_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_area_borders_vert.glsl
index d20ddcd27c0..c6f01d68eee 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_area_borders_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_area_borders_vert.glsl
@@ -1,4 +1,4 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
uniform vec4 rect;
@@ -8,6 +8,7 @@ uniform float scale;
in vec2 pos;
out vec2 uv;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_flat_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_flat_color_vert.glsl
index df2507c0dc9..494ef8d888e 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_flat_color_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_flat_color_vert.glsl
@@ -1,10 +1,11 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
in vec2 pos;
in vec4 color;
flat out vec4 finalColor;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_image_multi_rect_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_image_multi_rect_vert.glsl
index bdc0d37a7ae..f4d8a941a6d 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_image_multi_rect_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_image_multi_rect_vert.glsl
@@ -4,7 +4,8 @@
*/
/* Same as ICON_DRAW_CACHE_SIZE */
-#define MAX_CALLS 16
+#ifndef USE_GPU_SHADER_CREATE_INFO
+# define MAX_CALLS 16
uniform vec4 calls_data[MAX_CALLS * 3];
@@ -12,6 +13,7 @@ out vec2 texCoord_interp;
flat out vec4 finalColor;
in vec2 pos;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_image_rect_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_image_rect_vert.glsl
index ab9c30505c2..d9a5aeeef46 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_image_rect_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_image_rect_vert.glsl
@@ -3,11 +3,13 @@
* does not need any vertex input (producing less call to immBegin/End)
*/
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
uniform vec4 rect_icon;
uniform vec4 rect_geom;
out vec2 texCoord_interp;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_image_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_image_vert.glsl
index cdb066c9c52..0b5e3759dfb 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_image_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_image_vert.glsl
@@ -1,10 +1,11 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
/* Keep in sync with intern/opencolorio/gpu_shader_display_transform_vertex.glsl */
in vec2 texCoord;
in vec2 pos;
out vec2 texCoord_interp;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_line_dashed_frag.glsl b/source/blender/gpu/shaders/gpu_shader_2D_line_dashed_frag.glsl
index 43f259671fa..af9a24d1280 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_line_dashed_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_line_dashed_frag.glsl
@@ -6,6 +6,8 @@
* Dashed is performed in screen space.
*/
+#ifndef USE_GPU_SHADER_CREATE_INFO
+
uniform float dash_width;
/* Simple mode, discarding non-dash parts (so no need for blending at all). */
@@ -23,6 +25,7 @@ noperspective in vec2 stipple_pos;
flat in vec2 stipple_start;
out vec4 fragColor;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_line_dashed_uniform_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_line_dashed_uniform_color_vert.glsl
index 15362d020e4..9d52820188b 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_line_dashed_uniform_color_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_line_dashed_uniform_color_vert.glsl
@@ -5,7 +5,7 @@
*
* Dashed is performed in screen space.
*/
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
uniform vec4 color;
@@ -18,6 +18,7 @@ flat out vec4 color_vert;
/* We leverage hardware interpolation to compute distance along the line. */
noperspective out vec2 stipple_pos; /* In screen space */
flat out vec2 stipple_start; /* In screen space */
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_nodelink_frag.glsl b/source/blender/gpu/shaders/gpu_shader_2D_nodelink_frag.glsl
index 134a7d00127..c4d56579b18 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_nodelink_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_nodelink_frag.glsl
@@ -1,4 +1,4 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
in float colorGradient;
in vec4 finalColor;
in float lineU;
@@ -8,6 +8,7 @@ flat in float dashAlpha;
flat in int isMainLine;
out vec4 fragColor;
+#endif
#define DASH_WIDTH 10.0
#define ANTIALIAS 1.0
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_nodelink_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_nodelink_vert.glsl
index 8325568988c..3d3a042de65 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_nodelink_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_nodelink_vert.glsl
@@ -4,13 +4,15 @@
#define MID_VERTEX 65
+#ifndef USE_GPU_SHADER_CREATE_INFO
+
/* u is position along the curve, defining the tangent space.
* v is "signed" distance (compressed to [0..1] range) from the pos in expand direction */
in vec2 uv;
in vec2 pos; /* verts position in the curve tangent space */
in vec2 expand;
-#ifdef USE_INSTANCE
+# ifdef USE_INSTANCE
/* Instance attrs. */
in vec2 P0;
in vec2 P1;
@@ -27,21 +29,10 @@ in float dash_alpha;
uniform vec4 colors[6];
-# define colStart (colid_doarrow[0] < 3 ? start_color : colors[colid_doarrow[0]])
-# define colEnd (colid_doarrow[1] < 3 ? end_color : colors[colid_doarrow[1]])
-# define colShadow colors[colid_doarrow[2]]
-# define doArrow (colid_doarrow[3] != 0)
-# define doMuted (domuted[0] != 0)
-
-#else
+# else
/* Single curve drawcall, use uniform. */
uniform vec2 bezierPts[4];
-# define P0 bezierPts[0]
-# define P1 bezierPts[1]
-# define P2 bezierPts[2]
-# define P3 bezierPts[3]
-
uniform vec4 colors[3];
uniform bool doArrow;
uniform bool doMuted;
@@ -50,11 +41,7 @@ uniform float thickness;
uniform float dash_factor;
uniform float dash_alpha;
-# define colShadow colors[0]
-# define colStart colors[1]
-# define colEnd colors[2]
-
-#endif
+# endif
uniform float expandSize;
uniform float arrowSize;
@@ -67,6 +54,33 @@ flat out float lineLength;
flat out float dashFactor;
flat out float dashAlpha;
flat out int isMainLine;
+#endif
+
+#ifdef USE_INSTANCE
+# define colStart (colid_doarrow[0] < 3 ? start_color : node_link_data.colors[colid_doarrow[0]])
+# define colEnd (colid_doarrow[1] < 3 ? end_color : node_link_data.colors[colid_doarrow[1]])
+# define colShadow node_link_data.colors[colid_doarrow[2]]
+# define doArrow (colid_doarrow[3] != 0)
+# define doMuted (domuted[0] != 0)
+
+#else
+# define P0 node_link_data.bezierPts[0]
+# define P1 node_link_data.bezierPts[1]
+# define P2 node_link_data.bezierPts[2]
+# define P3 node_link_data.bezierPts[3]
+# define cols node_link_data.colors
+# define doArrow node_link_data.doArrow
+# define doMuted node_link_data.doMuted
+# define dim_factor node_link_data.dim_factor
+# define thickness node_link_data.thickness
+# define dash_factor node_link_data.dash_factor
+# define dash_alpha node_link_data.dash_alpha
+
+# define colShadow node_link_data.colors[0]
+# define colStart node_link_data.colors[1]
+# define colEnd node_link_data.colors[2]
+
+#endif
/* Define where along the noodle the gradient will starts and ends.
* Use 0.25 instead of 0.35-0.65, because of a visual shift issue. */
@@ -101,7 +115,7 @@ void main(void)
vec2 normal = tangent.yx * vec2(-1.0, 1.0);
/* Position vertex on the curve tangent space */
- point += (pos.x * tangent + pos.y * normal) * arrowSize;
+ point += (pos.x * tangent + pos.y * normal) * node_link_data.arrowSize;
gl_Position = ModelViewProjectionMatrix * vec4(point, 0.0, 1.0);
@@ -139,7 +153,7 @@ void main(void)
finalColor[3] *= dim_factor;
/* Expand into a line */
- gl_Position.xy += exp_axis * expandSize * expand_dist * thickness;
+ gl_Position.xy += exp_axis * node_link_data.expandSize * expand_dist * thickness;
/* If the link is not muted or is not a reroute arrow the points are squashed to the center of
* the line. Magic numbers are defined in drawnode.c */
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_aa_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_aa_vert.glsl
index 1453393aa9f..f2b6aa1f12c 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_aa_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_aa_vert.glsl
@@ -1,9 +1,11 @@
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
uniform float size;
in vec2 pos;
out vec2 radii;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_outline_aa_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_outline_aa_vert.glsl
index 5c555b2d3e7..5d97fca1116 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_outline_aa_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_outline_aa_vert.glsl
@@ -1,10 +1,11 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
uniform float size;
uniform float outlineWidth;
in vec2 pos;
out vec4 radii;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_point_varying_size_varying_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_point_varying_size_varying_color_vert.glsl
index 469370b9173..6ba6f980406 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_point_varying_size_varying_color_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_point_varying_size_varying_color_vert.glsl
@@ -1,10 +1,11 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
in vec2 pos;
in float size;
in vec4 color;
out vec4 finalColor;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_frag.glsl b/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_frag.glsl
index 1333c00682c..4d887a37807 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_frag.glsl
@@ -1,6 +1,7 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
noperspective in vec4 finalColor;
out vec4 fragColor;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_vert.glsl
index fcf436d50af..5d19aea9168 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_vert.glsl
@@ -1,10 +1,11 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
in vec2 pos;
in vec4 color;
noperspective out vec4 finalColor;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_vert.glsl
index de6547715f3..698f20ae1f9 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_vert.glsl
@@ -1,11 +1,13 @@
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
-#ifdef UV_POS
+# ifdef UV_POS
in vec2 u;
-# define pos u
-#else
+# define pos u
+# else
in vec2 pos;
+# endif
#endif
void main()
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_widget_base_frag.glsl b/source/blender/gpu/shaders/gpu_shader_2D_widget_base_frag.glsl
index 6dd0201535d..a03b88db342 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_widget_base_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_widget_base_frag.glsl
@@ -1,3 +1,4 @@
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform vec3 checkerColorAndSize;
noperspective in vec2 uvInterp;
@@ -12,6 +13,7 @@ flat in vec4 embossColor;
flat in float lineWidth;
out vec4 fragColor;
+#endif
vec3 compute_masks(vec2 uv)
{
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl
index b5036b51d9d..80b93baf20a 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl
@@ -1,12 +1,13 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
-#define MAX_PARAM 12
-#ifdef USE_INSTANCE
-# define MAX_INSTANCE 6
+# define MAX_PARAM 12
+# ifdef USE_INSTANCE
+# define MAX_INSTANCE 6
uniform vec4 parameters[MAX_PARAM * MAX_INSTANCE];
-#else
+# else
uniform vec4 parameters[MAX_PARAM];
+# endif
#endif
/* gl_InstanceID is supposed to be 0 if not drawing instances, but this seems
@@ -41,6 +42,7 @@ uniform vec4 parameters[MAX_PARAM];
#define doAlphaCheck (alphaDiscard < 0.0)
#define discardFactor abs(alphaDiscard)
+#ifndef USE_GPU_SHADER_CREATE_INFO
noperspective out vec2 uvInterp;
flat out vec2 outRectSize;
flat out vec4 outRoundCorners;
@@ -51,8 +53,9 @@ flat out float lineWidth;
noperspective out float butCo;
flat out float discardFac;
-#ifdef OS_MAC
+# ifdef OS_MAC
in float dummy;
+# endif
#endif
vec2 do_widget(void)
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_widget_shadow_frag.glsl b/source/blender/gpu/shaders/gpu_shader_2D_widget_shadow_frag.glsl
index e8a6a43191e..a624d3f2f8b 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_widget_shadow_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_widget_shadow_frag.glsl
@@ -1,9 +1,11 @@
+#ifndef USE_GPU_SHADER_CREATE_INFO
in float shadowFalloff;
out vec4 fragColor;
uniform float alpha;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_widget_shadow_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_widget_shadow_vert.glsl
index dc2849c8aa9..d3eed997292 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_widget_shadow_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_widget_shadow_vert.glsl
@@ -51,9 +51,12 @@ const vec2 cornervec[36] = vec2[36](vec2(0.0, 1.0),
#define INNER_FLAG uint(1 << 10) /* is inner vert */
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
uniform vec4 parameters[4];
+#endif
+
/* radi and rad per corner */
#define recti parameters[0]
#define rect parameters[1]
@@ -61,9 +64,11 @@ uniform vec4 parameters[4];
#define rads parameters[2].y
#define roundCorners parameters[3]
+#ifndef USE_GPU_SHADER_CREATE_INFO
in uint vflag;
out float shadowFalloff;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_clipped_uniform_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_clipped_uniform_color_vert.glsl
index 16424ece2b6..1a87796f7c4 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_clipped_uniform_color_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_clipped_uniform_color_vert.glsl
@@ -1,9 +1,10 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 ModelMatrix;
uniform vec4 ClipPlane;
in vec3 pos;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl
index 91f986d23ad..b6132113bc9 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_flat_color_vert.glsl
@@ -1,13 +1,16 @@
+#pragma BLENDER_REQUIRE(gpu_shader_cfg_world_clip_lib.glsl)
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
-#ifdef USE_WORLD_CLIP_PLANES
+# ifdef USE_WORLD_CLIP_PLANES
uniform mat4 ModelMatrix;
-#endif
+# endif
in vec3 pos;
in vec4 color;
flat out vec4 finalColor;
+#endif
void main()
{
@@ -16,6 +19,6 @@ void main()
finalColor = color;
#ifdef USE_WORLD_CLIP_PLANES
- world_clip_planes_calc_clip_distance((ModelMatrix * pos_4d).xyz);
+ world_clip_planes_calc_clip_distance((clipPlanes.ModelMatrix * pos_4d).xyz);
#endif
}
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_image_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_image_vert.glsl
index 0fb8d06e317..908d442739a 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_image_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_image_vert.glsl
@@ -1,9 +1,11 @@
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
in vec2 texCoord;
in vec3 pos;
out vec2 texCoord_interp;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_line_dashed_uniform_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_line_dashed_uniform_color_vert.glsl
index aefa47275f5..9328e0a13e9 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_line_dashed_uniform_color_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_line_dashed_uniform_color_vert.glsl
@@ -6,11 +6,13 @@
* Dashed is performed in screen space.
*/
+#ifndef USE_GPU_SHADER_CREATE_INFO
+
uniform mat4 ModelViewProjectionMatrix;
-#ifdef USE_WORLD_CLIP_PLANES
+# ifdef USE_WORLD_CLIP_PLANES
uniform mat4 ModelMatrix;
-#endif
+# endif
uniform vec4 color;
uniform vec2 viewport_size;
@@ -22,6 +24,7 @@ flat out vec4 color_vert;
/* We leverage hardware interpolation to compute distance along the line. */
noperspective out vec2 stipple_pos; /* In screen space */
flat out vec2 stipple_start; /* In screen space */
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_normal_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_normal_vert.glsl
index 252fee87015..18fed69eff6 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_normal_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_normal_vert.glsl
@@ -1,10 +1,11 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
uniform mat3 NormalMatrix;
in vec3 pos;
in vec3 nor;
out vec3 normal;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_passthrough_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_passthrough_vert.glsl
index 12594b04da9..52e9e71fdd8 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_passthrough_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_passthrough_vert.glsl
@@ -1,9 +1,11 @@
-#ifdef USE_WORLD_CLIP_PLANES
+#ifndef USE_GPU_SHADER_CREATE_INFO
+# ifdef USE_WORLD_CLIP_PLANES
uniform mat4 ModelMatrix;
-#endif
+# endif
/* Does Nothing */
in vec3 pos;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_point_fixed_size_varying_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_point_fixed_size_varying_color_vert.glsl
index 776656fc2df..504b3f75373 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_point_fixed_size_varying_color_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_point_fixed_size_varying_color_vert.glsl
@@ -1,9 +1,10 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
in vec3 pos;
in vec4 color;
out vec4 finalColor;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_aa_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_aa_vert.glsl
index 5d67658c639..7f143ccc28d 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_aa_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_point_uniform_size_aa_vert.glsl
@@ -1,12 +1,15 @@
+#pragma BLENDER_REQUIRE(gpu_shader_cfg_world_clip_lib.glsl)
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
-#ifdef USE_WORLD_CLIP_PLANES
+# ifdef USE_WORLD_CLIP_PLANES
uniform mat4 ModelMatrix;
-#endif
+# endif
uniform float size;
in vec3 pos;
out vec2 radii;
+#endif
void main()
{
@@ -25,6 +28,6 @@ void main()
radii /= size;
#ifdef USE_WORLD_CLIP_PLANES
- world_clip_planes_calc_clip_distance((ModelMatrix * pos_4d).xyz);
+ world_clip_planes_calc_clip_distance((clipPlanes.ModelMatrix * pos_4d).xyz);
#endif
}
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_point_varying_size_varying_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_point_varying_size_varying_color_vert.glsl
index 3bc72535266..f048e143da7 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_point_varying_size_varying_color_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_point_varying_size_varying_color_vert.glsl
@@ -1,10 +1,11 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
in vec3 pos;
in float size;
in vec4 color;
out vec4 finalColor;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl b/source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl
index 3ea8f7dbfbe..8687763f4c1 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl
@@ -1,14 +1,15 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform float lineWidth;
uniform bool lineSmooth = true;
in vec4 finalColor;
noperspective in float smoothline;
-#ifdef CLIP
+# ifdef CLIP
in float clip;
-#endif
+# endif
out vec4 fragColor;
+#endif
#define SMOOTH_WIDTH 1.0
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl b/source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl
index 70026398937..627e91af4d6 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl
@@ -1,4 +1,4 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
layout(lines) in;
layout(triangle_strip, max_vertices = 4) out;
@@ -7,17 +7,18 @@ uniform vec2 viewportSize;
uniform float lineWidth;
uniform bool lineSmooth = true;
-#if !defined(UNIFORM)
+# if !defined(UNIFORM)
in vec4 finalColor_g[];
-#endif
+# endif
-#ifdef CLIP
+# ifdef CLIP
in float clip_g[];
out float clip;
-#endif
+# endif
out vec4 finalColor;
noperspective out float smoothline;
+#endif
#define SMOOTH_WIDTH 1.0
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_polyline_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_polyline_vert.glsl
index 28aa2a4ccc6..5c673494870 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_polyline_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_polyline_vert.glsl
@@ -1,18 +1,19 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 ModelMatrix;
uniform vec4 ClipPlane;
in vec3 pos;
-#if !defined(UNIFORM)
+# if !defined(UNIFORM)
in vec4 color;
out vec4 finalColor_g;
-#endif
+# endif
-#ifdef CLIP
+# ifdef CLIP
out float clip_g;
+# endif
#endif
void main()
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_smooth_color_frag.glsl b/source/blender/gpu/shaders/gpu_shader_3D_smooth_color_frag.glsl
index 3a2d96c9929..de555cc5706 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_smooth_color_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_smooth_color_frag.glsl
@@ -1,6 +1,7 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
in vec4 finalColor;
out vec4 fragColor;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_smooth_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_smooth_color_vert.glsl
index 4eafb7b7be3..56a1210c957 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_smooth_color_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_smooth_color_vert.glsl
@@ -1,14 +1,17 @@
+#pragma BLENDER_REQUIRE(gpu_shader_cfg_world_clip_lib.glsl)
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
-#ifdef USE_WORLD_CLIP_PLANES
+# ifdef USE_WORLD_CLIP_PLANES
uniform mat4 ModelMatrix;
-#endif
+# endif
in vec3 pos;
in vec4 color;
out vec4 finalColor;
+#endif
void main()
{
@@ -16,6 +19,6 @@ void main()
finalColor = color;
#ifdef USE_WORLD_CLIP_PLANES
- world_clip_planes_calc_clip_distance((ModelMatrix * vec4(pos, 1.0)).xyz);
+ world_clip_planes_calc_clip_distance((clipPlanes.ModelMatrix * vec4(pos, 1.0)).xyz);
#endif
}
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_vert.glsl
index 70bb881ffea..1d7b7df49a8 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_vert.glsl
@@ -1,17 +1,20 @@
+#pragma BLENDER_REQUIRE(gpu_shader_cfg_world_clip_lib.glsl)
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
-#ifdef USE_WORLD_CLIP_PLANES
+# ifdef USE_WORLD_CLIP_PLANES
uniform mat4 ModelMatrix;
-#endif
+# endif
in vec3 pos;
+#endif
void main()
{
gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
#ifdef USE_WORLD_CLIP_PLANES
- world_clip_planes_calc_clip_distance((ModelMatrix * vec4(pos, 1.0)).xyz);
+ world_clip_planes_calc_clip_distance((clipPlanes.ModelMatrix * vec4(pos, 1.0)).xyz);
#endif
}
diff --git a/source/blender/gpu/shaders/gpu_shader_cfg_world_clip_lib.glsl b/source/blender/gpu/shaders/gpu_shader_cfg_world_clip_lib.glsl
index 46cf2fe09a2..cdc716db7a4 100644
--- a/source/blender/gpu/shaders/gpu_shader_cfg_world_clip_lib.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_cfg_world_clip_lib.glsl
@@ -1,7 +1,9 @@
#ifdef USE_WORLD_CLIP_PLANES
# if defined(GPU_VERTEX_SHADER) || defined(GPU_GEOMETRY_SHADER)
+# ifndef USE_GPU_SHADER_CREATE_INFO
uniform vec4 WorldClipPlanes[6];
+# endif
# define _world_clip_planes_calc_clip_distance(wpos, _clipplanes) \
{ \
@@ -14,6 +16,10 @@ uniform vec4 WorldClipPlanes[6];
gl_ClipDistance[5] = dot(_clipplanes[5], pos); \
}
+/* When all shaders are builtin shaders are migrated this could be applied directly. */
+# ifdef USE_GPU_SHADER_CREATE_INFO
+# define WorldClipPlanes clipPlanes.world
+# endif
/* HACK Dirty hack to be able to override the definition in common_view_lib.glsl.
* Not doing this would require changing the include order in every shaders. */
# define world_clip_planes_calc_clip_distance(wpos) \
diff --git a/source/blender/gpu/shaders/gpu_shader_checker_frag.glsl b/source/blender/gpu/shaders/gpu_shader_checker_frag.glsl
index 156b6cb75ab..9065da0275a 100644
--- a/source/blender/gpu/shaders/gpu_shader_checker_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_checker_frag.glsl
@@ -1,9 +1,10 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform vec4 color1;
uniform vec4 color2;
uniform int size;
out vec4 fragColor;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_colorspace_lib.glsl b/source/blender/gpu/shaders/gpu_shader_colorspace_lib.glsl
index aae659516bb..74341701fb0 100644
--- a/source/blender/gpu/shaders/gpu_shader_colorspace_lib.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_colorspace_lib.glsl
@@ -2,7 +2,9 @@
/* Undefine the macro that avoids compilation errors. */
#undef blender_srgb_to_framebuffer_space
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform bool srgbTarget = false;
+#endif
vec4 blender_srgb_to_framebuffer_space(vec4 color)
{
diff --git a/source/blender/gpu/shaders/gpu_shader_common_obinfos_lib.glsl b/source/blender/gpu/shaders/gpu_shader_common_obinfos_lib.glsl
index 9e1527a9e7f..f5b6de4899f 100644
--- a/source/blender/gpu/shaders/gpu_shader_common_obinfos_lib.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_common_obinfos_lib.glsl
@@ -9,11 +9,14 @@ struct ObjectInfos {
vec4 drw_Infos;
};
+# ifndef USE_GPU_SHADER_CREATE_INFO
layout(std140) uniform infoBlock
{
/* DRW_RESOURCE_CHUNK_LEN = 512 */
ObjectInfos drw_infos[512];
};
+# endif
+
# define OrcoTexCoFactors (drw_infos[resource_id].drw_OrcoTexCoFactors)
# define ObjectInfo (drw_infos[resource_id].drw_Infos)
# define ObjectColor (drw_infos[resource_id].drw_ObjectColor)
diff --git a/source/blender/gpu/shaders/gpu_shader_diag_stripes_frag.glsl b/source/blender/gpu/shaders/gpu_shader_diag_stripes_frag.glsl
index 48979af4ad0..a4a24ed8e46 100644
--- a/source/blender/gpu/shaders/gpu_shader_diag_stripes_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_diag_stripes_frag.glsl
@@ -1,10 +1,11 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform vec4 color1;
uniform vec4 color2;
uniform int size1;
uniform int size2;
out vec4 fragColor;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_flat_color_alpha_test_0_frag.glsl b/source/blender/gpu/shaders/gpu_shader_flat_color_alpha_test_0_frag.glsl
index 6f7d68856d5..d3d4b66589b 100644
--- a/source/blender/gpu/shaders/gpu_shader_flat_color_alpha_test_0_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_flat_color_alpha_test_0_frag.glsl
@@ -1,6 +1,7 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
flat in vec4 finalColor;
out vec4 fragColor;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_flat_color_frag.glsl b/source/blender/gpu/shaders/gpu_shader_flat_color_frag.glsl
index 99d8b6ab685..1675de3d567 100644
--- a/source/blender/gpu/shaders/gpu_shader_flat_color_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_flat_color_frag.glsl
@@ -1,6 +1,7 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
flat in vec4 finalColor;
out vec4 fragColor;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_flat_id_frag.glsl b/source/blender/gpu/shaders/gpu_shader_flat_id_frag.glsl
index 8e1287c483a..2aabdb84f16 100644
--- a/source/blender/gpu/shaders/gpu_shader_flat_id_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_flat_id_frag.glsl
@@ -1,6 +1,7 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
flat in uint finalId;
out uint fragId;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_geometry.glsl b/source/blender/gpu/shaders/gpu_shader_geometry.glsl
index 3b4e2e17ccc..4fdc14289e1 100644
--- a/source/blender/gpu/shaders/gpu_shader_geometry.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_geometry.glsl
@@ -1,4 +1,4 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ProjectionMatrix;
uniform int PrimitiveIdBase;
@@ -19,6 +19,7 @@ out vec3 varposition;
uniform bool osd_flat_shading;
uniform int osd_fvar_count;
+#endif
#define INTERP_FACE_VARYING_2(result, fvarOffset, tessCoord) \
{ \
@@ -38,8 +39,10 @@ uniform int osd_fvar_count;
result = vec3(tmp, 0); \
}
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform samplerBuffer FVarDataBuffer;
uniform isamplerBuffer FVarDataOffsetBuffer;
+#endif
out block
{
diff --git a/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_frag.glsl b/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_frag.glsl
index fc3f47c0aaa..37541bb91f3 100644
--- a/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_frag.glsl
@@ -1,16 +1,18 @@
+#ifndef USE_GPU_SHADER_CREATE_INFO
in vec4 mColor;
in vec2 mTexCoord;
out vec4 fragColor;
+#endif
void main()
{
const vec2 center = vec2(0, 0.5);
- vec4 tColor = vec4(mColor);
+ vec4 tColor = vec4(geometry_out.mColor);
/* if alpha < 0, then encap */
- if (mColor.a < 0) {
+ if (geometry_out.mColor.a < 0) {
tColor.a = tColor.a * -1.0;
- float dist = length(mTexCoord - center);
+ float dist = length(geometry_out.mTexCoord - center);
if (dist > 0.25) {
discard;
}
diff --git a/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_geom.glsl b/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_geom.glsl
index b937323f62a..f076655b459 100644
--- a/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_geom.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_geom.glsl
@@ -1,3 +1,4 @@
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
uniform vec2 Viewport;
uniform int xraymode;
@@ -13,6 +14,7 @@ in float finalThickness[4];
out vec4 mColor;
out vec2 mTexCoord;
+#endif
#define GP_XRAY_FRONT 0
#define GP_XRAY_3DSPACE 1
@@ -23,19 +25,19 @@ out vec2 mTexCoord;
/* project 3d point to 2d on screen space */
vec2 toScreenSpace(vec4 vertex)
{
- return vec2(vertex.xy / vertex.w) * Viewport;
+ return vec2(vertex.xy / vertex.w) * gpencil_stroke_data.viewport;
}
/* get zdepth value */
float getZdepth(vec4 point)
{
- if (xraymode == GP_XRAY_FRONT) {
+ if (gpencil_stroke_data.xraymode == GP_XRAY_FRONT) {
return 0.0;
}
- if (xraymode == GP_XRAY_3DSPACE) {
+ if (gpencil_stroke_data.xraymode == GP_XRAY_3DSPACE) {
return (point.z / point.w);
}
- if (xraymode == GP_XRAY_BACK) {
+ if (gpencil_stroke_data.xraymode == GP_XRAY_BACK) {
return 1.0;
}
@@ -75,7 +77,7 @@ void main(void)
vec2 sp3 = toScreenSpace(P3); /* end of next segment */
/* culling outside viewport */
- vec2 area = Viewport * 4.0;
+ vec2 area = gpencil_stroke_data.viewport * 4.0;
if (sp1.x < -area.x || sp1.x > area.x) {
return;
}
@@ -112,8 +114,8 @@ void main(void)
if (bn1 == 0) {
bn1 = 1;
}
- float length_a = finalThickness[1] / an1;
- float length_b = finalThickness[2] / bn1;
+ float length_a = geometry_in[1].finalThickness / an1;
+ float length_b = geometry_in[2].finalThickness / bn1;
if (length_a <= 0.0) {
length_a = 0.01;
}
@@ -124,41 +126,49 @@ void main(void)
/* prevent excessively long miters at sharp corners */
if (dot(v0, v1) < -MiterLimit) {
miter_a = n1;
- length_a = finalThickness[1];
+ length_a = geometry_in[1].finalThickness;
/* close the gap */
if (dot(v0, n1) > 0) {
- mTexCoord = vec2(0, 0);
- mColor = finalColor[1];
- gl_Position = vec4((sp1 + finalThickness[1] * n0) / Viewport, getZdepth(P1), 1.0);
+ geometry_out.mTexCoord = vec2(0, 0);
+ geometry_out.mColor = geometry_in[1].finalColor;
+ gl_Position = vec4((sp1 + geometry_in[1].finalThickness * n0) / gpencil_stroke_data.viewport,
+ getZdepth(P1),
+ 1.0);
EmitVertex();
- mTexCoord = vec2(0, 0);
- mColor = finalColor[1];
- gl_Position = vec4((sp1 + finalThickness[1] * n1) / Viewport, getZdepth(P1), 1.0);
+ geometry_out.mTexCoord = vec2(0, 0);
+ geometry_out.mColor = geometry_in[1].finalColor;
+ gl_Position = vec4((sp1 + geometry_in[1].finalThickness * n1) / gpencil_stroke_data.viewport,
+ getZdepth(P1),
+ 1.0);
EmitVertex();
- mTexCoord = vec2(0, 0.5);
- mColor = finalColor[1];
- gl_Position = vec4(sp1 / Viewport, getZdepth(P1), 1.0);
+ geometry_out.mTexCoord = vec2(0, 0.5);
+ geometry_out.mColor = geometry_in[1].finalColor;
+ gl_Position = vec4(sp1 / gpencil_stroke_data.viewport, getZdepth(P1), 1.0);
EmitVertex();
EndPrimitive();
}
else {
- mTexCoord = vec2(0, 1);
- mColor = finalColor[1];
- gl_Position = vec4((sp1 - finalThickness[1] * n1) / Viewport, getZdepth(P1), 1.0);
+ geometry_out.mTexCoord = vec2(0, 1);
+ geometry_out.mColor = geometry_in[1].finalColor;
+ gl_Position = vec4((sp1 - geometry_in[1].finalThickness * n1) / gpencil_stroke_data.viewport,
+ getZdepth(P1),
+ 1.0);
EmitVertex();
- mTexCoord = vec2(0, 1);
- mColor = finalColor[1];
- gl_Position = vec4((sp1 - finalThickness[1] * n0) / Viewport, getZdepth(P1), 1.0);
+ geometry_out.mTexCoord = vec2(0, 1);
+ geometry_out.mColor = geometry_in[1].finalColor;
+ gl_Position = vec4((sp1 - geometry_in[1].finalThickness * n0) / gpencil_stroke_data.viewport,
+ getZdepth(P1),
+ 1.0);
EmitVertex();
- mTexCoord = vec2(0, 0.5);
- mColor = finalColor[1];
- gl_Position = vec4(sp1 / Viewport, getZdepth(P1), 1.0);
+ geometry_out.mTexCoord = vec2(0, 0.5);
+ geometry_out.mColor = geometry_in[1].finalColor;
+ gl_Position = vec4(sp1 / gpencil_stroke_data.viewport, getZdepth(P1), 1.0);
EmitVertex();
EndPrimitive();
@@ -167,66 +177,74 @@ void main(void)
if (dot(v1, v2) < -MiterLimit) {
miter_b = n1;
- length_b = finalThickness[2];
+ length_b = geometry_in[2].finalThickness;
}
/* Generate the start end-cap (alpha < 0 used as end-cap flag). */
- float extend = (fill_stroke > 0) ? 2 : 1;
- if ((caps_start != GPENCIL_FLATCAP) && is_equal(P0, P2)) {
- mTexCoord = vec2(1, 0.5);
- mColor = vec4(finalColor[1].rgb, finalColor[1].a * -1.0);
+ float extend = gpencil_stroke_data.fill_stroke ? 2 : 1;
+ if ((gpencil_stroke_data.caps_start != GPENCIL_FLATCAP) && is_equal(P0, P2)) {
+ geometry_out.mTexCoord = vec2(1, 0.5);
+ geometry_out.mColor = vec4(geometry_in[1].finalColor.rgb, geometry_in[1].finalColor.a * -1.0);
vec2 svn1 = normalize(sp1 - sp2) * length_a * 4.0 * extend;
- gl_Position = vec4((sp1 + svn1) / Viewport, getZdepth(P1), 1.0);
+ gl_Position = vec4((sp1 + svn1) / gpencil_stroke_data.viewport, getZdepth(P1), 1.0);
EmitVertex();
- mTexCoord = vec2(0, 0);
- mColor = vec4(finalColor[1].rgb, finalColor[1].a * -1.0);
- gl_Position = vec4((sp1 - (length_a * 2.0) * miter_a) / Viewport, getZdepth(P1), 1.0);
+ geometry_out.mTexCoord = vec2(0, 0);
+ geometry_out.mColor = vec4(geometry_in[1].finalColor.rgb, geometry_in[1].finalColor.a * -1.0);
+ gl_Position = vec4(
+ (sp1 - (length_a * 2.0) * miter_a) / gpencil_stroke_data.viewport, getZdepth(P1), 1.0);
EmitVertex();
- mTexCoord = vec2(0, 1);
- mColor = vec4(finalColor[1].rgb, finalColor[1].a * -1.0);
- gl_Position = vec4((sp1 + (length_a * 2.0) * miter_a) / Viewport, getZdepth(P1), 1.0);
+ geometry_out.mTexCoord = vec2(0, 1);
+ geometry_out.mColor = vec4(geometry_in[1].finalColor.rgb, geometry_in[1].finalColor.a * -1.0);
+ gl_Position = vec4(
+ (sp1 + (length_a * 2.0) * miter_a) / gpencil_stroke_data.viewport, getZdepth(P1), 1.0);
EmitVertex();
}
/* generate the triangle strip */
- mTexCoord = vec2(0, 0);
- mColor = finalColor[1];
- gl_Position = vec4((sp1 + length_a * miter_a) / Viewport, getZdepth(P1), 1.0);
+ geometry_out.mTexCoord = vec2(0, 0);
+ geometry_out.mColor = geometry_in[1].finalColor;
+ gl_Position = vec4(
+ (sp1 + length_a * miter_a) / gpencil_stroke_data.viewport, getZdepth(P1), 1.0);
EmitVertex();
- mTexCoord = vec2(0, 1);
- mColor = finalColor[1];
- gl_Position = vec4((sp1 - length_a * miter_a) / Viewport, getZdepth(P1), 1.0);
+ geometry_out.mTexCoord = vec2(0, 1);
+ geometry_out.mColor = geometry_in[1].finalColor;
+ gl_Position = vec4(
+ (sp1 - length_a * miter_a) / gpencil_stroke_data.viewport, getZdepth(P1), 1.0);
EmitVertex();
- mTexCoord = vec2(0, 0);
- mColor = finalColor[2];
- gl_Position = vec4((sp2 + length_b * miter_b) / Viewport, getZdepth(P2), 1.0);
+ geometry_out.mTexCoord = vec2(0, 0);
+ geometry_out.mColor = geometry_in[2].finalColor;
+ gl_Position = vec4(
+ (sp2 + length_b * miter_b) / gpencil_stroke_data.viewport, getZdepth(P2), 1.0);
EmitVertex();
- mTexCoord = vec2(0, 1);
- mColor = finalColor[2];
- gl_Position = vec4((sp2 - length_b * miter_b) / Viewport, getZdepth(P2), 1.0);
+ geometry_out.mTexCoord = vec2(0, 1);
+ geometry_out.mColor = geometry_in[2].finalColor;
+ gl_Position = vec4(
+ (sp2 - length_b * miter_b) / gpencil_stroke_data.viewport, getZdepth(P2), 1.0);
EmitVertex();
/* Generate the end end-cap (alpha < 0 used as end-cap flag). */
- if ((caps_end != GPENCIL_FLATCAP) && is_equal(P1, P3)) {
- mTexCoord = vec2(0, 1);
- mColor = vec4(finalColor[2].rgb, finalColor[2].a * -1.0);
- gl_Position = vec4((sp2 + (length_b * 2.0) * miter_b) / Viewport, getZdepth(P2), 1.0);
+ if ((gpencil_stroke_data.caps_end != GPENCIL_FLATCAP) && is_equal(P1, P3)) {
+ geometry_out.mTexCoord = vec2(0, 1);
+ geometry_out.mColor = vec4(geometry_in[2].finalColor.rgb, geometry_in[2].finalColor.a * -1.0);
+ gl_Position = vec4(
+ (sp2 + (length_b * 2.0) * miter_b) / gpencil_stroke_data.viewport, getZdepth(P2), 1.0);
EmitVertex();
- mTexCoord = vec2(0, 0);
- mColor = vec4(finalColor[2].rgb, finalColor[2].a * -1.0);
- gl_Position = vec4((sp2 - (length_b * 2.0) * miter_b) / Viewport, getZdepth(P2), 1.0);
+ geometry_out.mTexCoord = vec2(0, 0);
+ geometry_out.mColor = vec4(geometry_in[2].finalColor.rgb, geometry_in[2].finalColor.a * -1.0);
+ gl_Position = vec4(
+ (sp2 - (length_b * 2.0) * miter_b) / gpencil_stroke_data.viewport, getZdepth(P2), 1.0);
EmitVertex();
- mTexCoord = vec2(1, 0.5);
- mColor = vec4(finalColor[2].rgb, finalColor[2].a * -1.0);
+ geometry_out.mTexCoord = vec2(1, 0.5);
+ geometry_out.mColor = vec4(geometry_in[2].finalColor.rgb, geometry_in[2].finalColor.a * -1.0);
vec2 svn2 = normalize(sp2 - sp1) * length_b * 4.0 * extend;
- gl_Position = vec4((sp2 + svn2) / Viewport, getZdepth(P2), 1.0);
+ gl_Position = vec4((sp2 + svn2) / gpencil_stroke_data.viewport, getZdepth(P2), 1.0);
EmitVertex();
}
diff --git a/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_vert.glsl b/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_vert.glsl
index 07b4ae52110..16e12b2989e 100644
--- a/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_vert.glsl
@@ -1,3 +1,4 @@
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 ProjectionMatrix;
@@ -12,22 +13,21 @@ in float thickness;
out vec4 finalColor;
out float finalThickness;
+#endif
-#define TRUE 1
-
-float defaultpixsize = pixsize * (1000.0 / pixfactor);
+float defaultpixsize = gpencil_stroke_data.pixsize * (1000.0 / gpencil_stroke_data.pixfactor);
void main(void)
{
gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
- finalColor = color;
+ geometry_in.finalColor = color;
- if (keep_size == TRUE) {
- finalThickness = thickness;
+ if (gpencil_stroke_data.keep_size) {
+ geometry_in.finalThickness = thickness;
}
else {
float size = (ProjectionMatrix[3][3] == 0.0) ? (thickness / (gl_Position.z * defaultpixsize)) :
(thickness / defaultpixsize);
- finalThickness = max(size * objscale, 1.0);
+ geometry_in.finalThickness = max(size * gpencil_stroke_data.objscale, 1.0);
}
}
diff --git a/source/blender/gpu/shaders/gpu_shader_image_color_frag.glsl b/source/blender/gpu/shaders/gpu_shader_image_color_frag.glsl
index 6dc7a1618e1..1846dae346a 100644
--- a/source/blender/gpu/shaders/gpu_shader_image_color_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_image_color_frag.glsl
@@ -1,9 +1,10 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
in vec2 texCoord_interp;
out vec4 fragColor;
uniform vec4 color;
uniform sampler2D image;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_image_desaturate_frag.glsl b/source/blender/gpu/shaders/gpu_shader_image_desaturate_frag.glsl
index dfbaaeda7b5..ad52b9819ab 100644
--- a/source/blender/gpu/shaders/gpu_shader_image_desaturate_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_image_desaturate_frag.glsl
@@ -1,10 +1,11 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform float factor;
in vec2 texCoord_interp;
out vec4 fragColor;
uniform vec4 color;
uniform sampler2D image;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_image_frag.glsl b/source/blender/gpu/shaders/gpu_shader_image_frag.glsl
index aff6ddf01bf..befd6b57bf8 100644
--- a/source/blender/gpu/shaders/gpu_shader_image_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_image_frag.glsl
@@ -1,8 +1,9 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
in vec2 texCoord_interp;
out vec4 fragColor;
uniform sampler2D image;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_image_modulate_alpha_frag.glsl b/source/blender/gpu/shaders/gpu_shader_image_modulate_alpha_frag.glsl
index 613352b4ac8..ceebaae896d 100644
--- a/source/blender/gpu/shaders/gpu_shader_image_modulate_alpha_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_image_modulate_alpha_frag.glsl
@@ -1,9 +1,11 @@
+#ifndef USE_GPU_SHADER_CREATE_INFO
in vec2 texCoord_interp;
out vec4 fragColor;
uniform float alpha;
uniform sampler2D image;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_image_overlays_merge_frag.glsl b/source/blender/gpu/shaders/gpu_shader_image_overlays_merge_frag.glsl
index 7f3fe2f5252..2314dbbc5d5 100644
--- a/source/blender/gpu/shaders/gpu_shader_image_overlays_merge_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_image_overlays_merge_frag.glsl
@@ -1,6 +1,7 @@
/* Merge overlays texture on top of image texture and transform to display space (assume sRGB) */
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform sampler2D image_texture;
uniform sampler2D overlays_texture;
uniform bool display_transform;
@@ -9,6 +10,7 @@ uniform bool overlay;
in vec2 texCoord_interp;
out vec4 fragColor;
+#endif
float linearrgb_to_srgb(float c)
{
diff --git a/source/blender/gpu/shaders/gpu_shader_image_overlays_stereo_merge_frag.glsl b/source/blender/gpu/shaders/gpu_shader_image_overlays_stereo_merge_frag.glsl
index c6e9860d940..9b1e6fe9d23 100644
--- a/source/blender/gpu/shaders/gpu_shader_image_overlays_stereo_merge_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_image_overlays_stereo_merge_frag.glsl
@@ -7,18 +7,20 @@
/* Composite stereo textures */
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform sampler2D imageTexture;
uniform sampler2D overlayTexture;
uniform int stereoDisplaySettings;
+layout(location = 0) out vec4 imageColor;
+layout(location = 1) out vec4 overlayColor;
+#endif
+
#define stereo_display_mode (stereoDisplaySettings & ((1 << 3) - 1))
#define stereo_interlace_mode ((stereoDisplaySettings >> 3) & ((1 << 3) - 1))
#define stereo_interlace_swap bool(stereoDisplaySettings >> 6)
-layout(location = 0) out vec4 imageColor;
-layout(location = 1) out vec4 overlayColor;
-
bool interlace(ivec2 texel)
{
int interlace_mode = stereo_interlace_mode;
diff --git a/source/blender/gpu/shaders/gpu_shader_image_shuffle_color_frag.glsl b/source/blender/gpu/shaders/gpu_shader_image_shuffle_color_frag.glsl
index ed69184ef14..e8bfb70b897 100644
--- a/source/blender/gpu/shaders/gpu_shader_image_shuffle_color_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_image_shuffle_color_frag.glsl
@@ -1,15 +1,16 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
in vec2 texCoord_interp;
out vec4 fragColor;
uniform sampler2D image;
uniform vec4 color;
uniform vec4 shuffle;
+#endif
void main()
{
- vec4 sample = texture(image, texCoord_interp);
- fragColor = vec4(sample.r * shuffle.r + sample.g * shuffle.g + sample.b * shuffle.b +
- sample.a * shuffle.a) *
+ vec4 sampled_color = texture(image, texCoord_interp);
+ fragColor = vec4(sampled_color.r * shuffle.r + sampled_color.g * shuffle.g +
+ sampled_color.b * shuffle.b + sampled_color.a * shuffle.a) *
color;
}
diff --git a/source/blender/gpu/shaders/gpu_shader_image_varying_color_frag.glsl b/source/blender/gpu/shaders/gpu_shader_image_varying_color_frag.glsl
index becf0fbd133..3058f73ab37 100644
--- a/source/blender/gpu/shaders/gpu_shader_image_varying_color_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_image_varying_color_frag.glsl
@@ -1,9 +1,10 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
in vec2 texCoord_interp;
flat in vec4 finalColor;
out vec4 fragColor;
uniform sampler2D image;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl
index 10228a1e985..14450037ca8 100644
--- a/source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl
@@ -1,4 +1,4 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ViewProjectionMatrix;
/* ---- Instantiated Attrs ---- */
@@ -7,13 +7,14 @@ in vec3 pos;
/* ---- Per instance Attrs ---- */
in mat4 InstanceModelMatrix;
in vec4 color;
-#ifdef UNIFORM_SCALE
+# ifdef UNIFORM_SCALE
in float size;
-#else
+# else
in vec3 size;
-#endif
+# endif
flat out vec4 finalColor;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_keyframe_shape_frag.glsl b/source/blender/gpu/shaders/gpu_shader_keyframe_shape_frag.glsl
index a3b61dca8b4..2a2eaab7340 100644
--- a/source/blender/gpu/shaders/gpu_shader_keyframe_shape_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_keyframe_shape_frag.glsl
@@ -11,6 +11,7 @@
#define GPU_KEYFRAME_SHAPE_SQUARE \
(GPU_KEYFRAME_SHAPE_CLIPPED_VERTICAL | GPU_KEYFRAME_SHAPE_CLIPPED_HORIZONTAL)
+#ifndef USE_GPU_SHADER_CREATE_INFO
flat in vec4 radii;
flat in vec4 thresholds;
@@ -20,6 +21,7 @@ flat in vec4 finalOutlineColor;
flat in int finalFlags;
out vec4 fragColor;
+#endif
const float diagonal_scale = sqrt(0.5);
diff --git a/source/blender/gpu/shaders/gpu_shader_keyframe_shape_vert.glsl b/source/blender/gpu/shaders/gpu_shader_keyframe_shape_vert.glsl
index 18e8b76ba23..4ef3ff1a8d0 100644
--- a/source/blender/gpu/shaders/gpu_shader_keyframe_shape_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_keyframe_shape_vert.glsl
@@ -11,15 +11,16 @@
#define GPU_KEYFRAME_SHAPE_SQUARE \
(GPU_KEYFRAME_SHAPE_CLIPPED_VERTICAL | GPU_KEYFRAME_SHAPE_CLIPPED_HORIZONTAL)
-uniform mat4 ModelViewProjectionMatrix;
-uniform vec2 ViewportSize = vec2(-1, -1);
-uniform float outline_scale = 1.0;
-
const float line_falloff = 1.0;
const float circle_scale = sqrt(2.0 / 3.1416);
const float square_scale = sqrt(0.5);
const float diagonal_scale = sqrt(0.5);
+#ifndef USE_GPU_SHADER_CREATE_INFO
+uniform mat4 ModelViewProjectionMatrix;
+uniform vec2 ViewportSize = vec2(-1, -1);
+uniform float outline_scale = 1.0;
+
in vec2 pos;
in float size;
in vec4 color;
@@ -33,6 +34,7 @@ flat out int finalFlags;
flat out vec4 radii;
flat out vec4 thresholds;
+#endif
bool test(int bit)
{
diff --git a/source/blender/gpu/shaders/gpu_shader_point_uniform_color_aa_frag.glsl b/source/blender/gpu/shaders/gpu_shader_point_uniform_color_aa_frag.glsl
index 52d59d2030f..960b5e6efac 100644
--- a/source/blender/gpu/shaders/gpu_shader_point_uniform_color_aa_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_point_uniform_color_aa_frag.glsl
@@ -1,8 +1,9 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform vec4 color;
in vec2 radii;
out vec4 fragColor;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_point_uniform_color_outline_aa_frag.glsl b/source/blender/gpu/shaders/gpu_shader_point_uniform_color_outline_aa_frag.glsl
index 2ece73b3845..cdf3aa8024d 100644
--- a/source/blender/gpu/shaders/gpu_shader_point_uniform_color_outline_aa_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_point_uniform_color_outline_aa_frag.glsl
@@ -1,9 +1,10 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform vec4 color;
uniform vec4 outlineColor;
in vec4 radii;
out vec4 fragColor;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_point_varying_color_frag.glsl b/source/blender/gpu/shaders/gpu_shader_point_varying_color_frag.glsl
index 86c0e5c950a..119189ad29b 100644
--- a/source/blender/gpu/shaders/gpu_shader_point_varying_color_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_point_varying_color_frag.glsl
@@ -1,6 +1,7 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
in vec4 finalColor;
out vec4 fragColor;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_point_varying_color_varying_outline_aa_frag.glsl b/source/blender/gpu/shaders/gpu_shader_point_varying_color_varying_outline_aa_frag.glsl
index c9bd9e881bf..04a7e3d80d0 100644
--- a/source/blender/gpu/shaders/gpu_shader_point_varying_color_varying_outline_aa_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_point_varying_color_varying_outline_aa_frag.glsl
@@ -1,8 +1,9 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
in vec4 radii;
in vec4 fillColor;
in vec4 outlineColor;
out vec4 fragColor;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_simple_lighting_frag.glsl b/source/blender/gpu/shaders/gpu_shader_simple_lighting_frag.glsl
index 6bce517fee3..6725bc82841 100644
--- a/source/blender/gpu/shaders/gpu_shader_simple_lighting_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_simple_lighting_frag.glsl
@@ -1,18 +1,19 @@
-
-#ifndef USE_INSTANCE_COLOR
+#ifndef USE_GPU_SHADER_CREATE_INFO
+# ifndef USE_INSTANCE_COLOR
uniform vec4 color;
-#endif
+# endif
uniform vec3 light;
in vec3 normal;
-#ifdef USE_INSTANCE_COLOR
+# ifdef USE_INSTANCE_COLOR
flat in vec4 finalColor;
-# define color finalColor
-#endif
+# define color finalColor
+# endif
out vec4 fragColor;
+#endif
void main()
{
- fragColor = color;
- fragColor.xyz *= clamp(dot(normalize(normal), light), 0.0, 1.0);
+ fragColor = simple_lighting_data.color;
+ fragColor.xyz *= clamp(dot(normalize(normal), simple_lighting_data.light), 0.0, 1.0);
}
diff --git a/source/blender/gpu/shaders/gpu_shader_text_frag.glsl b/source/blender/gpu/shaders/gpu_shader_text_frag.glsl
index 2568cd74445..1456bd0c732 100644
--- a/source/blender/gpu/shaders/gpu_shader_text_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_text_frag.glsl
@@ -1,4 +1,4 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
flat in vec4 color_flat;
noperspective in vec2 texCoord_interp;
flat in int glyph_offset;
@@ -8,6 +8,7 @@ flat in int interp_size;
out vec4 fragColor;
uniform sampler2D glyph;
+#endif
const vec2 offsets4[4] = vec2[4](
vec2(-0.5, 0.5), vec2(0.5, 0.5), vec2(-0.5, -0.5), vec2(-0.5, -0.5));
diff --git a/source/blender/gpu/shaders/gpu_shader_text_vert.glsl b/source/blender/gpu/shaders/gpu_shader_text_vert.glsl
index 768638e5229..5b01fea5266 100644
--- a/source/blender/gpu/shaders/gpu_shader_text_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_text_vert.glsl
@@ -1,4 +1,4 @@
-
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
in vec4 pos; /* rect */
@@ -11,6 +11,7 @@ noperspective out vec2 texCoord_interp;
flat out int glyph_offset;
flat out ivec2 glyph_dim;
flat out int interp_size;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl b/source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl
index 08623fa9935..b4a75cc489b 100644
--- a/source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl
@@ -1,7 +1,8 @@
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform vec4 color;
-
out vec4 fragColor;
+#endif
void main()
{
diff --git a/source/blender/gpu/shaders/infos/gpu_clip_planes_info.hh b/source/blender/gpu/shaders/infos/gpu_clip_planes_info.hh
new file mode 100644
index 00000000000..81b3c523628
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_clip_planes_info.hh
@@ -0,0 +1,29 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_clip_planes)
+ .uniform_buf(1, "GPUClipPlanes", "clipPlanes", Frequency::PASS)
+ .typedef_source("GPU_shader_shared.h")
+ .define("USE_WORLD_CLIP_PLANES");
diff --git a/source/blender/gpu/shaders/infos/gpu_interface_info.hh b/source/blender/gpu/shaders/infos/gpu_interface_info.hh
new file mode 100644
index 00000000000..b53b60fa587
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_interface_info.hh
@@ -0,0 +1,33 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+#pragma once
+
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_INTERFACE_INFO(flat_color_iface, "").flat(Type::VEC4, "finalColor");
+GPU_SHADER_INTERFACE_INFO(no_perspective_color_iface, "").no_perspective(Type::VEC4, "finalColor");
+GPU_SHADER_INTERFACE_INFO(smooth_color_iface, "").smooth(Type::VEC4, "finalColor");
+GPU_SHADER_INTERFACE_INFO(smooth_tex_coord_interp_iface, "").smooth(Type::VEC2, "texCoord_interp");
+GPU_SHADER_INTERFACE_INFO(smooth_radii_iface, "").smooth(Type::VEC2, "radii");
+GPU_SHADER_INTERFACE_INFO(smooth_radii_outline_iface, "").smooth(Type::VEC4, "radii");
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_area_borders_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_area_borders_info.hh
new file mode 100644
index 00000000000..56c30e79e6d
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_area_borders_info.hh
@@ -0,0 +1,39 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_INTERFACE_INFO(smooth_uv_iface, "").smooth(Type::VEC2, "uv");
+
+GPU_SHADER_CREATE_INFO(gpu_shader_2D_area_borders)
+ .vertex_in(0, Type::VEC2, "pos")
+ .vertex_out(smooth_uv_iface)
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .push_constant(16, Type::VEC4, "rect")
+ .push_constant(20, Type::VEC4, "color")
+ .push_constant(24, Type::FLOAT, "scale")
+ .push_constant(25, Type::INT, "cornerLen")
+ .vertex_source("gpu_shader_2D_area_borders_vert.glsl")
+ .fragment_source("gpu_shader_2D_area_borders_frag.glsl")
+ .do_static_compilation(true); \ No newline at end of file
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_checker_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_checker_info.hh
new file mode 100644
index 00000000000..a69420bede4
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_checker_info.hh
@@ -0,0 +1,36 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_shader_2D_checker)
+ .vertex_in(0, Type::VEC2, "pos")
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .push_constant(16, Type::VEC4, "color1")
+ .push_constant(20, Type::VEC4, "color2")
+ .push_constant(24, Type::INT, "size")
+ .vertex_source("gpu_shader_2D_vert.glsl")
+ .fragment_source("gpu_shader_checker_frag.glsl")
+ .do_static_compilation(true);
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_diag_stripes_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_diag_stripes_info.hh
new file mode 100644
index 00000000000..fa715cdcb1d
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_diag_stripes_info.hh
@@ -0,0 +1,37 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_shader_2D_diag_stripes)
+ .vertex_in(0, Type::VEC2, "pos")
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .push_constant(16, Type::VEC4, "color1")
+ .push_constant(20, Type::VEC4, "color2")
+ .push_constant(24, Type::INT, "size1")
+ .push_constant(28, Type::INT, "size2")
+ .vertex_source("gpu_shader_2D_vert.glsl")
+ .fragment_source("gpu_shader_diag_stripes_frag.glsl")
+ .do_static_compilation(true);
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_flat_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_flat_color_info.hh
new file mode 100644
index 00000000000..93d46f8acd8
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_flat_color_info.hh
@@ -0,0 +1,38 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+
+#include "gpu_shader_create_info.hh"
+
+#include "gpu_interface_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_shader_2D_flat_color)
+ .vertex_in(0, Type::VEC2, "pos")
+ .vertex_in(1, Type::VEC4, "color")
+ .vertex_out(flat_color_iface)
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .vertex_source("gpu_shader_2D_flat_color_vert.glsl")
+ .fragment_source("gpu_shader_flat_color_frag.glsl")
+ .additional_info("gpu_srgb_to_framebuffer_space")
+ .do_static_compilation(true);
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_color_info.hh
new file mode 100644
index 00000000000..a6cc9076d4a
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_color_info.hh
@@ -0,0 +1,30 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_shader_2D_image_color)
+ .additional_info("gpu_shader_2D_image_common")
+ .push_constant(16, Type::VEC4, "color")
+ .fragment_source("gpu_shader_image_color_frag.glsl")
+ .do_static_compilation(true);
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_desaturate_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_desaturate_color_info.hh
new file mode 100644
index 00000000000..e11d6746446
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_desaturate_color_info.hh
@@ -0,0 +1,31 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_shader_2D_image_desaturate_color)
+ .additional_info("gpu_shader_2D_image_common")
+ .push_constant(16, Type::VEC4, "color")
+ .push_constant(20, Type::FLOAT, "factor")
+ .fragment_source("gpu_shader_image_desaturate_frag.glsl")
+ .do_static_compilation(true);
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_info.hh
new file mode 100644
index 00000000000..3d20b63c265
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_info.hh
@@ -0,0 +1,39 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+#include "gpu_interface_info.hh"
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_shader_2D_image_common)
+ .vertex_in(0, Type::VEC2, "pos")
+ .vertex_in(1, Type::VEC2, "texCoord")
+ .vertex_out(smooth_tex_coord_interp_iface)
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .sampler(0, ImageType::FLOAT_2D, "image")
+ .vertex_source("gpu_shader_2D_image_vert.glsl");
+
+GPU_SHADER_CREATE_INFO(gpu_shader_2D_image)
+ .additional_info("gpu_shader_2D_image_common")
+ .fragment_source("gpu_shader_image_frag.glsl")
+ .do_static_compilation(true);
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_overlays_merge_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_overlays_merge_info.hh
new file mode 100644
index 00000000000..c2c0e9fec78
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_overlays_merge_info.hh
@@ -0,0 +1,39 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+#include "gpu_interface_info.hh"
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_shader_2D_image_overlays_merge)
+ .vertex_in(0, Type::VEC2, "pos")
+ .vertex_in(1, Type::VEC2, "texCoord")
+ .vertex_out(smooth_tex_coord_interp_iface)
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .push_constant(16, Type::BOOL, "display_transform")
+ .push_constant(17, Type::BOOL, "overlay")
+ .sampler(0, ImageType::FLOAT_2D, "image_texture")
+ .sampler(1, ImageType::FLOAT_2D, "overlays_texture")
+ .vertex_source("gpu_shader_2D_image_vert.glsl")
+ .fragment_source("gpu_shader_image_overlays_merge_frag.glsl")
+ .do_static_compilation(true);
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_overlays_stereo_merge_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_overlays_stereo_merge_info.hh
new file mode 100644
index 00000000000..c1e6c3957d3
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_overlays_stereo_merge_info.hh
@@ -0,0 +1,36 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_shader_2D_image_overlays_stereo_merge)
+ .vertex_in(0, Type::VEC2, "pos")
+ .fragment_out(0, Type::VEC4, "imageColor")
+ .fragment_out(1, Type::VEC4, "overlayColor")
+ .sampler(0, ImageType::FLOAT_2D, "imageTexture")
+ .sampler(1, ImageType::FLOAT_2D, "overlayTexture")
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .push_constant(16, Type::INT, "stereoDisplaySettings")
+ .vertex_source("gpu_shader_2D_vert.glsl")
+ .fragment_source("gpu_shader_image_overlays_stereo_merge_frag.glsl")
+ .do_static_compilation(true);
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_rect_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_rect_color_info.hh
new file mode 100644
index 00000000000..b9b4381eb50
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_rect_color_info.hh
@@ -0,0 +1,40 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+#include "gpu_interface_info.hh"
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_shader_2D_image_rect_color)
+ .vertex_in(0, Type::VEC2, "pos")
+ .vertex_in(1, Type::VEC2, "texCoord")
+ .vertex_out(smooth_tex_coord_interp_iface)
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .push_constant(16, Type::VEC4, "color")
+ .push_constant(20, Type::VEC4, "rect_icon")
+ .push_constant(24, Type::VEC4, "rect_geom")
+ .sampler(0, ImageType::FLOAT_2D, "image")
+ .vertex_source("gpu_shader_2D_image_rect_vert.glsl")
+ .fragment_source("gpu_shader_image_color_frag.glsl")
+ .do_static_compilation(true);
+
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_shuffle_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_shuffle_color_info.hh
new file mode 100644
index 00000000000..3663de0a98f
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_shuffle_color_info.hh
@@ -0,0 +1,31 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_shader_2D_image_shuffle_color)
+ .additional_info("gpu_shader_2D_image_common")
+ .push_constant(16, Type::VEC4, "color")
+ .push_constant(20, Type::VEC4, "shuffle")
+ .fragment_source("gpu_shader_image_shuffle_color_frag.glsl")
+ .do_static_compilation(true);
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_line_dashed_uniform_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_line_dashed_uniform_color_info.hh
new file mode 100644
index 00000000000..419cd4bc47c
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_line_dashed_uniform_color_info.hh
@@ -0,0 +1,35 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+
+#include "gpu_interface_info.hh"
+#include "gpu_shader_create_info.hh"
+
+/* TODO(jbakker): Skipped as data doesn't fit as push constant. */
+GPU_SHADER_CREATE_INFO(gpu_shader_2D_line_dashed_uniform_color)
+ .vertex_in(0, Type::VEC3, "pos")
+ .vertex_out(flat_color_iface)
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .vertex_source("gpu_shader_2D_line_dashed_uniform_color_vert.glsl")
+ .fragment_source("gpu_shader_2D_line_dashed_frag.glsl")
+ .do_static_compilation(true);
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_nodelink_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_nodelink_info.hh
new file mode 100644
index 00000000000..b15d7ba3ada
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_nodelink_info.hh
@@ -0,0 +1,72 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_INTERFACE_INFO(nodelink_iface, "")
+ .smooth(Type::VEC4, "finalColor")
+ .smooth(Type::FLOAT, "colorGradient")
+ .smooth(Type::FLOAT, "lineU")
+ .flat(Type::FLOAT, "lineLength")
+ .flat(Type::FLOAT, "dashFactor")
+ .flat(Type::FLOAT, "dashAlpha")
+ .flat(Type::INT, "isMainLine");
+
+GPU_SHADER_CREATE_INFO(gpu_shader_2D_nodelink)
+ .vertex_in(0, Type::VEC2, "uv")
+ .vertex_in(1, Type::VEC2, "pos")
+ .vertex_in(2, Type::VEC2, "expand")
+ .vertex_out(nodelink_iface)
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .uniform_buf(0, "NodeLinkData", "node_link_data", Frequency::PASS)
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .vertex_source("gpu_shader_2D_nodelink_vert.glsl")
+ .fragment_source("gpu_shader_2D_nodelink_frag.glsl")
+ .typedef_source("GPU_shader_shared.h")
+ .do_static_compilation(true);
+
+GPU_SHADER_CREATE_INFO(gpu_shader_2D_nodelink_inst)
+ .vertex_in(0, Type::VEC2, "uv")
+ .vertex_in(1, Type::VEC2, "pos")
+ .vertex_in(2, Type::VEC2, "expand")
+ .vertex_in(3, Type::VEC2, "P0")
+ .vertex_in(4, Type::VEC2, "P1")
+ .vertex_in(5, Type::VEC2, "P2")
+ .vertex_in(6, Type::VEC2, "P3")
+ .vertex_in(7, Type::IVEC4, "colid_doarrow")
+ .vertex_in(8, Type::VEC4, "start_color")
+ .vertex_in(9, Type::VEC4, "end_color")
+ .vertex_in(10, Type::IVEC2, "domuted")
+ .vertex_in(11, Type::FLOAT, "dim_factor")
+ .vertex_in(12, Type::FLOAT, "thickness")
+ .vertex_in(13, Type::FLOAT, "dash_factor")
+ .vertex_in(14, Type::FLOAT, "dash_alpha")
+ .vertex_out(nodelink_iface)
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .uniform_buf(0, "NodeLinkInstanceData", "node_link_data", Frequency::PASS)
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .vertex_source("gpu_shader_2D_nodelink_vert.glsl")
+ .fragment_source("gpu_shader_2D_nodelink_frag.glsl")
+ .typedef_source("GPU_shader_shared.h")
+ .define("USE_INSTANCE")
+ .do_static_compilation(true);
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_point_uniform_size_uniform_color_aa_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_point_uniform_size_uniform_color_aa_info.hh
new file mode 100644
index 00000000000..d2753af8e9b
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_point_uniform_size_uniform_color_aa_info.hh
@@ -0,0 +1,36 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+#include "gpu_interface_info.hh"
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_shader_2D_point_uniform_size_uniform_color_aa)
+ .vertex_in(0, Type::VEC2, "pos")
+ .vertex_out(smooth_radii_iface)
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .push_constant(16, Type::VEC4, "color")
+ .push_constant(20, Type::FLOAT, "size")
+ .vertex_source("gpu_shader_2D_point_uniform_size_aa_vert.glsl")
+ .fragment_source("gpu_shader_point_uniform_color_aa_frag.glsl")
+ .do_static_compilation(true);
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_point_uniform_size_uniform_color_outline_aa_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_point_uniform_size_uniform_color_outline_aa_info.hh
new file mode 100644
index 00000000000..edc83534573
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_point_uniform_size_uniform_color_outline_aa_info.hh
@@ -0,0 +1,38 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+#include "gpu_interface_info.hh"
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_shader_2D_point_uniform_size_uniform_color_outline_aa)
+ .vertex_in(0, Type::VEC2, "pos")
+ .vertex_out(smooth_radii_outline_iface)
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .push_constant(20, Type::VEC4, "color")
+ .push_constant(24, Type::VEC4, "outlineColor")
+ .push_constant(28, Type::FLOAT, "size")
+ .push_constant(29, Type::FLOAT, "outlineWidth")
+ .vertex_source("gpu_shader_2D_point_uniform_size_outline_aa_vert.glsl")
+ .fragment_source("gpu_shader_point_uniform_color_outline_aa_frag.glsl")
+ .do_static_compilation(true);
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_point_varying_size_varying_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_point_varying_size_varying_color_info.hh
new file mode 100644
index 00000000000..4358e94f91f
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_point_varying_size_varying_color_info.hh
@@ -0,0 +1,36 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+#include "gpu_interface_info.hh"
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_shader_2D_point_varying_size_varying_color)
+ .vertex_in(0, Type::VEC2, "pos")
+ .vertex_in(1, Type::FLOAT, "size")
+ .vertex_in(2, Type::VEC4, "color")
+ .vertex_out(smooth_color_iface)
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .vertex_source("gpu_shader_2D_point_varying_size_varying_color_vert.glsl")
+ .fragment_source("gpu_shader_point_varying_color_frag.glsl")
+ .do_static_compilation(true);
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_smooth_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_smooth_color_info.hh
new file mode 100644
index 00000000000..60612a51135
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_smooth_color_info.hh
@@ -0,0 +1,37 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+
+#include "gpu_interface_info.hh"
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_shader_2D_smooth_color)
+ .vertex_in(0, Type::VEC2, "pos")
+ .vertex_in(1, Type::VEC4, "color")
+ .vertex_out(smooth_color_iface)
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .vertex_source("gpu_shader_2D_smooth_color_vert.glsl")
+ .fragment_source("gpu_shader_2D_smooth_color_frag.glsl")
+ .additional_info("gpu_srgb_to_framebuffer_space")
+ .do_static_compilation(true);
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_uniform_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_uniform_color_info.hh
new file mode 100644
index 00000000000..8977a34986e
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_uniform_color_info.hh
@@ -0,0 +1,35 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_shader_2D_uniform_color)
+ .vertex_in(0, Type::VEC2, "pos")
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .push_constant(16, Type::VEC4, "color")
+ .vertex_source("gpu_shader_2D_vert.glsl")
+ .fragment_source("gpu_shader_uniform_color_frag.glsl")
+ .additional_info("gpu_srgb_to_framebuffer_space")
+ .do_static_compilation(true);
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_3D_depth_only_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_3D_depth_only_info.hh
new file mode 100644
index 00000000000..7ea067010cd
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_3D_depth_only_info.hh
@@ -0,0 +1,38 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+
+#include "gpu_interface_info.hh"
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_shader_3D_depth_only)
+ .vertex_in(0, Type::VEC3, "pos")
+ .vertex_out(flat_color_iface)
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .vertex_source("gpu_shader_3D_vert.glsl")
+ .fragment_source("gpu_shader_depth_only_frag.glsl")
+ .do_static_compilation(true);
+
+GPU_SHADER_CREATE_INFO(gpu_shader_3D_depth_only_clipped)
+ .additional_info("gpu_shader_3D_depth_only")
+ .additional_info("gpu_clip_planes");
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_3D_flat_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_3D_flat_color_info.hh
new file mode 100644
index 00000000000..5857e4cab03
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_3D_flat_color_info.hh
@@ -0,0 +1,42 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+
+#include "gpu_interface_info.hh"
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_shader_3D_flat_color)
+ .vertex_in(0, Type::VEC3, "pos")
+ .vertex_in(1, Type::VEC4, "color")
+ .vertex_out(flat_color_iface)
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .push_constant(1, Type::BOOL, "srgbTarget")
+ .vertex_source("gpu_shader_3D_flat_color_vert.glsl")
+ .fragment_source("gpu_shader_flat_color_frag.glsl")
+ .additional_info("gpu_srgb_to_framebuffer_space")
+ .do_static_compilation(true);
+
+GPU_SHADER_CREATE_INFO(gpu_shader_3D_flat_color_clipped)
+ .additional_info("gpu_shader_3D_flat_color")
+ .additional_info("gpu_clip_planes");
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_3D_image_modulate_alpha_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_3D_image_modulate_alpha_info.hh
new file mode 100644
index 00000000000..a838f6581dc
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_3D_image_modulate_alpha_info.hh
@@ -0,0 +1,38 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+
+#include "gpu_interface_info.hh"
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_shader_3D_image_modulate_alpha)
+ .vertex_in(0, Type::VEC3, "pos")
+ .vertex_in(1, Type::VEC2, "texCoord")
+ .vertex_out(smooth_tex_coord_interp_iface)
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .push_constant(16, Type::FLOAT, "alpha")
+ .sampler(0, ImageType::FLOAT_2D, "image", Frequency::PASS)
+ .vertex_source("gpu_shader_3D_image_vert.glsl")
+ .fragment_source("gpu_shader_image_modulate_alpha_frag.glsl")
+ .do_static_compilation(true);
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_3D_line_dashed_uniform_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_3D_line_dashed_uniform_color_info.hh
new file mode 100644
index 00000000000..93cbf1ab06f
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_3D_line_dashed_uniform_color_info.hh
@@ -0,0 +1,35 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+
+#include "gpu_interface_info.hh"
+#include "gpu_shader_create_info.hh"
+
+/* TODO(jbakker): Skipped as data doesn't fit as push constant. */
+GPU_SHADER_CREATE_INFO(gpu_shader_3D_line_dashed_uniform_color)
+ .vertex_in(0, Type::VEC3, "pos")
+ .vertex_out(flat_color_iface)
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .vertex_source("gpu_shader_3D_line_dashed_uniform_color_vert.glsl")
+ .fragment_source("gpu_shader_2D_line_dashed_frag.glsl")
+ .do_static_compilation(true);
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_3D_point_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_3D_point_info.hh
new file mode 100644
index 00000000000..b62c8fe7518
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_3D_point_info.hh
@@ -0,0 +1,62 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_shader_3D_point_fixed_size_varying_color)
+ .vertex_in(0, Type::VEC3, "pos")
+ .vertex_in(1, Type::VEC4, "color")
+ .vertex_out(smooth_color_iface)
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .push_constant(16, Type::FLOAT, "size")
+ .vertex_source("gpu_shader_3D_point_fixed_size_varying_color_vert.glsl")
+ .fragment_source("gpu_shader_point_varying_color_frag.glsl")
+ .do_static_compilation(true);
+
+GPU_SHADER_CREATE_INFO(gpu_shader_3D_point_varying_size_varying_color)
+ .vertex_in(0, Type::VEC3, "pos")
+ .vertex_in(1, Type::VEC4, "color")
+ .vertex_in(2, Type::FLOAT, "size")
+ .vertex_out(smooth_color_iface)
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .vertex_source("gpu_shader_3D_point_varying_size_varying_color_vert.glsl")
+ .fragment_source("gpu_shader_point_varying_color_frag.glsl")
+ .do_static_compilation(true);
+
+GPU_SHADER_CREATE_INFO(gpu_shader_3D_point_uniform_size_uniform_color_aa)
+ .vertex_in(0, Type::VEC3, "pos")
+ .vertex_out(smooth_radii_iface)
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .push_constant(16, Type::VEC4, "color")
+ .push_constant(20, Type::FLOAT, "size")
+ .push_constant(24, Type::FLOAT, "outlineWidth")
+ .vertex_source("gpu_shader_3D_point_uniform_size_aa_vert.glsl")
+ .fragment_source("gpu_shader_point_uniform_color_aa_frag.glsl")
+ .do_static_compilation(true);
+
+GPU_SHADER_CREATE_INFO(gpu_shader_3D_point_uniform_size_uniform_color_aa_clipped)
+ .additional_info("gpu_shader_3D_point_uniform_size_uniform_color_aa")
+ .additional_info("gpu_clip_planes");
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_3D_polyline_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_3D_polyline_info.hh
new file mode 100644
index 00000000000..1e195e7ff23
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_3D_polyline_info.hh
@@ -0,0 +1,33 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+
+#include "gpu_interface_info.hh"
+#include "gpu_shader_create_info.hh"
+
+/* TODO(jbakker): Skipped as it needs a uniform/storage buffer. */
+GPU_SHADER_CREATE_INFO(gpu_shader_3D_polyline_uniform_color)
+ .vertex_source("gpu_shader_3D_polyline_vert.glsl")
+ .geometry_source("gpu_shader_3D_polyline_geom.glsl")
+ .fragment_source("gpu_shader_3D_polyline_frag.glsl")
+ .do_static_compilation(true);
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_3D_smooth_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_3D_smooth_color_info.hh
new file mode 100644
index 00000000000..91797b9b414
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_3D_smooth_color_info.hh
@@ -0,0 +1,41 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+
+#include "gpu_interface_info.hh"
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_shader_3D_smooth_color)
+ .vertex_in(0, Type::VEC3, "pos")
+ .vertex_in(1, Type::VEC4, "color")
+ .vertex_out(smooth_color_iface)
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .vertex_source("gpu_shader_3D_smooth_color_vert.glsl")
+ .fragment_source("gpu_shader_3D_smooth_color_frag.glsl")
+ .additional_info("gpu_srgb_to_framebuffer_space")
+ .do_static_compilation(true);
+
+GPU_SHADER_CREATE_INFO(gpu_shader_3D_smooth_color_clipped)
+ .additional_info("gpu_shader_3D_smooth_color")
+ .additional_info("gpu_clip_planes");
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_3D_uniform_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_3D_uniform_color_info.hh
new file mode 100644
index 00000000000..6162d68cf2e
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_3D_uniform_color_info.hh
@@ -0,0 +1,39 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_shader_3D_uniform_color)
+ .vertex_in(0, Type::VEC3, "pos")
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .push_constant(16, Type::VEC4, "color")
+ .vertex_source("gpu_shader_3D_vert.glsl")
+ .fragment_source("gpu_shader_uniform_color_frag.glsl")
+ .additional_info("gpu_srgb_to_framebuffer_space")
+ .do_static_compilation(true);
+
+GPU_SHADER_CREATE_INFO(gpu_shader_3D_uniform_color_clipped)
+ .additional_info("gpu_shader_3D_uniform_color")
+ .additional_info("gpu_clip_planes");
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_gpencil_stroke_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_gpencil_stroke_info.hh
new file mode 100644
index 00000000000..5fb6c61c5f9
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_gpencil_stroke_info.hh
@@ -0,0 +1,51 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_INTERFACE_INFO(gpencil_stroke_vert_iface, "geometry_in")
+ .smooth(Type::VEC4, "finalColor")
+ .smooth(Type::FLOAT, "finalThickness");
+GPU_SHADER_INTERFACE_INFO(gpencil_stroke_geom_iface, "geometry_out")
+ .smooth(Type::VEC4, "mColor")
+ .smooth(Type::VEC2, "mTexCoord");
+
+GPU_SHADER_CREATE_INFO(gpu_shader_gpencil_stroke)
+ .vertex_in(0, Type::VEC4, "color")
+ .vertex_in(1, Type::VEC3, "pos")
+ .vertex_in(2, Type::FLOAT, "thickness")
+ .vertex_out(gpencil_stroke_vert_iface)
+ .geometry_layout(InputLayout::LINES_ADJACENCY, OutputLayout::TRIANGLE_STRIP, 13)
+ .geometry_out(gpencil_stroke_geom_iface)
+ .fragment_out(0, Type::VEC4, "fragColor")
+
+ .uniform_buf(0, "GPencilStrokeData", "gpencil_stroke_data")
+
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .push_constant(16, Type::MAT4, "ProjectionMatrix")
+ .vertex_source("gpu_shader_gpencil_stroke_vert.glsl")
+ .geometry_source("gpu_shader_gpencil_stroke_geom.glsl")
+ .fragment_source("gpu_shader_gpencil_stroke_frag.glsl")
+ .typedef_source("GPU_shader_shared.h")
+ .do_static_compilation(true);
+ \ No newline at end of file
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_instance_varying_color_varying_size_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_instance_varying_color_varying_size_info.hh
new file mode 100644
index 00000000000..0d2daf7388d
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_instance_varying_color_varying_size_info.hh
@@ -0,0 +1,39 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+#include "gpu_interface_info.hh"
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_shader_instance_varying_color_varying_size)
+ .vertex_in(0, Type::VEC3, "pos")
+ .vertex_in(1, Type::MAT4, "InstanceModelMatrix")
+ .vertex_in(2, Type::VEC4, "color")
+ .vertex_in(3, Type::FLOAT, "size")
+ .vertex_out(flat_color_iface)
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .push_constant(0, Type::MAT4, "ViewProjectionMatrix")
+ .vertex_source("gpu_shader_instance_variying_size_variying_color_vert.glsl")
+ .fragment_source("gpu_shader_flat_color_frag.glsl")
+ .additional_info("gpu_srgb_to_framebuffer_space")
+ .do_static_compilation(true);
+ \ No newline at end of file
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_keyframe_shape_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_keyframe_shape_info.hh
new file mode 100644
index 00000000000..8e352af6c1f
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_keyframe_shape_info.hh
@@ -0,0 +1,47 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_INTERFACE_INFO(keyframe_shape_iface, "")
+ .flat(Type::VEC4, "finalColor")
+ .flat(Type::VEC4, "finalOutlineColor")
+ .flat(Type::VEC4, "radii")
+ .flat(Type::VEC4, "thresholds")
+ .flat(Type::INT, "finalFlags");
+
+GPU_SHADER_CREATE_INFO(gpu_shader_keyframe_shape)
+ .vertex_in(0, Type::VEC4, "color")
+ .vertex_in(1, Type::VEC4, "outlineColor")
+ .vertex_in(2, Type::VEC2, "pos")
+ .vertex_in(3, Type::FLOAT, "size")
+ .vertex_in(4, Type ::INT, "flags")
+ .vertex_out(keyframe_shape_iface)
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .push_constant(16, Type::VEC2, "ViewportSize")
+ .push_constant(24, Type::FLOAT, "outline_scale")
+ .vertex_source("gpu_shader_keyframe_shape_vert.glsl")
+ .fragment_source("gpu_shader_keyframe_shape_frag.glsl")
+ .do_static_compilation(true);
+ \ No newline at end of file
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_simple_lighting_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_simple_lighting_info.hh
new file mode 100644
index 00000000000..c3f86ed2b6f
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_simple_lighting_info.hh
@@ -0,0 +1,40 @@
+
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_INTERFACE_INFO(smooth_normal_iface, "").smooth(Type::VEC3, "normal");
+
+GPU_SHADER_CREATE_INFO(gpu_shader_simple_lighting)
+ .vertex_in(0, Type::VEC3, "pos")
+ .vertex_in(1, Type::VEC3, "nor")
+ .vertex_out(smooth_normal_iface)
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .uniform_buf(0, "SimpleLightingData", "simple_lighting_data", Frequency::PASS)
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .push_constant(16, Type::MAT3, "NormalMatrix")
+ .typedef_source("GPU_shader_shared.h")
+ .vertex_source("gpu_shader_3D_normal_vert.glsl")
+ .fragment_source("gpu_shader_simple_lighting_frag.glsl")
+ .do_static_compilation(true);
diff --git a/source/blender/gpu/shaders/infos/gpu_shader_text_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_text_info.hh
new file mode 100644
index 00000000000..a115972694e
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_shader_text_info.hh
@@ -0,0 +1,46 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_INTERFACE_INFO(text_iface, "")
+ .flat(Type::VEC4, "color_flat")
+ .no_perspective(Type::VEC2, "texCoord_interp")
+ .flat(Type::INT, "glyph_offset")
+ .flat(Type::IVEC2, "glyph_dim")
+ .flat(Type::INT, "interp_size");
+
+GPU_SHADER_CREATE_INFO(gpu_shader_text)
+ .vertex_in(0, Type::VEC4, "pos")
+ .vertex_in(1, Type::VEC4, "col")
+ .vertex_in(2, Type ::IVEC2, "glyph_size")
+ .vertex_in(3, Type ::INT, "offset")
+ .vertex_out(text_iface)
+ .fragment_out(0, Type::VEC4, "fragColor")
+ .push_constant(0, Type::MAT4, "ModelViewProjectionMatrix")
+ .sampler(0, ImageType::FLOAT_2D, "glyph", Frequency::PASS)
+ .vertex_source("gpu_shader_text_vert.glsl")
+ .fragment_source("gpu_shader_text_frag.glsl")
+ .additional_info("gpu_srgb_to_framebuffer_space")
+ .do_static_compilation(true);
+ \ No newline at end of file
diff --git a/source/blender/gpu/shaders/infos/gpu_srgb_to_framebuffer_space_info.hh b/source/blender/gpu/shaders/infos/gpu_srgb_to_framebuffer_space_info.hh
new file mode 100644
index 00000000000..3af49b56ab1
--- /dev/null
+++ b/source/blender/gpu/shaders/infos/gpu_srgb_to_framebuffer_space_info.hh
@@ -0,0 +1,27 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2022 Blender Foundation.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup gpu
+ */
+
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(gpu_srgb_to_framebuffer_space)
+ .define("blender_srgb_to_framebuffer_space(a) a");