diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index e3891105f1e..a80e1f6bb4e 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -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); diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index 5149558fc9b..eda37fbbc5b 100644 --- a/src/gallium/drivers/radeonsi/si_texture.c +++ b/src/gallium/drivers/radeonsi/si_texture.c @@ -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)