st/mesa: add a fallback for clear_with_quad when no vs_layer
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 15 Nov 2014 18:29:25 +0000 (13:29 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Tue, 18 Nov 2014 03:17:49 +0000 (22:17 -0500)
commit68db29c434e144891e5990b032b44495de52f6eb
tree1aeda9293c643f2dc47a3194199b3d877e512866
parent7b8e04b3f0b66bda84cb1ab4f89239f357d9cb64
st/mesa: add a fallback for clear_with_quad when no vs_layer

Not all drivers can set gl_Layer from VS. Add a fallback that passes the
instance id from VS to GS, and then uses the GS to set the layer.

Tested by adding

  quad_buffers |= clear_buffers;
  clear_buffers = 0;

to the st_Clear logic, and forcing set_vertex_shader_layered in all
cases. No piglit regressions (on piglits with 'clear' in the name).

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
src/gallium/auxiliary/util/u_simple_shaders.c
src/gallium/auxiliary/util/u_simple_shaders.h
src/mesa/state_tracker/st_cb_clear.c
src/mesa/state_tracker/st_context.h