Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-06-04 17:04:11 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-06-04 17:04:18 +0300
commitbda0175984027c760ba0a203603c18d10323e9be (patch)
tree5724ba689a5ef93e7ed45deafad66c649b0d107e
parent570804882d70195b2edb88ab08d0c64444027831 (diff)
DRW: Fix leak from the wireframe drawing.
-rw-r--r--source/blender/draw/intern/draw_cache_impl_mesh.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index 1764d6b89ad..e6dde8adc97 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -1587,6 +1587,7 @@ typedef struct MeshBatchCache {
Gwn_Batch *edge_detection;
+ Gwn_VertBuf *edges_face_overlay;
GPUTexture *edges_face_overlay_tx;
int edges_face_overlay_tri_count; /* Number of tri in edges_face_overlay_tx */
@@ -1869,6 +1870,7 @@ static void mesh_batch_cache_clear(Mesh *me)
GWN_INDEXBUF_DISCARD_SAFE(cache->edges_adjacency);
GWN_BATCH_DISCARD_SAFE(cache->edge_detection);
+ GWN_VERTBUF_DISCARD_SAFE(cache->edges_face_overlay);
DRW_TEXTURE_FREE_SAFE(cache->edges_face_overlay_tx);
GWN_VERTBUF_DISCARD_SAFE(cache->shaded_triangles_data);
@@ -3356,6 +3358,7 @@ static GPUTexture *mesh_batch_cache_get_edges_overlay_texture_buf(MeshRenderData
Gwn_VertFormat format = {0};
uint index_id = GWN_vertformat_attr_add(&format, "index", GWN_COMP_I32, 1, GWN_FETCH_INT);
Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
+ cache->edges_face_overlay = vbo;
int vbo_len_capacity = tri_len * 3;
GWN_vertbuf_data_alloc(vbo, vbo_len_capacity);