v3d: fix tfu_supports_tex_format() param type, and document why

tex_format should be `enum V3DX(Texture_Data_Formats)`, but using that enum
type in the header requires including `v3dx_pack.h`, which triggers circular
include dependencies issues, so use a `uint32_t` for now.

"fix" the one place that was using the correct enum, because doing so
triggers `-Wenum-int-mismatch` in GCC 13 as the function declaration
doesn't match the function definition.

Reported-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22739>
This commit is contained in:
Eric Engestrom
2023-04-27 17:16:22 +01:00
committed by Marge Bot
parent 4dd15177d0
commit 6a08dc7cab
3 changed files with 11 additions and 2 deletions
+4
View File
@@ -165,6 +165,10 @@ v3dX(format_supports_tlb_resolve)(const struct v3dv_format *format);
bool
v3dX(format_supports_blending)(const struct v3dv_format *format);
/* FIXME: tex_format should be `enum V3DX(Texture_Data_Formats)`, but using
* that enum type in the header requires including v3dx_pack.h, which triggers
* circular include dependencies issues, so we're using a `uint32_t` for now.
*/
bool
v3dX(tfu_supports_tex_format)(uint32_t tex_format);
+5
View File
@@ -44,5 +44,10 @@ 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);
/* FIXME: tex_format should be `enum V3DX(Texture_Data_Formats)`, but using
* that enum type in the header requires including v3dx_pack.h, which triggers
* circular include dependencies issues, so we're using a `uint32_t` for now.
*/
bool v3dX(tfu_supports_tex_format)(uint32_t tex_format,
bool for_mipmap);
+2 -2
View File
@@ -327,10 +327,10 @@ 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)(uint32_t tex_format,
bool for_mipmap)
{
switch (format) {
switch (tex_format) {
case TEXTURE_DATA_FORMAT_R8:
case TEXTURE_DATA_FORMAT_R8_SNORM:
case TEXTURE_DATA_FORMAT_RG8: