diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h index 5161caf4846..4bb3dbd362c 100644 --- a/src/gallium/auxiliary/util/u_inlines.h +++ b/src/gallium/auxiliary/util/u_inlines.h @@ -209,25 +209,6 @@ pipe_drop_resource_references(struct pipe_resource *dst, int num_refs) pipe_resource_destroy(dst); } -/** - * Same as pipe_surface_unref, but used when pipe_context doesn't exist - * anymore. - */ -static inline void -pipe_surface_unref_no_context(struct pipe_surface **ptr) -{ - struct pipe_surface *surf = *ptr; - - if (pipe_reference_described(&surf->reference, NULL, - (debug_reference_descriptor) - debug_describe_surface)) { - /* trivially destroy pipe_surface */ - pipe_resource_reference(&surf->texture, NULL); - free(surf); - } - *ptr = NULL; -} - /** * Set *dst to \p src with proper reference counting. * diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c index aa98c131ede..2144dbf0942 100644 --- a/src/gallium/drivers/r600/evergreen_compute.c +++ b/src/gallium/drivers/r600/evergreen_compute.c @@ -100,7 +100,7 @@ static void evergreen_set_rat(struct r600_pipe_compute *pipe, /* Add the RAT the list of color buffers. Drop the old buffer first. */ pipe->ctx->framebuffer.state.cbufs[id] = rat_templ; - pipe_surface_unref_no_context(&pipe->ctx->framebuffer.fb_cbufs[id]); + pipe_surface_unref(&pipe->ctx->b.b, &pipe->ctx->framebuffer.fb_cbufs[id]); pipe->ctx->framebuffer.fb_cbufs[id] = pipe->ctx->b.b.create_surface( (struct pipe_context *)pipe->ctx, (struct pipe_resource *)bo, &rat_templ);