i965: Implement gl_PatchVerticesIn by baking it into brw_tcs_prog_key.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 26 Nov 2015 07:35:29 +0000 (23:35 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 22 Dec 2015 10:12:05 +0000 (02:12 -0800)
commit57f7c85dcf8ca8b47b71076fb70d9242aec00588
tree2e00baac21ab8570a77a1f1abe7865c56433d68a
parent24be658d13b13fdb8a1977208038b4ba43bce4ac
i965: Implement gl_PatchVerticesIn by baking it into brw_tcs_prog_key.

The hardware provides us no decent way of getting at the number of input
vertices in the patch topology from the tessellation control shader.
It's actually very surprising - normally this sort of information would
be available in the thread payload.

For the precompile, we guess that the number of vertices will be the
same for both the input and output patches.  This usually seems to be
the case.

On Gen8+, we could pass in an extra push constant containing this value.
We may be able to do that on Haswell too.  It's quite a bit trickier on
Ivybridge, however.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/drivers/dri/i965/brw_compiler.h
src/mesa/drivers/dri/i965/brw_tcs.c
src/mesa/drivers/dri/i965/brw_vec4_tcs.cpp