From 4093fdce6d7b8370bfe3ff5119dc0ef0acb32054 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 18 Apr 2011 14:28:14 -0700 Subject: i965: Add support for ARB_texture_compression_rgtc. Tested with rgtc-teximage-0[12]. EXT_texture_compression_rgtc/fbo-generatemipmap-formats fails in NPOT just like S3TC does. Reviewed-by: Brian Paul --- docs/relnotes-7.11.html | 4 ++-- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 4 ++++ src/mesa/drivers/dri/intel/intel_context.c | 6 ++++++ src/mesa/drivers/dri/intel/intel_extensions.c | 1 + 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/relnotes-7.11.html b/docs/relnotes-7.11.html index 2bd126c6bce..d223a0a0de9 100644 --- a/docs/relnotes-7.11.html +++ b/docs/relnotes-7.11.html @@ -42,10 +42,10 @@ tbd
  • GL_ARB_instanced_arrays extension (gallium drivers)
  • GL_ARB_occlusion_query2 (gallium drivers, swrast)
  • GL_ARB_sampler_objects (gallium drivers) -
  • GL_ARB_texture_compression_rgtc (gallium drivers, swrast) +
  • GL_ARB_texture_compression_rgtc (gallium drivers, swrast, i965)
  • GL_ARB_texture_float (gallium, i965)
  • GL_EXT_texture_compression_latc (gallium drivers, swrast) -
  • GL_EXT_texture_compression_rgtc (gallium drivers, swrast) +
  • GL_EXT_texture_compression_rgtc (gallium drivers, swrast, i965)
  • GL_EXT_texture_sRGB_decode (gallium drivers, swrast, i965)
  • GL_EXT_texture_snorm (gallium drivers)
  • GL_ATI_draw_buffers (all drivers) 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 e3396a3cbd4..a03c6523df6 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -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 diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 02e7f7717fc..ec08dd5c8da 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -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; diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index e107534a4da..6a818577a55 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -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 }, -- cgit v1.2.3