Mesa (staging/19.2): iris: Properly unreference extra VBOs for draw parameters
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Oct 9 16:35:59 UTC 2019
Module: Mesa
Branch: staging/19.2
Commit: eae86c6baa79c820771c14a380f644f9cf0b0402
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=eae86c6baa79c820771c14a380f644f9cf0b0402
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Tue Oct 8 10:11:52 2019 -0700
iris: Properly unreference extra VBOs for draw parameters
bound_vertex_buffers doesn't include extra draw parameters buffers.
Tracking this correctly is kind of complicated, and iris_destroy_state
isn't exactly in a hot path, so just loop over all VBO bindings.
Fixes: 4122665dd90 (iris: Enable ARB_shader_draw_parameters support)
Reported-by: Sergii Romantsov <sergii.romantsov at globallogic.com>
(cherry picked from commit face221283f0be316ae6629155a908d8972c2fa7)
---
src/gallium/drivers/iris/iris_state.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index d1de2552280..1f354bc3bee 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -5845,11 +5845,11 @@ iris_destroy_state(struct iris_context *ice)
pipe_resource_reference(&ice->draw.draw_params_res, NULL);
pipe_resource_reference(&ice->draw.derived_draw_params_res, NULL);
- uint64_t bound_vbs = ice->state.bound_vertex_buffers;
- while (bound_vbs) {
- const int i = u_bit_scan64(&bound_vbs);
+ /* Loop over all VBOs, including ones for draw parameters */
+ for (unsigned i = 0; i < ARRAY_SIZE(genx->vertex_buffers); i++) {
pipe_resource_reference(&genx->vertex_buffers[i].resource, NULL);
}
+
free(ice->state.genx);
for (int i = 0; i < 4; i++) {
More information about the mesa-commit
mailing list