Mesa (master): i965: Add support for GL_SKIP_DECODE_EXT on other SRGB formats.

Eric Anholt anholt at kemper.freedesktop.org
Tue Jul 31 18:14:53 UTC 2012


Module: Mesa
Branch: master
Commit: 19bd5936af7278c0cce0728e8d6dec1a951eaf58
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=19bd5936af7278c0cce0728e8d6dec1a951eaf58

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Jul 30 11:04:57 2012 -0700

i965: Add support for GL_SKIP_DECODE_EXT on other SRGB formats.

Fixes some failures in getteximage-formats.

v2: Remove stray include, and drop extra test for encoding == GL_SRGB --
    _mesa_get_srgb_format_linear() returns the same format if it wasn't SRGB.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48120
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org> (v1)
NOTE: This is a candidate for the 8.0 branch.

---

 src/mesa/drivers/dri/i965/brw_wm_surface_state.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index 8bb0410..099668e 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -598,6 +598,9 @@ translate_tex_format(gl_format mesa_format,
 		     GLenum depth_mode,
 		     GLenum srgb_decode)
 {
+   if (srgb_decode == GL_SKIP_DECODE_EXT)
+      mesa_format = _mesa_get_srgb_format_linear(mesa_format);
+
    switch( mesa_format ) {
 
    case MESA_FORMAT_Z16:
@@ -613,14 +616,6 @@ translate_tex_format(gl_format mesa_format,
    case MESA_FORMAT_Z32_FLOAT_X24S8:
       return BRW_SURFACEFORMAT_R32G32_FLOAT;
 
-   case MESA_FORMAT_SARGB8:
-   case MESA_FORMAT_SLA8:
-   case MESA_FORMAT_SL8:
-      if (srgb_decode == GL_DECODE_EXT)
-	 return brw_format_for_mesa_format(mesa_format);
-      else if (srgb_decode == GL_SKIP_DECODE_EXT)
-	 return brw_format_for_mesa_format(_mesa_get_srgb_format_linear(mesa_format));
-
    case MESA_FORMAT_RGBA_FLOAT32:
       /* The value of this BRW_SURFACEFORMAT is 0, which tricks the
        * assertion below.




More information about the mesa-commit mailing list