st/drawpixels: move sv unref out to callers

no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33813>
This commit is contained in:
Mike Blumenkrantz 2025-02-27 12:02:04 -05:00 committed by Marge Bot
parent 8d4a3729a3
commit f47da0caef

View file

@ -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);
}