i965: Use GL_RED for DEPTH_TEXTURE_MODE in ES 3.0 for unsized formats.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 23 Jan 2013 23:27:39 +0000 (15:27 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 25 Jan 2013 14:04:25 +0000 (09:04 -0500)
commit9db2098d18dd28cbb4f9f98ec9e8f9d579608c38
tree9c5183267a16a1737de8f9c019ca9060f25d6cbd
parent7638ede4ceaa11d0c1209785144b5d7af4696c58
i965: Use GL_RED for DEPTH_TEXTURE_MODE in ES 3.0 for unsized formats.

Khronos has apparently decided that depth textures with sized formats
(allowed with ARB_internalformat_query or ES 3.0) should be treated as
GL_RED, while unsized formats (an existing feature) should be treated
as GL_INTENSITY for compatibility with ES 2.0.

Ian is proposing changes to ARB_internalformat_query which will make
this actually legal and consistent.

A similar problem exists with GL 4.2, but we're going to ignore that
for the time being.

Tested on Ivybridge: no Piglit regressions; fixes 4 es3conform tests:
- depth_texture_fbo
- depth_texture_fbo_clear
- depth_texture_teximage
- depth_texture_texsubimage

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/brw_state.h
src/mesa/drivers/dri/i965/brw_wm.c
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/i965/gen7_wm_surface_state.c