mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 11:28:05 +02:00
v3d: extend the list of formats supported by the TFU unit
TFU can convert from these new formats, but can not autogenerate mipmaps from them. Hence we need to set what is the purpose to know if the formats are supported or not. v1: - Use the same and shorter variable name (Alejandro) Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8050>
This commit is contained in:
parent
4117f08226
commit
42fd7e3457
5 changed files with 22 additions and 10 deletions
|
|
@ -214,7 +214,8 @@ v3d_tfu(struct pipe_context *pctx,
|
|||
unsigned int base_level,
|
||||
unsigned int last_level,
|
||||
unsigned int src_layer,
|
||||
unsigned int dst_layer)
|
||||
unsigned int dst_layer,
|
||||
bool for_mipmap)
|
||||
{
|
||||
struct v3d_context *v3d = v3d_context(pctx);
|
||||
struct v3d_screen *screen = v3d->screen;
|
||||
|
|
@ -234,7 +235,7 @@ v3d_tfu(struct pipe_context *pctx,
|
|||
uint32_t tex_format = v3d_get_tex_format(&screen->devinfo,
|
||||
pdst->format);
|
||||
|
||||
if (!v3d_tfu_supports_tex_format(&screen->devinfo, tex_format))
|
||||
if (!v3d_tfu_supports_tex_format(&screen->devinfo, tex_format, for_mipmap))
|
||||
return false;
|
||||
|
||||
if (pdst->target != PIPE_TEXTURE_2D || psrc->target != PIPE_TEXTURE_2D)
|
||||
|
|
@ -343,7 +344,8 @@ v3d_generate_mipmap(struct pipe_context *pctx,
|
|||
prsc, prsc,
|
||||
base_level,
|
||||
base_level, last_level,
|
||||
first_layer, first_layer);
|
||||
first_layer, first_layer,
|
||||
true);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -373,7 +375,8 @@ v3d_tfu_blit(struct pipe_context *pctx, const struct pipe_blit_info *info)
|
|||
return v3d_tfu(pctx, info->dst.resource, info->src.resource,
|
||||
info->src.level,
|
||||
info->dst.level, info->dst.level,
|
||||
info->src.box.z, info->dst.box.z);
|
||||
info->src.box.z, info->dst.box.z,
|
||||
false);
|
||||
}
|
||||
|
||||
static struct pipe_surface *
|
||||
|
|
|
|||
|
|
@ -691,7 +691,8 @@ void v3d_get_internal_type_bpp_for_output_format(const struct v3d_device_info *d
|
|||
uint32_t *type,
|
||||
uint32_t *bpp);
|
||||
bool v3d_tfu_supports_tex_format(const struct v3d_device_info *devinfo,
|
||||
uint32_t tex_format);
|
||||
uint32_t tex_format,
|
||||
bool for_mipmap);
|
||||
bool v3d_format_supports_tlb_msaa_resolve(const struct v3d_device_info *devinfo,
|
||||
enum pipe_format f);
|
||||
|
||||
|
|
|
|||
|
|
@ -149,12 +149,13 @@ v3d_get_internal_type_bpp_for_output_format(const struct v3d_device_info *devinf
|
|||
|
||||
bool
|
||||
v3d_tfu_supports_tex_format(const struct v3d_device_info *devinfo,
|
||||
uint32_t tex_format)
|
||||
uint32_t tex_format,
|
||||
bool for_mipmap)
|
||||
{
|
||||
if (devinfo->ver >= 41) {
|
||||
return v3d41_tfu_supports_tex_format(tex_format);
|
||||
return v3d41_tfu_supports_tex_format(tex_format, for_mipmap);
|
||||
} else {
|
||||
return v3d33_tfu_supports_tex_format(tex_format);
|
||||
return v3d33_tfu_supports_tex_format(tex_format, for_mipmap);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,4 +44,5 @@ const struct v3d_format *v3dX(get_format_desc)(enum pipe_format f);
|
|||
void v3dX(get_internal_type_bpp_for_output_format)(uint32_t format,
|
||||
uint32_t *type,
|
||||
uint32_t *bpp);
|
||||
bool v3dX(tfu_supports_tex_format)(uint32_t tex_format);
|
||||
bool v3dX(tfu_supports_tex_format)(uint32_t tex_format,
|
||||
bool for_mipmap);
|
||||
|
|
|
|||
|
|
@ -326,7 +326,8 @@ v3dX(get_internal_type_bpp_for_output_format)(uint32_t format,
|
|||
}
|
||||
|
||||
bool
|
||||
v3dX(tfu_supports_tex_format)(enum V3DX(Texture_Data_Formats) format)
|
||||
v3dX(tfu_supports_tex_format)(enum V3DX(Texture_Data_Formats) format,
|
||||
bool for_mipmap)
|
||||
{
|
||||
switch (format) {
|
||||
case TEXTURE_DATA_FORMAT_R8:
|
||||
|
|
@ -351,6 +352,11 @@ v3dX(tfu_supports_tex_format)(enum V3DX(Texture_Data_Formats) format)
|
|||
case TEXTURE_DATA_FORMAT_R11F_G11F_B10F:
|
||||
case TEXTURE_DATA_FORMAT_R4:
|
||||
return true;
|
||||
case TEXTURE_DATA_FORMAT_RGB9_E5:
|
||||
case TEXTURE_DATA_FORMAT_R32F:
|
||||
case TEXTURE_DATA_FORMAT_RG32F:
|
||||
case TEXTURE_DATA_FORMAT_RGBA32F:
|
||||
return !for_mipmap;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue