[Mesa-dev] [PATCH 01/11] mesa: Add ChooseTexFormat support for the new XBGR formats.

Eric Anholt eric at anholt.net
Tue Apr 16 17:21:13 PDT 2013


---
 src/mesa/main/texformat.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index 6f22a4f..ecf8fec 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -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:
-- 
1.7.10.4



More information about the mesa-dev mailing list