aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2019-10-08 10:11:52 -0700
committerKenneth Graunke <[email protected]>2019-10-08 11:14:21 -0700
commitface221283f0be316ae6629155a908d8972c2fa7 (patch)
tree333ecd8a45d4e4348c73467430b48fe78a35db53 /src
parent6f26eae077af2b4e1f51e9a9524617937afc8e36 (diff)
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/iris/iris_state.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index ab1578fc184..6f0aa182339 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -6045,11 +6045,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++) {