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);
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)
{
}
}
- 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)