Module: Mesa
Branch: master
Commit: 9d0406c52f01f3e8a8b5dbd523a7ff10b91b0b42
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9d0406c52f01f3e8a8b5dbd523a7ff10b91b0b42

Author: Eric Anholt <[email protected]>
Date:   Thu Jul  5 13:34:14 2018 -0700

v3d: Fix leak of the default attributes BOs.

The GLES3 CTS makes a lot more progress on a run now.

---

 src/gallium/drivers/v3d/v3dx_state.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/v3d/v3dx_state.c 
b/src/gallium/drivers/v3d/v3dx_state.c
index ff1c4b5212..f775c531e5 100644
--- a/src/gallium/drivers/v3d/v3dx_state.c
+++ b/src/gallium/drivers/v3d/v3dx_state.c
@@ -417,6 +417,15 @@ v3d_vertex_state_create(struct pipe_context *pctx, 
unsigned num_elements,
 }
 
 static void
+v3d_vertex_state_delete(struct pipe_context *pctx, void *hwcso)
+{
+        struct v3d_vertex_stateobj *so = hwcso;
+
+        v3d_bo_unreference(&so->default_attribute_values);
+        free(so);
+}
+
+static void
 v3d_vertex_state_bind(struct pipe_context *pctx, void *hwcso)
 {
         struct v3d_context *v3d = v3d_context(pctx);
@@ -959,7 +968,7 @@ v3dX(state_init)(struct pipe_context *pctx)
         pctx->delete_depth_stencil_alpha_state = v3d_generic_cso_state_delete;
 
         pctx->create_vertex_elements_state = v3d_vertex_state_create;
-        pctx->delete_vertex_elements_state = v3d_generic_cso_state_delete;
+        pctx->delete_vertex_elements_state = v3d_vertex_state_delete;
         pctx->bind_vertex_elements_state = v3d_vertex_state_bind;
 
         pctx->create_sampler_state = v3d_create_sampler_state;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to