mesa: Add ChooseTexFormat support for the new XBGR formats. 87/6687/1
authorEric Anholt <eric@anholt.net>
Thu, 21 Mar 2013 16:45:20 +0000 (09:45 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 21 May 2013 22:20:28 +0000 (15:20 -0700)
src/mesa/main/texformat.c

index ed40b7e..362e210 100644 (file)
@@ -142,6 +142,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
       case GL_RGB10:
       case GL_RGB12:
       case GL_RGB16:
+        RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR16161616_UNORM);
         RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16);
         RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888);
         RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
@@ -424,12 +425,14 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
            break;
          case GL_RGB16F_ARB:
            RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT16);
+           RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR16161616_FLOAT);
            RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16);
            RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT32);
            RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32);
            break;
          case GL_RGB32F_ARB:
            RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT32);
+           RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR32323232_FLOAT);
            RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32);
            RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT16);
            RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16);
@@ -555,6 +558,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
            break;
          case GL_RGB16_SNORM:
            RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGB_16);
+           RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR16161616_SNORM);
            /* FALLTHROUGH */
          case GL_RGBA16_SNORM:
            RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA_16);
@@ -740,26 +744,32 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
       switch (internalFormat) {
       case GL_RGB8UI_EXT:
          RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_UINT8);
+         RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR8888_UINT);
          RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT8);
          break;
       case GL_RGB16UI_EXT:
          RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_UINT16);
+         RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR16161616_UINT);
          RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT16);
          break;
       case GL_RGB32UI_EXT:
          RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_UINT32);
+         RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR32323232_UINT);
          RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT32);
          break;
       case GL_RGB8I_EXT:
          RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_INT8);
+         RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR8888_SINT);
          RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT8);
          break;
       case GL_RGB16I_EXT:
          RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_INT16);
+         RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR16161616_SINT);
          RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT16);
          break;
       case GL_RGB32I_EXT:
          RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_INT32);
+         RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR32323232_SINT);
          RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT32);
          break;
       case GL_RGBA8UI_EXT: