i965: Add support for ARB_texture_compression_rgtc.
authorEric Anholt <eric@anholt.net>
Mon, 18 Apr 2011 21:28:14 +0000 (14:28 -0700)
committerEric Anholt <eric@anholt.net>
Sat, 23 Apr 2011 20:14:56 +0000 (13:14 -0700)
Tested with rgtc-teximage-0[12].
EXT_texture_compression_rgtc/fbo-generatemipmap-formats fails in NPOT
just like S3TC does.

Reviewed-by: Brian Paul <brianp@vmware.com>
docs/relnotes-7.11.html
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/intel/intel_context.c
src/mesa/drivers/dri/intel/intel_extensions.c

index 2bd126c6bce68ab950e515085b2f13d662043118..d223a0a0de976a4f7bd7b378995051213796d186 100644 (file)
@@ -42,10 +42,10 @@ tbd
 <li>GL_ARB_instanced_arrays extension (gallium drivers)
 <li>GL_ARB_occlusion_query2 (gallium drivers, swrast)
 <li>GL_ARB_sampler_objects (gallium drivers)
-<li>GL_ARB_texture_compression_rgtc (gallium drivers, swrast)
+<li>GL_ARB_texture_compression_rgtc (gallium drivers, swrast, i965)
 <li>GL_ARB_texture_float (gallium, i965)
 <li>GL_EXT_texture_compression_latc (gallium drivers, swrast)
-<li>GL_EXT_texture_compression_rgtc (gallium drivers, swrast)
+<li>GL_EXT_texture_compression_rgtc (gallium drivers, swrast, i965)
 <li>GL_EXT_texture_sRGB_decode (gallium drivers, swrast, i965)
 <li>GL_EXT_texture_snorm (gallium drivers)
 <li>GL_ATI_draw_buffers (all drivers)
index e3396a3cbd45cc5885bcb973a5861331f428ca0d..a03c6523df6a737a46455e3b83c9354823ff0a96 100644 (file)
@@ -112,6 +112,10 @@ static uint32_t brw_format_for_mesa_format[MESA_FORMAT_COUNT] =
    [MESA_FORMAT_LUMINANCE_FLOAT32] = BRW_SURFACEFORMAT_L32_FLOAT,
    [MESA_FORMAT_ALPHA_FLOAT32] = BRW_SURFACEFORMAT_A32_FLOAT,
    [MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32] = BRW_SURFACEFORMAT_L32A32_FLOAT,
+   [MESA_FORMAT_RED_RGTC1] = BRW_SURFACEFORMAT_BC4_UNORM,
+   [MESA_FORMAT_SIGNED_RED_RGTC1] = BRW_SURFACEFORMAT_BC4_SNORM,
+   [MESA_FORMAT_RG_RGTC2] = BRW_SURFACEFORMAT_BC5_UNORM,
+   [MESA_FORMAT_SIGNED_RG_RGTC2] = BRW_SURFACEFORMAT_BC5_SNORM,
 };
 
 bool
index 02e7f7717fcae359a311691ffc588dc650ea4bef..ec08dd5c8da28be7960befda011254761c9a5a87 100644 (file)
@@ -718,6 +718,12 @@ intelInitContext(struct intel_context *intel,
    ctx->TextureFormatSupported[MESA_FORMAT_RGBA_DXT5] = GL_TRUE;
 
 #ifndef I915
+   /* GL_ARB_texture_compression_rgtc */
+   ctx->TextureFormatSupported[MESA_FORMAT_RED_RGTC1] = GL_TRUE;
+   ctx->TextureFormatSupported[MESA_FORMAT_SIGNED_RED_RGTC1] = GL_TRUE;
+   ctx->TextureFormatSupported[MESA_FORMAT_RG_RGTC2] = GL_TRUE;
+   ctx->TextureFormatSupported[MESA_FORMAT_SIGNED_RG_RGTC2] = GL_TRUE;
+
    /* GL_ARB_texture_rg */
    ctx->TextureFormatSupported[MESA_FORMAT_R8] = GL_TRUE;
    ctx->TextureFormatSupported[MESA_FORMAT_R16] = GL_TRUE;
index e107534a4dae3b7eb54bd838e0fa4685e66afd39..6a818577a556dc5a736c0888e59302e180f7e3c4 100644 (file)
@@ -176,6 +176,7 @@ static const struct dri_extension brw_extensions[] = {
    { "GL_ARB_texture_float",              NULL },
 #endif
    { "GL_MESA_texture_signed_rgba",       NULL },
+   { "GL_ARB_texture_compression_rgtc",   NULL },
    { "GL_ARB_texture_non_power_of_two",   NULL },
    { "GL_ARB_texture_rg",                 NULL },
    { "GL_EXT_draw_buffers2",              GL_EXT_draw_buffers2_functions },