freedreno/ir3: fix/rework tess levels
authorJonathan Marek <jonathan@marek.ca>
Fri, 3 Jul 2020 15:34:47 +0000 (11:34 -0400)
committerJonathan Marek <jonathan@marek.ca>
Mon, 6 Jul 2020 12:48:06 +0000 (08:48 -0400)
commitb76c6dcbc55d6d2bfdb92950ec5af00430aef943
tree7f1790d2f489f89e70a9424af876c7203da800d9
parent3c5512ce5098eab788158fbb6fc6c04a47727ce7
freedreno/ir3: fix/rework tess levels

The previous version assumes tess level outputs will only be written once
in the shader, however its not possible to guarantee that.

It also assumes all invocations will write all the levels, which is also
not guaranteed.

This is required to fix the "tesselation" and "terraintessellation" demos
with turnip.

The comment about nir_lower_io_to_temporaries in lower_tess_ctrl_block is
removed because nir_lower_io_to_temporaries specifically skips TESS_CTRL
shaders so the comment doesn't make sense.

The split load for tess levels workaround is removed, the new version only
has scalar access unless if ever gets vectorized.

This sets NIR_COMPACT_ARRAYS cap to avoid the glsl tess vec lowering with
gallium. It seems this will also disable "LowerCombinedClipCullDistance",
which I'm not sure was needed or not.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5744>
src/freedreno/ir3/ir3_nir_lower_tess.c
src/freedreno/vulkan/tu_shader.c
src/gallium/drivers/freedreno/freedreno_screen.c