rctx->b.destroy_query(&rctx->b,
rctx->dcc_stats[i].ps_stats[j]);
- pipe_resource_reference((struct pipe_resource**)
- &rctx->dcc_stats[i].tex, NULL);
+ r600_texture_reference(&rctx->dcc_stats[i].tex, NULL);
}
if (rctx->gfx.cs)
(struct pipe_resource *)res);
}
+static inline void
+r600_texture_reference(struct r600_texture **ptr, struct r600_texture *res)
+{
+ pipe_resource_reference((struct pipe_resource **)ptr, &res->resource.b.b);
+}
+
static inline bool r600_get_strmout_en(struct r600_common_context *rctx)
{
return rctx->streamout.streamout_enabled ||
assert(!rtex->dcc_offset);
assert(!rtex->is_depth);
- pipe_resource_reference((struct pipe_resource**)&new_tex, NULL);
+ r600_texture_reference(&new_tex, NULL);
r600_dirty_all_framebuffer_states(rctx->screen);
p_atomic_inc(&rctx->screen->dirty_tex_descriptor_counter);
struct r600_resource *resource = &rtex->resource;
if (rtex->flushed_depth_texture)
- pipe_resource_reference((struct pipe_resource **)&rtex->flushed_depth_texture, NULL);
+ r600_texture_reference(&rtex->flushed_depth_texture, NULL);
r600_resource_reference(&rtex->htile_buffer, NULL);
if (rtex->cmask_buffer != &rtex->resource) {
rctx->dcc_stats[oldest_slot].ps_stats[i] = NULL;
}
- pipe_resource_reference((struct pipe_resource**)
- &rctx->dcc_stats[oldest_slot].tex, NULL);
+ r600_texture_reference(&rctx->dcc_stats[oldest_slot].tex, NULL);
empty_slot = oldest_slot;
}
/* Add the texture to the new slot. */
- pipe_resource_reference((struct pipe_resource**)&rctx->dcc_stats[empty_slot].tex,
- &tex->resource.b.b);
+ r600_texture_reference(&rctx->dcc_stats[empty_slot].tex, tex);
rctx->dcc_stats[empty_slot].last_use_timestamp = os_time_get();
return empty_slot;
}