diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-07-15 22:05:50 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-07-15 22:14:46 +0300 |
commit | 974e36d7d0a199ac2333e91691c52dd27bb3f8e7 (patch) | |
tree | 504118100fdc7a119a800ebe317fe4780f96b72c /source/blender | |
parent | 058514aa0abfbbeb87a89d863a2cdc85b5bdb5c4 (diff) |
Fix T78647 UVEdit: Crash when entering edit mode with UV Editor open
Only affects MacOS.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_draw.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 9f716739b1c..c1408c12120 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -416,13 +416,8 @@ static void draw_uvs(SpaceImage *sima, const float dash_width = (sima->dt_uv == SI_UVDT_DASH) ? (4.0f * UI_DPI_FAC) : 9999.0f; eGPUBuiltinShader shader = (interpedges) ? GPU_SHADER_2D_UV_EDGES_SMOOTH : GPU_SHADER_2D_UV_EDGES; - -#ifndef __APPLE__ - GPU_batch_program_set_builtin(batch->edges, shader); -#endif - - if (sima->dt_uv == SI_UVDT_OUTLINE) { #ifdef __APPLE__ + if (sima->dt_uv == SI_UVDT_OUTLINE) { /* Apple drivers do not support wide line. This is a workaround awaiting the 2D view * refactor. Limiting to OSX since this will slow down the drawing. (see T76806) */ GPU_batch_program_set_builtin(batch->edges, GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR); @@ -436,7 +431,13 @@ static void draw_uvs(SpaceImage *sima, GPU_batch_uniform_2fv(batch->edges, "viewportSize", &viewport[2]); GPU_batch_draw(batch->edges); -#else + } +#endif + + GPU_batch_program_set_builtin(batch->edges, shader); + + if (sima->dt_uv == SI_UVDT_OUTLINE) { +#ifndef __APPLE__ /* Black Outline. */ GPU_line_width(3.0f); GPU_batch_uniform_4f(batch->edges, "edgeColor", 0.0f, 0.0f, 0.0f, overlay_alpha); |