summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/radeonsi/si_texture.c
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2022-04-25 03:54:49 -0400
committerMarek Olšák <marek.olsak@amd.com>2022-05-03 11:11:08 -0400
commita0dad2f1db4c5f004d75e6cf13316d578a287a0c (patch)
treef7b20f6ebf7e5e69fdf8e552c000d57b9ccbd852 /src/gallium/drivers/radeonsi/si_texture.c
parent584e996ddd770c06176e6335950a10ddc3081c8a (diff)
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>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_texture.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_texture.c54
1 files changed, 23 insertions, 31 deletions
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)