Mesa (master): i965: Add real support for texturing/ rendering with MESA_FORMAT_RGBA8888_REV.

Eric Anholt anholt at kemper.freedesktop.org
Mon Apr 9 21:50:34 UTC 2012


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

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Mar 28 09:38:57 2012 -0700

i965: Add real support for texturing/rendering with MESA_FORMAT_RGBA8888_REV.

This was hacked in in one place for EGL image stuff, but the right
thing to do was just to provide the mapping from the mesa format to
the native hardware format, which includes render target support.

This turns out to be required for GL_ARB_texture_buffer_object, which
sees data in this layout.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_wm_surface_state.c |    6 +-----
 1 files changed, 1 insertions(+), 5 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 a3de2e3..1e37ed2 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -288,7 +288,7 @@ brw_format_for_mesa_format(gl_format mesa_format)
    static const uint32_t table[MESA_FORMAT_COUNT] =
    {
       [MESA_FORMAT_RGBA8888] = 0,
-      [MESA_FORMAT_RGBA8888_REV] = 0,
+      [MESA_FORMAT_RGBA8888_REV] = BRW_SURFACEFORMAT_R8G8B8A8_UNORM,
       [MESA_FORMAT_ARGB8888] = BRW_SURFACEFORMAT_B8G8R8A8_UNORM,
       [MESA_FORMAT_ARGB8888_REV] = 0,
       [MESA_FORMAT_XRGB8888] = BRW_SURFACEFORMAT_B8G8R8X8_UNORM,
@@ -606,10 +606,6 @@ translate_tex_format(gl_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_RGBA8888_REV:
-      /* This format is not renderable? */
-      return BRW_SURFACEFORMAT_R8G8B8A8_UNORM;
-
    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