diff options
author | Kenneth Graunke <[email protected]> | 2019-01-24 09:01:53 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-02-21 10:26:11 -0800 |
commit | b1bacbf0386fde80e6e1a194fecca7c071863e57 (patch) | |
tree | b34e4d7e3bb42961ac5bb1d2d4004eca4baacc01 /src/gallium/drivers/iris | |
parent | e092ed9213c830656a77b8a87db6991819600d5b (diff) |
iris: Unreference some more things on state module teardown
Diffstat (limited to 'src/gallium/drivers/iris')
-rw-r--r-- | src/gallium/drivers/iris/iris_state.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 050738f7df1..28c510010e1 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -4956,8 +4956,8 @@ iris_destroy_state(struct iris_context *ice) const int i = u_bit_scan64(&bound_vbs); pipe_resource_reference(&genx->vertex_buffers[i].resource, NULL); } + free(ice->state.genx); - // XXX: unreference resources/surfaces. for (unsigned i = 0; i < ice->state.framebuffer.nr_cbufs; i++) { pipe_surface_reference(&ice->state.framebuffer.cbufs[i], NULL); } @@ -4966,9 +4966,28 @@ iris_destroy_state(struct iris_context *ice) for (int stage = 0; stage < MESA_SHADER_STAGES; stage++) { struct iris_shader_state *shs = &ice->state.shaders[stage]; pipe_resource_reference(&shs->sampler_table.res, NULL); + for (int i = 0; i < PIPE_MAX_CONSTANT_BUFFERS; i++) { + pipe_resource_reference(&shs->constbuf[i].data.res, NULL); + pipe_resource_reference(&shs->constbuf[i].surface_state.res, NULL); + } + for (int i = 0; i < PIPE_MAX_SHADER_IMAGES; i++) { + pipe_resource_reference(&shs->image[i].res, NULL); + pipe_resource_reference(&shs->image[i].surface_state.res, NULL); + } + for (int i = 0; i < PIPE_MAX_SHADER_BUFFERS; i++) { + pipe_resource_reference(&shs->ssbo[i], NULL); + pipe_resource_reference(&shs->ssbo_surface_state[i].res, NULL); + } + for (int i = 0; i < IRIS_MAX_TEXTURE_SAMPLERS; i++) { + pipe_sampler_view_reference((struct pipe_sampler_view **) + &shs->textures[i], NULL); + } } - free(ice->state.genx); + pipe_resource_reference(&ice->state.grid_size.res, NULL); + pipe_resource_reference(&ice->state.grid_surf_state.res, NULL); + + pipe_resource_reference(&ice->state.null_fb.res, NULL); pipe_resource_reference(&ice->state.unbound_tex.res, NULL); pipe_resource_reference(&ice->state.last_res.cc_vp, NULL); |