intel: Use common helpers for TCS passthrough shaders
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 20 Jan 2023 07:25:20 +0000 (23:25 -0800)
committerMarge Bot <emma+marge@anholt.net>
Mon, 20 Feb 2023 03:54:24 +0000 (03:54 +0000)
commit96ba0344db8f67acf66b81c3f6cfd6539e2e071a
tree6f27d537084b7774a341db2b256d759086b9eacb
parent3a9edfc4943d28894b0a39b6ee3350e57a979d79
intel: Use common helpers for TCS passthrough shaders

Rob added these new helpers a while back, which freedreno and radeonsi
both share.  We should use them too.  The new helpers use variables and
system value intrinsics, so we can drop the explicit binding table
creation and just use the normal paths.

Because we have to rewrite the system value uploading anyway, we drop
the scrambling of the default tessellation levels on upload, and instead
let the compiler go ahead and remap components like any normal shader.
In theory, this results in more shuffling in the shader.  In practice,
we already do MOVs for message setup.  In the passthrough shaders I
looked at, this resulted in no extra instructions on Icelake (SIMD8
SINGLE_PATCH) and Tigerlake (8_PATCH).  On Haswell, one shader grew by
a single instruction for a pittance of cycles in a stage that isn't a
performance bottleneck anyway.  Avoiding remapping wasn't so much of an
optimization as just the way that I originally wrote it.  Not worth it.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20809>
src/gallium/drivers/crocus/crocus_program.c
src/gallium/drivers/iris/iris_program.c
src/intel/compiler/brw_nir.c