dri: Use RGB internal formats for RGBX formats
authorSviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Mon, 7 Aug 2023 15:46:07 +0000 (18:46 +0300)
committerMarge Bot <emma+marge@anholt.net>
Fri, 18 Aug 2023 11:00:40 +0000 (11:00 +0000)
These formats do not contain alpha channel, so their internal formats
should reflect that.

Fixes: bf576772 ("dri_util: add driImageFormatToSizedInternalGLFormat function")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9429
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24580>

src/gallium/frontends/dri/dri_util.c

index ae74105..b27dee3 100644 (file)
@@ -961,7 +961,7 @@ static const struct {
    {
       .image_format    = __DRI_IMAGE_FORMAT_XBGR16161616F,
       .mesa_format     =        MESA_FORMAT_RGBX_FLOAT16,
-      .internal_format =        GL_RGBA16F,
+      .internal_format =        GL_RGB16F,
    },
    {
       .image_format    = __DRI_IMAGE_FORMAT_ABGR16161616,
@@ -971,7 +971,7 @@ static const struct {
    {
       .image_format    = __DRI_IMAGE_FORMAT_XBGR16161616,
       .mesa_format     =        MESA_FORMAT_RGBX_UNORM16,
-      .internal_format =        GL_RGBA16,
+      .internal_format =        GL_RGB16,
    },
    {
       .image_format    = __DRI_IMAGE_FORMAT_ARGB2101010,
@@ -981,7 +981,7 @@ static const struct {
    {
       .image_format    = __DRI_IMAGE_FORMAT_XRGB2101010,
       .mesa_format     =        MESA_FORMAT_B10G10R10X2_UNORM,
-      .internal_format =        GL_RGB10_A2,
+      .internal_format =        GL_RGB10,
    },
    {
       .image_format    = __DRI_IMAGE_FORMAT_ABGR2101010,
@@ -991,7 +991,7 @@ static const struct {
    {
       .image_format    = __DRI_IMAGE_FORMAT_XBGR2101010,
       .mesa_format     =        MESA_FORMAT_R10G10B10X2_UNORM,
-      .internal_format =        GL_RGB10_A2,
+      .internal_format =        GL_RGB10,
    },
    {
       .image_format    = __DRI_IMAGE_FORMAT_ARGB8888,
@@ -1043,7 +1043,7 @@ static const struct {
    {
       .image_format = __DRI_IMAGE_FORMAT_SXRGB8,
       .mesa_format  =           MESA_FORMAT_B8G8R8X8_SRGB,
-      .internal_format =        GL_SRGB8_ALPHA8,
+      .internal_format =        GL_SRGB8,
    },
    {
       .image_format    = __DRI_IMAGE_FORMAT_R16,