i965: Add the missing supportable EXT_texture_snorm formats
authorIan Romanick <ian.d.romanick@intel.com>
Sun, 3 Apr 2011 01:49:13 +0000 (18:49 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 4 Apr 2011 21:32:01 +0000 (14:32 -0700)
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@whitecape.org>
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/intel/intel_context.c

index 1010d9f6f9c23781ef374554e00eee3d07d4a5d0..aeda4d5ce4e493725c9e8a20e8387a7e151a9df8 100644 (file)
@@ -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
index c2e2a98af5e26db8e6b7df4bf06725271293f706..fe8fd349be77bcf5db2bba7d9a67be0fa4bbaa18 100644 (file)
@@ -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;