intel: Enable ETC2 support on intel hardware
authorAnuj Phogat <anuj.phogat@gmail.com>
Mon, 17 Sep 2012 21:52:10 +0000 (14:52 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Sat, 8 Dec 2012 00:29:49 +0000 (16:29 -0800)
commit4e9d19717c77d24844ff4443efb4a8bdc1736534
treeb7d00183617f2cf4a3e5e015f4f5c464c62be54a
parente06dcbfdc2c90b402cec257fd5e2fc843a7f708f
intel: Enable ETC2 support on intel hardware

This patch enables support for ETC2 compressed textures on
all intel hardware. At present, ETC2 texture decoding is not
available on intel hardware. So, compressed ETC2 texture data
is decoded in software and stored in a suitable uncompressed
MESA_FORMAT at the time of glCompressedTexImage2D. Currently,
ETC2 formats are only exposed in OpenGL ES 3.0.

V2: Use single etc_wraps variable for both etc1 and etc2.
V3: Remove redundant code and use just one intel_miptree_map_etc()
    and intel_miptree_unmap_etc() function.
    Choose MESA_FORMAT_SIGNED_{R16, GR1616} for ETC2 signed-{r11, rg11}
    formats

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/intel/intel_mipmap_tree.c
src/mesa/drivers/dri/intel/intel_mipmap_tree.h