From 0676963809a4800f1f666cd559c30885d79f66b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Mon, 2 May 2022 00:35:49 +0200 Subject: 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. --- source/blender/editors/uvedit/uvedit_draw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/uvedit') diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index a083ded1752..141b59e0355 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -46,8 +46,8 @@ void ED_image_draw_cursor(ARegion *region, const float cursor[2]) immUniform2f("viewport_size", viewport_size[2] / UI_DPI_FAC, viewport_size[3] / UI_DPI_FAC); immUniform1i("colors_len", 2); /* "advanced" mode */ - immUniformArray4fv( - "colors", (float *)(float[][4]){{1.0f, 0.0f, 0.0f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f}}, 2); + immUniform4f("color", 1.0f, 0.0f, 0.0f, 1.0f); + immUniform4f("color2", 1.0f, 1.0f, 1.0f, 1.0f); immUniform1f("dash_width", 8.0f); immUniform1f("dash_factor", 0.5f); @@ -67,8 +67,8 @@ void ED_image_draw_cursor(ARegion *region, const float cursor[2]) immEnd(); - immUniformArray4fv( - "colors", (float *)(float[][4]){{1.0f, 1.0f, 1.0f, 1.0f}, {0.0f, 0.0f, 0.0f, 1.0f}}, 2); + immUniform4f("color", 1.0f, 1.0f, 1.0f, 1.0f); + immUniform4f("color2", 0.0f, 0.0f, 0.0f, 1.0f); immUniform1f("dash_width", 2.0f); immUniform1f("dash_factor", 0.5f); -- cgit v1.2.3