d3d12: Fix d3d12_surface_destroy() to match pipe_surface_destroy_func()

Fixes: 0615a276 ("gallium: add a destructor param to surface refcounting functions")

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40751>
This commit is contained in:
Tanner Van De Walle 2026-03-31 18:33:21 -07:00 committed by Marge Bot
parent a45a7bbf44
commit 325b7692f8
4 changed files with 7 additions and 6 deletions

View file

@ -168,7 +168,7 @@ d3d12_reset_batch(struct d3d12_context *ctx, struct d3d12_batch *batch, uint64_t
_mesa_hash_table_clear(batch->bos, delete_bo_entry);
set_foreach_remove(batch->surfaces, entry) {
struct pipe_surface *surf = (struct pipe_surface *)entry->key;
pipe_surface_reference(&surf, NULL, &ctx->base, (pipe_surface_destroy_func)d3d12_surface_destroy);
pipe_surface_reference(&surf, NULL, &ctx->base, d3d12_surface_destroy);
}
_mesa_set_clear(batch->objects, delete_object);

View file

@ -2026,7 +2026,7 @@ d3d12_clear_render_target(struct pipe_context *pctx,
clear_color, 1, &rect);
ctx->has_commands = true;
d3d12_batch_reference_surface_texture(d3d12_current_batch(ctx), surf);
d3d12_surface_destroy(surf);
d3d12_surface_destroy(NULL, &surf->base);
}
@ -2075,7 +2075,7 @@ d3d12_clear_depth_stencil(struct pipe_context *pctx,
if (!render_condition_enabled && ctx->current_predication) {
d3d12_enable_predication(ctx);
}
d3d12_surface_destroy(surf);
d3d12_surface_destroy(NULL, &surf->base);
}
static void

View file

@ -257,8 +257,9 @@ d3d12_create_surface(struct d3d12_screen *screen,
}
void
d3d12_surface_destroy(struct d3d12_surface *surface)
d3d12_surface_destroy(struct pipe_context *ctx, struct pipe_surface *psurf)
{
struct d3d12_surface *surface = (struct d3d12_surface *)psurf;
struct d3d12_screen *screen = surface->screen;
mtx_lock(&screen->descriptor_pool_mutex);

View file

@ -63,7 +63,7 @@ d3d12_create_surface(struct d3d12_screen *screen,
const struct pipe_surface *tpl);
void
d3d12_surface_destroy(struct d3d12_surface *surf);
d3d12_surface_destroy(struct pipe_context *ctx, struct pipe_surface *psurf);
static inline void
d3d12_surface_reference(struct d3d12_surface **dst, struct d3d12_surface *src)
@ -74,7 +74,7 @@ d3d12_surface_reference(struct d3d12_surface **dst, struct d3d12_surface *src)
src ? &src->base.reference : NULL,
(debug_reference_descriptor)
debug_describe_surface))
d3d12_surface_destroy(old_dst);
d3d12_surface_destroy(NULL, &old_dst->base);
*dst = src;
}