mesa: try RGBA_FLOAT16 before RGBA_FLOAT32 when choosing A,L,LA,I formats
authorBrian Paul <brianp@vmware.com>
Mon, 16 Jan 2012 17:08:08 +0000 (10:08 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 18 Jan 2012 17:44:05 +0000 (10:44 -0700)
To try to use less tex memory and maybe get better performance.
Spotted by Roland Scheidegger.

NOTE: This is a candidate for the 8.0 and 7.11 branches.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/mesa/main/texformat.c

index d393873f2a14a77a65215e5a53d5ad8416cf0aa6..259eb90444d4eb0089219a55f335356afbf01e31 100644 (file)
@@ -323,6 +323,7 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
          case GL_ALPHA16F_ARB:
            RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_FLOAT16);
            RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_FLOAT32);
+           RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16);
            RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32);
            break;
          case GL_ALPHA32F_ARB:
@@ -334,6 +335,7 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
          case GL_LUMINANCE16F_ARB:
            RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_FLOAT16);
            RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_FLOAT32);
+           RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16);
            RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32);
            break;
          case GL_LUMINANCE32F_ARB:
@@ -345,6 +347,7 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
          case GL_LUMINANCE_ALPHA16F_ARB:
            RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16);
            RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32);
+           RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16);
            RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32);
            break;
          case GL_LUMINANCE_ALPHA32F_ARB:
@@ -356,6 +359,7 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
          case GL_INTENSITY16F_ARB:
            RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_FLOAT16);
            RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_FLOAT32);
+           RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16);
            RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32);
            break;
          case GL_INTENSITY32F_ARB: