threaded_resource_deinit(buf);
util_range_destroy(&rbuffer->valid_buffer_range);
+ pipe_resource_reference((struct pipe_resource**)&rbuffer->immed_buffer, NULL);
pb_reference(&rbuffer->buf, NULL);
FREE(rbuffer);
}
rbuffer->buf = NULL;
rbuffer->bind_history = 0;
+ rbuffer->immed_buffer = NULL;
util_range_init(&rbuffer->valid_buffer_range);
return rbuffer;
}
/* Whether this resource is referenced by bindless handles. */
bool texture_handle_allocated;
bool image_handle_allocated;
+
+ /*
+ * EG/Cayman only - for RAT operations hw need an immediate buffer
+ * to store results in.
+ */
+ struct r600_resource *immed_buffer;
};
struct r600_transfer {
const union pipe_color_union *color);
void r600_init_screen_texture_functions(struct r600_common_screen *rscreen);
void r600_init_context_texture_functions(struct r600_common_context *rctx);
+void eg_resource_alloc_immed(struct r600_common_screen *rscreen,
+ struct r600_resource *res,
+ unsigned immed_size);
/* r600_viewport.c */
void evergreen_apply_scissor_bug_workaround(struct r600_common_context *rctx,
struct r600_resource *resource = &rtex->resource;
r600_texture_reference(&rtex->flushed_depth_texture, NULL);
+ pipe_resource_reference((struct pipe_resource**)&resource->immed_buffer, NULL);
if (rtex->cmask_buffer != &rtex->resource) {
r600_resource_reference(&rtex->cmask_buffer, NULL);
p_atomic_inc(&rscreen->compressed_colortex_counter);
}
+void eg_resource_alloc_immed(struct r600_common_screen *rscreen,
+ struct r600_resource *res,
+ unsigned immed_size)
+{
+ res->immed_buffer = (struct r600_resource *)
+ pipe_buffer_create(&rscreen->b, PIPE_BIND_CUSTOM,
+ PIPE_USAGE_DEFAULT, immed_size);
+}
+
static void r600_texture_get_htile_size(struct r600_common_screen *rscreen,
struct r600_texture *rtex)
{