mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 05:38:16 +02:00
v3d: remove v3d_get_internal_type_bpp_for_output_format
This is a one-line wrapper, so let's just use the v3d_X or v3dX macros instead. Acked-by: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Juan A. Suarez <jasuarez@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23172>
This commit is contained in:
parent
b8f40fc4d4
commit
c6d0bc3918
4 changed files with 18 additions and 33 deletions
|
|
@ -760,10 +760,6 @@ uint8_t v3d_get_tex_return_channels(const struct v3d_device_info *devinfo,
|
|||
enum pipe_format f);
|
||||
const uint8_t *v3d_get_format_swizzle(const struct v3d_device_info *devinfo,
|
||||
enum pipe_format f);
|
||||
void v3d_get_internal_type_bpp_for_output_format(const struct v3d_device_info *devinfo,
|
||||
uint32_t format,
|
||||
uint32_t *type,
|
||||
uint32_t *bpp);
|
||||
bool v3d_format_supports_tlb_msaa_resolve(const struct v3d_device_info *devinfo,
|
||||
enum pipe_format f);
|
||||
|
||||
|
|
|
|||
|
|
@ -126,15 +126,6 @@ v3d_get_format_swizzle(const struct v3d_device_info *devinfo, enum pipe_format f
|
|||
return vf->swizzle;
|
||||
}
|
||||
|
||||
void
|
||||
v3d_get_internal_type_bpp_for_output_format(const struct v3d_device_info *devinfo,
|
||||
uint32_t format,
|
||||
uint32_t *type,
|
||||
uint32_t *bpp)
|
||||
{
|
||||
v3d_X(devinfo, get_internal_type_bpp_for_output_format)(format, type, bpp);
|
||||
}
|
||||
|
||||
bool
|
||||
v3d_format_supports_tlb_msaa_resolve(const struct v3d_device_info *devinfo,
|
||||
enum pipe_format f)
|
||||
|
|
@ -147,10 +138,8 @@ v3d_format_supports_tlb_msaa_resolve(const struct v3d_device_info *devinfo,
|
|||
if (!vf)
|
||||
return false;
|
||||
|
||||
v3d_get_internal_type_bpp_for_output_format(devinfo,
|
||||
vf->rt_type,
|
||||
&internal_type,
|
||||
&internal_bpp);
|
||||
v3d_X(devinfo, get_internal_type_bpp_for_output_format)
|
||||
(vf->rt_type, &internal_type, &internal_bpp);
|
||||
|
||||
return internal_type == V3D_INTERNAL_TYPE_8 ||
|
||||
internal_type == V3D_INTERNAL_TYPE_16F;
|
||||
|
|
|
|||
|
|
@ -710,7 +710,9 @@ v3d_resource_setup(struct pipe_screen *pscreen,
|
|||
const struct pipe_resource *tmpl)
|
||||
{
|
||||
struct v3d_screen *screen = v3d_screen(pscreen);
|
||||
struct v3d_device_info *devinfo = &screen->devinfo;
|
||||
struct v3d_resource *rsc = CALLOC_STRUCT(v3d_resource);
|
||||
|
||||
if (!rsc)
|
||||
return NULL;
|
||||
struct pipe_resource *prsc = &rsc->base;
|
||||
|
|
@ -721,21 +723,20 @@ v3d_resource_setup(struct pipe_screen *pscreen,
|
|||
prsc->screen = pscreen;
|
||||
|
||||
if (prsc->nr_samples <= 1 ||
|
||||
screen->devinfo.ver >= 40 ||
|
||||
devinfo->ver >= 40 ||
|
||||
util_format_is_depth_or_stencil(prsc->format)) {
|
||||
rsc->cpp = util_format_get_blocksize(prsc->format);
|
||||
if (screen->devinfo.ver < 40 && prsc->nr_samples > 1)
|
||||
if (devinfo->ver < 40 && prsc->nr_samples > 1)
|
||||
rsc->cpp *= prsc->nr_samples;
|
||||
} else {
|
||||
assert(v3d_rt_format_supported(&screen->devinfo, prsc->format));
|
||||
assert(v3d_rt_format_supported(devinfo, prsc->format));
|
||||
uint32_t output_image_format =
|
||||
v3d_get_rt_format(&screen->devinfo, prsc->format);
|
||||
v3d_get_rt_format(devinfo, prsc->format);
|
||||
uint32_t internal_type;
|
||||
uint32_t internal_bpp;
|
||||
v3d_get_internal_type_bpp_for_output_format(&screen->devinfo,
|
||||
output_image_format,
|
||||
&internal_type,
|
||||
&internal_bpp);
|
||||
v3d_X(devinfo, get_internal_type_bpp_for_output_format)
|
||||
(output_image_format, &internal_type, &internal_bpp);
|
||||
|
||||
switch (internal_bpp) {
|
||||
case V3D_INTERNAL_BPP_32:
|
||||
rsc->cpp = 4;
|
||||
|
|
@ -1048,6 +1049,7 @@ v3d_create_surface(struct pipe_context *pctx,
|
|||
{
|
||||
struct v3d_context *v3d = v3d_context(pctx);
|
||||
struct v3d_screen *screen = v3d->screen;
|
||||
struct v3d_device_info *devinfo = &screen->devinfo;
|
||||
struct v3d_surface *surface = CALLOC_STRUCT(v3d_surface);
|
||||
struct v3d_resource *rsc = v3d_resource(ptex);
|
||||
|
||||
|
|
@ -1073,7 +1075,7 @@ v3d_create_surface(struct pipe_context *pctx,
|
|||
psurf->u.tex.first_layer);
|
||||
surface->tiling = slice->tiling;
|
||||
|
||||
surface->format = v3d_get_rt_format(&screen->devinfo, psurf->format);
|
||||
surface->format = v3d_get_rt_format(devinfo, psurf->format);
|
||||
|
||||
const struct util_format_description *desc =
|
||||
util_format_description(psurf->format);
|
||||
|
|
@ -1095,9 +1097,8 @@ v3d_create_surface(struct pipe_context *pctx,
|
|||
}
|
||||
} else {
|
||||
uint32_t bpp, type;
|
||||
v3d_get_internal_type_bpp_for_output_format(&screen->devinfo,
|
||||
surface->format,
|
||||
&type, &bpp);
|
||||
v3d_X(devinfo, get_internal_type_bpp_for_output_format)
|
||||
(surface->format, &type, &bpp);
|
||||
surface->internal_type = type;
|
||||
surface->internal_bpp = bpp;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1019,10 +1019,9 @@ v3dX(create_texture_shader_state_bo)(struct v3d_context *v3d,
|
|||
v3d_get_rt_format(&screen->devinfo, cso->format);
|
||||
uint32_t internal_type;
|
||||
uint32_t internal_bpp;
|
||||
v3d_get_internal_type_bpp_for_output_format(&screen->devinfo,
|
||||
output_image_format,
|
||||
&internal_type,
|
||||
&internal_bpp);
|
||||
v3dX(get_internal_type_bpp_for_output_format)(output_image_format,
|
||||
&internal_type,
|
||||
&internal_bpp);
|
||||
|
||||
switch (internal_type) {
|
||||
case V3D_INTERNAL_TYPE_8:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue