i965: Implement ARB_fragment_layer_viewport.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 17 Jun 2015 20:06:18 +0000 (13:06 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 29 Oct 2015 05:05:08 +0000 (22:05 -0700)
commit8c902a580a490181e7cde29073b11181db4614f8
tree257fb3e408e1e87771759acf57832c3f5572f484
parent5392328a3218c0a69301badefe8fed79ca0d8642
i965: Implement ARB_fragment_layer_viewport.

Normally, we could read gl_Layer from bits 26:16 of R0.0.  However, the
specification requires that bogus out-of-range 32-bit values written by
previous stages need to appear in the fragment shader as-written.

Instead, we pass in the full 32-bit value from the VUE header as an
extra flat-shaded varying.  We have the SF override the value to 0
when the previous stage didn't actually write a value (it's actually
defined to return 0).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs_nir.cpp
src/mesa/drivers/dri/i965/gen6_sf_state.c
src/mesa/drivers/dri/i965/intel_extensions.c