zink: implement passthrough tcs shader injection
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Sun, 19 Jul 2020 13:12:40 +0000 (09:12 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 22 Dec 2020 13:46:38 +0000 (13:46 +0000)
commit334759d8509b1ca3009edd0ad9b7caad3e12456e
tree8d7d48de6783301ed369aa93e342aa3194cec5a3
parent938b7c480e7b5c6d083c0c564cbcc767fa4b77cb
zink: implement passthrough tcs shader injection

GL allows the pipeline to "infer" a tcs shader if a tes shader is bound using
API-specified default values for gl_TessLevelOuter and gl_TessLevelInner,
but VK requires that both shaders be explicitly present

to handle this, create a generic tcs which translates all vs outputs to
invocation-based arrays and copy the appropriate value to the expected tes
input array location. also emit the default inner/outer values as push constants
so we don't have to recompile the shaders whenever the api calls occur

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8152>
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
src/gallium/drivers/zink/zink_compiler.c
src/gallium/drivers/zink/zink_compiler.h
src/gallium/drivers/zink/zink_context.h
src/gallium/drivers/zink/zink_draw.c
src/gallium/drivers/zink/zink_program.c
src/gallium/drivers/zink/zink_shader_keys.h