UV Editor: Fix overflow issue with IMM usage.
Use batch API in this case. It's not the ideal solution (slow) but it works.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user