On earlier hardware, we had to implement math in the shader to translate Y-tiled or untiled coordinates to W-tiled coordinates (which is what BLORP does today in order to texture from stencil buffers).
On Broadwell, we can simply state that it's W-tiled in SURFACE_STATE, and adjust the pitch. This is much easier.
In the surface state code, I chose to handle the "should we sample depth or stencil?" question separately from the setup for sampling from stencil. This should make it work with the BindRenderbufferTexImage hook as well, and hopefully be reusable for GL_ARB_texture_stencil8 someday.
v2: Update docs/GL3.txt (caught by Matt).
dfa1ab0 i965: Implement ARB_stencil_texturing on Gen8+.
docs/GL3.txt | 2 +-
src/mesa/drivers/dri/i965/brw_defines.h | 1 +
src/mesa/drivers/dri/i965/brw_surface_formats.c | 2 +-
src/mesa/drivers/dri/i965/gen8_surface_state.c | 17 ++++++++++++++---
src/mesa/drivers/dri/i965/intel_extensions.c | 4 ++++
5 files changed, 21 insertions(+), 5 deletions(-)
Upstream: cgit.freedesktop.org