diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-05-02 01:35:49 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-05-02 01:35:49 +0300 |
commit | 0676963809a4800f1f666cd559c30885d79f66b8 (patch) | |
tree | d7971e9bee7a62e8088f97cfcd475393e457f581 /source/blender/editors/space_view3d | |
parent | 2a7a01b339ad60aec5ffe265411fa2f0b1589137 (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/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_gizmo_ruler.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c index 3a8a28dc2a1..567022cc9d1 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c @@ -689,10 +689,8 @@ static void gizmo_ruler_draw(const bContext *C, wmGizmo *gz) immUniform1i("colors_len", 2); /* "advanced" mode */ const float *col = is_act ? color_act : color_base; - immUniformArray4fv( - "colors", - (float *)(float[][4]){{0.67f, 0.67f, 0.67f, 1.0f}, {col[0], col[1], col[2], col[3]}}, - 2); + immUniform4f("color", 0.67f, 0.67f, 0.67f, 1.0f); + immUniform4f("color2", col[0], col[1], col[2], col[3]); immUniform1f("dash_width", 6.0f); immUniform1f("dash_factor", 0.5f); @@ -760,10 +758,8 @@ static void gizmo_ruler_draw(const bContext *C, wmGizmo *gz) immUniform1i("colors_len", 2); /* "advanced" mode */ const float *col = is_act ? color_act : color_base; - immUniformArray4fv( - "colors", - (float *)(float[][4]){{0.67f, 0.67f, 0.67f, 1.0f}, {col[0], col[1], col[2], col[3]}}, - 2); + immUniform4f("color", 0.67f, 0.67f, 0.67f, 1.0f); + immUniform4f("color2", col[0], col[1], col[2], col[3]); immUniform1f("dash_width", 6.0f); immUniform1f("dash_factor", 0.5f); |