v3d: fix tfu_supports_tex_format() param type, and document why
authorEric Engestrom <eric@igalia.com>
Thu, 27 Apr 2023 16:16:22 +0000 (17:16 +0100)
committerMarge Bot <emma+marge@anholt.net>
Thu, 27 Apr 2023 22:17:48 +0000 (22:17 +0000)
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>

src/broadcom/vulkan/v3dvx_private.h
src/gallium/drivers/v3d/v3dx_context.h
src/gallium/drivers/v3d/v3dx_format_table.c

index c693952..ad8ddfa 100644 (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);
 
index 9c64752..03d7c24 100644 (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);
index 89b4449..9920aa8 100644 (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: