Mesa (master): i965: Add the missing supportable EXT_texture_snorm formats

Ian Romanick idr at kemper.freedesktop.org
Mon Apr 4 22:20:57 UTC 2011


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

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Sat Apr  2 18:49:13 2011 -0700

i965: Add the missing supportable EXT_texture_snorm formats

This class of hardware can natively sample all of the snorm surface
formats that DX10 requires, but it can't do some of the legacy GL
formats.  In particular, all of the alpha, luminance, and intensity
formats are unsupported.

This partially fixes the breakage in glean's pixelFormats test since
GL_EXT_texture_snorm support was added to Mesa.

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

---

 src/mesa/drivers/dri/i965/brw_wm_surface_state.c |    4 ++++
 src/mesa/drivers/dri/intel/intel_context.c       |    5 +++++
 2 files changed, 9 insertions(+), 0 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 1010d9f..aeda4d5 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -100,7 +100,11 @@ static uint32_t brw_format_for_mesa_format[MESA_FORMAT_COUNT] =
    [MESA_FORMAT_SLA8] = BRW_SURFACEFORMAT_L8A8_UNORM_SRGB,
    [MESA_FORMAT_SL8] = BRW_SURFACEFORMAT_L8_UNORM_SRGB,
    [MESA_FORMAT_DUDV8] = BRW_SURFACEFORMAT_R8G8_SNORM,
+   [MESA_FORMAT_SIGNED_R8] = BRW_SURFACEFORMAT_R8_SNORM,
+   [MESA_FORMAT_SIGNED_RG88_REV] = BRW_SURFACEFORMAT_R8G8_SNORM,
    [MESA_FORMAT_SIGNED_RGBA8888_REV] = BRW_SURFACEFORMAT_R8G8B8A8_SNORM,
+   [MESA_FORMAT_SIGNED_R16] = BRW_SURFACEFORMAT_R16_SNORM,
+   [MESA_FORMAT_SIGNED_GR1616] = BRW_SURFACEFORMAT_R16G16_SNORM,
 };
 
 bool
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index c2e2a98..fe8fd34 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -728,8 +728,13 @@ intelInitContext(struct intel_context *intel,
    ctx->TextureFormatSupported[MESA_FORMAT_RG88] = GL_TRUE;
    ctx->TextureFormatSupported[MESA_FORMAT_RG1616] = GL_TRUE;
 
+   /* GL_MESA_texture_signed_rgba / GL_EXT_texture_snorm */
    ctx->TextureFormatSupported[MESA_FORMAT_DUDV8] = GL_TRUE;
    ctx->TextureFormatSupported[MESA_FORMAT_SIGNED_RGBA8888_REV] = GL_TRUE;
+   ctx->TextureFormatSupported[MESA_FORMAT_SIGNED_R8] = GL_TRUE;
+   ctx->TextureFormatSupported[MESA_FORMAT_SIGNED_RG88_REV] = GL_TRUE;
+   ctx->TextureFormatSupported[MESA_FORMAT_SIGNED_R16] = GL_TRUE;
+   ctx->TextureFormatSupported[MESA_FORMAT_SIGNED_GR1616] = GL_TRUE;
 
    /* GL_EXT_texture_sRGB */
    ctx->TextureFormatSupported[MESA_FORMAT_SARGB8] = GL_TRUE;




More information about the mesa-commit mailing list