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:
authorClément Foucault <foucault.clem@gmail.com>2022-05-02 01:35:49 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-05-02 01:35:49 +0300
commit0676963809a4800f1f666cd559c30885d79f66b8 (patch)
treed7971e9bee7a62e8088f97cfcd475393e457f581 /source/blender/editors/mask
parent2a7a01b339ad60aec5ffe265411fa2f0b1589137 (diff)
GPUShader: Port dashed line shaders to use shaderCreateInfo
This should have no functional changes. This reduce the complexity of the shader by only supporting 2 colors. We never use more than 2 color in practice and this makes usage not require a UBO.
Diffstat (limited to 'source/blender/editors/mask')
-rw-r--r--source/blender/editors/mask/mask_draw.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c
index 60232dee109..aab4007854f 100644
--- a/source/blender/editors/mask/mask_draw.c
+++ b/source/blender/editors/mask/mask_draw.c
@@ -464,12 +464,12 @@ static void mask_draw_curve_type(const bContext *C,
break;
case MASK_DT_DASH: {
- float colors[8];
+ float colors[2][4];
mask_color_active_tint(rgb_tmp, rgb_spline, is_active);
- rgba_uchar_to_float(colors, rgb_tmp);
+ rgba_uchar_to_float(colors[0], rgb_tmp);
mask_color_active_tint(rgb_tmp, rgb_black, is_active);
- rgba_uchar_to_float(colors + 4, rgb_tmp);
+ rgba_uchar_to_float(colors[1], rgb_tmp);
immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR);
@@ -478,7 +478,8 @@ static void mask_draw_curve_type(const bContext *C,
immUniform2f("viewport_size", viewport_size[2] / UI_DPI_FAC, viewport_size[3] / UI_DPI_FAC);
immUniform1i("colors_len", 2); /* "advanced" mode */
- immUniformArray4fv("colors", colors, 2);
+ immUniform4fv("color", colors[0]);
+ immUniform4fv("color2", colors[1]);
immUniform1f("dash_width", 4.0f);
immUniform1f("dash_factor", 0.5f);
GPU_line_width(1.0f);