[Bf-blender-cvs] [723c33aba07] blender2.8: UV Editor: Fix overflow issue with IMM usage.
Clément Foucault
noreply at git.blender.org
Thu Apr 19 14:26:10 CEST 2018
Commit: 723c33aba075a6722a73bafe44076982981420ee
Author: Clément Foucault
Date: Thu Apr 19 14:22:32 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB723c33aba075a6722a73bafe44076982981420ee
UV Editor: Fix overflow issue with IMM usage.
Use batch API in this case.
It's not the ideal solution (slow) but it works.
===================================================================
M source/blender/editors/uvedit/uvedit_draw.c
===================================================================
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);
More information about the Bf-blender-cvs
mailing list