meta: Use AMD_vertex_shader_layer instead of a GS for layered clears.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 23 Jun 2014 05:27:49 +0000 (22:27 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 30 Jun 2014 07:08:54 +0000 (00:08 -0700)
commit7577cdd8300068bdf1eda426951d7141450283aa
tree545c6133c9922612147d1e431d6daa668e6d2d65
parentf3c5b2f7d08f8a2a41df0a224cd6600ce4260fa1
meta: Use AMD_vertex_shader_layer instead of a GS for layered clears.

On i965, enabling and disabling the GS is not free: you have to do a
full pipeline stall, reconfigure the URB and push constant space, and
emit a bunch of state.  Most clears aren't layered, so the GS isn't
needed in the common case.  But we turned it on universally.

Using AMD_vertex_shader_layer allows us to skip setting up the GS
altogether, while achieving the same effect.

According to Ilia, current nVidia GPUs can't do AMD_vertex_shader_layer.
However, since nouveau is Gallium-based, they're unlikely to ever care
about this path.  Intel and AMD GPUs both support the extension.

Since i965 is the only driver using this path which does layered
rendering, we may as well target it at that.

v2: Improve commit message.  No code changes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/drivers/common/meta.c