GWN Immediate: use GWN_BATCH_OWNS_VBO for created with imm immBeginBatch.

This commit is contained in:
Germano
2018-04-19 11:24:10 -03:00
parent 1266a36b87
commit ffe02e17b2
2 changed files with 1 additions and 5 deletions

View File

@@ -275,7 +275,7 @@ Gwn_Batch* immBeginBatch(Gwn_PrimType prim_type, unsigned vertex_ct)
imm.buffer_bytes_mapped = GWN_vertbuf_size_get(verts);
imm.vertex_data = verts->data;
imm.batch = GWN_batch_create(prim_type, verts, NULL);
imm.batch = GWN_batch_create_ex(prim_type, verts, NULL, GWN_BATCH_OWNS_VBO);
imm.batch->phase = GWN_BATCH_BUILDING;
return imm.batch;

View File

@@ -414,8 +414,6 @@ static void draw_uvs_lineloop_bmfaces(BMesh *bm, const int cd_loop_uv_offset, co
index += efa->len;
}
GWN_batch_program_use_end(loop_batch);
GWN_vertbuf_discard(loop_batch->verts[0]);
GWN_batch_discard(loop_batch);
immUnbindProgram();
@@ -908,7 +906,6 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, ViewLayer *view_layer, Obje
immEnd();
GWN_batch_draw(flat_edges_batch);
GWN_vertbuf_discard(flat_edges_batch->verts[0]);
GWN_batch_discard(flat_edges_batch);
immUnbindProgram();
@@ -937,7 +934,6 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, ViewLayer *view_layer, Obje
immUnbindProgram();
}
GWN_vertbuf_discard(loop_vbo);
GWN_batch_discard(loop_batch);
if (sima->flag & SI_SMOOTH_UV) {