v3dv: don't convert floating point border colors in v71
authorIago Toral Quiroga <itoral@igalia.com>
Thu, 7 Oct 2021 10:43:49 +0000 (12:43 +0200)
committerMarge Bot <emma+marge@anholt.net>
Fri, 13 Oct 2023 22:37:43 +0000 (22:37 +0000)
The TMU does this for us now.

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>

src/broadcom/vulkan/v3dvx_device.c

index e235983..72daefa 100644 (file)
@@ -118,7 +118,11 @@ static union pipe_color_union encode_border_color(
                              (1 << (desc->channel[i].size - 1)) - 1);
    }
 
-   /* convert from float to expected format */
+#if V3D_VERSION <= 42
+   /* The TMU in V3D 7.x always takes 32-bit floats and handles conversions
+    * for us. In V3D 4.x we need to manually convert floating point color
+    * values to the expected format.
+    */
    if (vk_format_is_srgb(bc_info->format) ||
        vk_format_is_compressed(bc_info->format)) {
       for (int i = 0; i < 4; i++)
@@ -170,6 +174,7 @@ static union pipe_color_union encode_border_color(
          }
       }
    }
+#endif
 
    return border;
 }