r600: stop using u_resource_vtbl::resource_destroy
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10659>
This commit is contained in:
parent
8b2c0e725a
commit
f7b865f1a3
|
@ -1297,8 +1297,8 @@ static void r600_compute_global_transfer_unmap(struct pipe_context *ctx,
|
|||
assert (!"This function should not be called");
|
||||
}
|
||||
|
||||
static void r600_compute_global_buffer_destroy(struct pipe_screen *screen,
|
||||
struct pipe_resource *res)
|
||||
void r600_compute_global_buffer_destroy(struct pipe_screen *screen,
|
||||
struct pipe_resource *res)
|
||||
{
|
||||
struct r600_resource_global* buffer = NULL;
|
||||
struct r600_screen* rscreen = NULL;
|
||||
|
@ -1317,7 +1317,7 @@ static void r600_compute_global_buffer_destroy(struct pipe_screen *screen,
|
|||
|
||||
static const struct u_resource_vtbl r600_global_buffer_vtbl =
|
||||
{
|
||||
r600_compute_global_buffer_destroy, /* resource_destroy */
|
||||
NULL, /* resource_destroy */
|
||||
r600_compute_global_transfer_map, /* transfer_map */
|
||||
r600_compute_global_transfer_unmap, /* transfer_unmap */
|
||||
};
|
||||
|
|
|
@ -44,5 +44,7 @@ void evergreen_emit_cs_shader(struct r600_context *rctx, struct r600_atom * atom
|
|||
|
||||
struct r600_resource* r600_compute_buffer_alloc_vram(struct r600_screen *screen, unsigned size);
|
||||
struct pipe_resource *r600_compute_global_buffer_create(struct pipe_screen *screen, const struct pipe_resource *templ);
|
||||
void r600_compute_global_buffer_destroy(struct pipe_screen *screen,
|
||||
struct pipe_resource *res);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -222,8 +222,7 @@ bool r600_alloc_resource(struct r600_common_screen *rscreen,
|
|||
return true;
|
||||
}
|
||||
|
||||
static void r600_buffer_destroy(struct pipe_screen *screen,
|
||||
struct pipe_resource *buf)
|
||||
void r600_buffer_destroy(struct pipe_screen *screen, struct pipe_resource *buf)
|
||||
{
|
||||
struct r600_resource *rbuffer = r600_resource(buf);
|
||||
|
||||
|
@ -564,7 +563,7 @@ void r600_buffer_subdata(struct pipe_context *ctx,
|
|||
|
||||
static const struct u_resource_vtbl r600_buffer_vtbl =
|
||||
{
|
||||
r600_buffer_destroy, /* resource_destroy */
|
||||
NULL, /* resource_destroy */
|
||||
r600_buffer_transfer_map, /* transfer_map */
|
||||
r600_buffer_transfer_unmap, /* transfer_unmap */
|
||||
};
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include "r600_pipe_common.h"
|
||||
#include "r600_cs.h"
|
||||
#include "evergreen_compute.h"
|
||||
#include "tgsi/tgsi_parse.h"
|
||||
#include "util/list.h"
|
||||
#include "util/u_draw_quad.h"
|
||||
|
@ -1183,6 +1184,19 @@ r600_get_compiler_options(struct pipe_screen *screen,
|
|||
|
||||
extern bool r600_lower_to_scalar_instr_filter(const nir_instr *instr, const void *);
|
||||
|
||||
static void r600_resource_destroy(struct pipe_screen *screen,
|
||||
struct pipe_resource *res)
|
||||
{
|
||||
if (res->target == PIPE_BUFFER) {
|
||||
if (r600_resource(res)->compute_global_bo)
|
||||
r600_compute_global_buffer_destroy(screen, res);
|
||||
else
|
||||
r600_buffer_destroy(screen, res);
|
||||
} else {
|
||||
r600_texture_destroy(screen, res);
|
||||
}
|
||||
}
|
||||
|
||||
bool r600_common_screen_init(struct r600_common_screen *rscreen,
|
||||
struct radeon_winsys *ws)
|
||||
{
|
||||
|
@ -1219,7 +1233,7 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
|
|||
rscreen->b.get_compiler_options = r600_get_compiler_options;
|
||||
rscreen->b.fence_finish = r600_fence_finish;
|
||||
rscreen->b.fence_reference = r600_fence_reference;
|
||||
rscreen->b.resource_destroy = u_resource_destroy_vtbl;
|
||||
rscreen->b.resource_destroy = r600_resource_destroy;
|
||||
rscreen->b.resource_from_user_memory = r600_buffer_from_user_memory;
|
||||
rscreen->b.query_memory_info = r600_query_memory_info;
|
||||
|
||||
|
|
|
@ -641,6 +641,7 @@ void r600_init_resource_fields(struct r600_common_screen *rscreen,
|
|||
uint64_t size, unsigned alignment);
|
||||
bool r600_alloc_resource(struct r600_common_screen *rscreen,
|
||||
struct r600_resource *res);
|
||||
void r600_buffer_destroy(struct pipe_screen *screen, struct pipe_resource *buf);
|
||||
void r600_buffer_flush_region(struct pipe_context *ctx,
|
||||
struct pipe_transfer *transfer,
|
||||
const struct pipe_box *rel_box);
|
||||
|
@ -743,6 +744,7 @@ bool r600_prepare_for_dma_blit(struct r600_common_context *rctx,
|
|||
struct r600_texture *rsrc,
|
||||
unsigned src_level,
|
||||
const struct pipe_box *src_box);
|
||||
void r600_texture_destroy(struct pipe_screen *screen, struct pipe_resource *ptex);
|
||||
void r600_texture_get_fmask_info(struct r600_common_screen *rscreen,
|
||||
struct r600_texture *rtex,
|
||||
unsigned nr_samples,
|
||||
|
|
|
@ -574,8 +574,7 @@ static bool r600_texture_get_handle(struct pipe_screen* screen,
|
|||
return rscreen->ws->buffer_get_handle(rscreen->ws, res->buf, whandle);
|
||||
}
|
||||
|
||||
static void r600_texture_destroy(struct pipe_screen *screen,
|
||||
struct pipe_resource *ptex)
|
||||
void r600_texture_destroy(struct pipe_screen *screen, struct pipe_resource *ptex)
|
||||
{
|
||||
struct r600_texture *rtex = (struct r600_texture*)ptex;
|
||||
struct r600_resource *resource = &rtex->resource;
|
||||
|
@ -1521,7 +1520,7 @@ static void r600_texture_transfer_unmap(struct pipe_context *ctx,
|
|||
|
||||
static const struct u_resource_vtbl r600_texture_vtbl =
|
||||
{
|
||||
r600_texture_destroy, /* resource_destroy */
|
||||
NULL, /* resource_destroy */
|
||||
r600_texture_transfer_map, /* transfer_map */
|
||||
r600_texture_transfer_unmap, /* transfer_unmap */
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue