From f47da0caeff9997e3e5ca01a304e452ca1225408 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 27 Feb 2025 12:02:04 -0500 Subject: [PATCH] st/drawpixels: move sv unref out to callers no functional changes Part-of: --- src/mesa/state_tracker/st_cb_drawpixels.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 957046b43e1..496e356efc1 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -867,9 +867,6 @@ draw_textured_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z, 0, false, sv); st->state.num_sampler_views[PIPE_SHADER_FRAGMENT] = MAX2(st->state.num_sampler_views[PIPE_SHADER_FRAGMENT], num_sampler_view); - - for (unsigned i = 0; i < num_sampler_view; i++) - pipe_sampler_view_reference(&sv[i], NULL); } /* viewport state: viewport matching window dims */ @@ -1378,6 +1375,10 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y, ctx->Current.RasterColor, GL_FALSE, write_depth, write_stencil); + + for (unsigned i = 0; i < num_sampler_view; i++) + pipe_sampler_view_reference(&sv[i], NULL); + /* free the texture (but may persist in the cache) */ pipe_resource_reference(&pt, NULL); } @@ -1904,6 +1905,9 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy, ctx->Current.Attrib[VERT_ATTRIB_COLOR0], invertTex, write_depth, write_stencil); + for (unsigned i = 0; i < num_sampler_view; i++) + pipe_sampler_view_reference(&sv[i], NULL); + pipe_resource_reference(&pt, NULL); }