mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
zink: add zink_resource_reference() util function
same as pipe version but using different types Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33285>
This commit is contained in:
parent
2d630952b0
commit
c1e09c7309
3 changed files with 11 additions and 2 deletions
|
|
@ -429,7 +429,7 @@ destroy_query(struct zink_context *ctx, struct zink_query *query)
|
|||
pipe_resource_reference(&qbo->buffers[i], NULL);
|
||||
FREE(qbo);
|
||||
}
|
||||
pipe_resource_reference((struct pipe_resource**)&query->predicate, NULL);
|
||||
zink_resource_reference(&query->predicate, NULL);
|
||||
FREE(query);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -193,6 +193,15 @@ zink_batch_resource_usage_set(struct zink_batch_state *bs, struct zink_resource
|
|||
void
|
||||
zink_debug_mem_print_stats(struct zink_screen *screen);
|
||||
|
||||
static inline void
|
||||
zink_resource_reference(struct zink_resource **d, struct zink_resource *s)
|
||||
{
|
||||
struct pipe_resource *dst = &(*d)->base.b;
|
||||
struct pipe_resource *src = &s->base.b;
|
||||
pipe_resource_reference(&dst, src);
|
||||
*d = zink_resource(dst);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -396,7 +396,7 @@ zink_create_surface(struct pipe_context *pctx,
|
|||
|
||||
ivci.image = transient->obj->image;
|
||||
struct zink_surface *tsurf = create_surface(pctx, &transient->base.b, templ, &ivci, true);
|
||||
pipe_resource_reference((struct pipe_resource**)&transient, NULL);
|
||||
zink_resource_reference(&transient, NULL);
|
||||
if (unlikely(!tsurf)) {
|
||||
mesa_loge("ZINK: failed to create transient surface!");
|
||||
goto fail;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue