radeonsi: remove si_create_surface_custom

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16215>
This commit is contained in:
Marek Olšák 2022-04-25 03:54:49 -04:00
parent 584e996ddd
commit a0dad2f1db
2 changed files with 23 additions and 35 deletions

View file

@ -1579,10 +1579,6 @@ bool vi_dcc_formats_are_incompatible(struct pipe_resource *tex, unsigned level,
enum pipe_format view_format);
void vi_disable_dcc_if_incompatible_format(struct si_context *sctx, struct pipe_resource *tex,
unsigned level, enum pipe_format view_format);
struct pipe_surface *si_create_surface_custom(struct pipe_context *pipe,
struct pipe_resource *texture,
const struct pipe_surface *templ, unsigned width0,
unsigned height0, unsigned width, unsigned height);
unsigned si_translate_colorswap(enum chip_class chip_class, enum pipe_format format,
bool do_endian_swap);
bool si_texture_disable_dcc(struct si_context *sctx, struct si_texture *tex);

View file

@ -2061,36 +2061,6 @@ void vi_disable_dcc_if_incompatible_format(struct si_context *sctx, struct pipe_
si_decompress_dcc(sctx, stex);
}
struct pipe_surface *si_create_surface_custom(struct pipe_context *pipe,
struct pipe_resource *texture,
const struct pipe_surface *templ, unsigned width0,
unsigned height0, unsigned width, unsigned height)
{
struct si_surface *surface = CALLOC_STRUCT(si_surface);
if (!surface)
return NULL;
assert(templ->u.tex.first_layer <= util_max_layer(texture, templ->u.tex.level));
assert(templ->u.tex.last_layer <= util_max_layer(texture, templ->u.tex.level));
pipe_reference_init(&surface->base.reference, 1);
pipe_resource_reference(&surface->base.texture, texture);
surface->base.context = pipe;
surface->base.format = templ->format;
surface->base.width = width;
surface->base.height = height;
surface->base.u = templ->u;
surface->width0 = width0;
surface->height0 = height0;
surface->dcc_incompatible =
texture->target != PIPE_BUFFER &&
vi_dcc_formats_are_incompatible(texture, templ->u.tex.level, templ->format);
return &surface->base;
}
static struct pipe_surface *si_create_surface(struct pipe_context *pipe, struct pipe_resource *tex,
const struct pipe_surface *templ)
{
@ -2121,7 +2091,29 @@ static struct pipe_surface *si_create_surface(struct pipe_context *pipe, struct
}
}
return si_create_surface_custom(pipe, tex, templ, width0, height0, width, height);
struct si_surface *surface = CALLOC_STRUCT(si_surface);
if (!surface)
return NULL;
assert(templ->u.tex.first_layer <= util_max_layer(tex, templ->u.tex.level));
assert(templ->u.tex.last_layer <= util_max_layer(tex, templ->u.tex.level));
pipe_reference_init(&surface->base.reference, 1);
pipe_resource_reference(&surface->base.texture, tex);
surface->base.context = pipe;
surface->base.format = templ->format;
surface->base.width = width;
surface->base.height = height;
surface->base.u = templ->u;
surface->width0 = width0;
surface->height0 = height0;
surface->dcc_incompatible =
tex->target != PIPE_BUFFER &&
vi_dcc_formats_are_incompatible(tex, templ->u.tex.level, templ->format);
return &surface->base;
}
static void si_surface_destroy(struct pipe_context *pipe, struct pipe_surface *surface)