diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-04-19 15:22:32 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-04-19 15:25:59 +0300 |
commit | 723c33aba075a6722a73bafe44076982981420ee (patch) | |
tree | e02b16e50acbec84b4d6b097ef5edb8613d86451 /source/blender/editors/uvedit/uvedit_draw.c | |
parent | e2dce975bc35cdd4d0ead2e0a0ac956f1ecc04aa (diff) |
UV Editor: Fix overflow issue with IMM usage.
Use batch API in this case.
It's not the ideal solution (slow) but it works.
Diffstat (limited to 'source/blender/editors/uvedit/uvedit_draw.c')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_draw.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index e0d0dec8fbd..20f05502b35 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -719,7 +719,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, ViewLayer *view_layer, Obje immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); - immBegin(GWN_PRIM_TRIS, tri_count * 3); + Gwn_Batch *face_batch = immBeginBatch(GWN_PRIM_TRIS, tri_count * 3); for (unsigned int i = 0; i < em->tottri; i++) { efa = em->looptris[i][0]->f; if (BM_elem_flag_test(efa, BM_ELEM_TAG)) { @@ -740,6 +740,11 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, ViewLayer *view_layer, Obje } immEnd(); + /* XXX performance: we should not create and throw away result. */ + GWN_batch_draw(face_batch); + GWN_batch_program_use_end(face_batch); + GWN_batch_discard(face_batch); + immUnbindProgram(); glDisable(GL_BLEND); |