mirror of
https://gitee.com/openharmony/third_party_mesa3d
synced 2024-11-24 07:50:26 +00:00
zink: use correct surface ref function for context destroy
the regular surface reference function can never be used in the driver
if it is possible that a surface may be destroyed, as this may reference
a previously-destroyed context
Fixes: 92a5ea13fc
("zink: implement a global framebuffer cache")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9787>
This commit is contained in:
parent
cbe9e95a96
commit
c39295a24b
@ -293,7 +293,9 @@ zink_context_destroy(struct pipe_context *pctx)
|
||||
debug_printf("vkQueueWaitIdle failed\n");
|
||||
|
||||
util_blitter_destroy(ctx->blitter);
|
||||
util_copy_framebuffer_state(&ctx->fb_state, NULL);
|
||||
for (unsigned i = 0; i < ctx->fb_state.nr_cbufs; i++)
|
||||
zink_surface_reference(screen, (struct zink_surface**)&ctx->fb_state.cbufs[i], NULL);
|
||||
zink_surface_reference(screen, (struct zink_surface**)&ctx->fb_state.zsbuf, NULL);
|
||||
|
||||
pipe_resource_reference(&ctx->dummy_vertex_buffer, NULL);
|
||||
pipe_resource_reference(&ctx->dummy_xfb_buffer, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user