gallium/swr: fix corruptions in Unigine Heaven
Few changes to fix the last corruptions in Heaven:
- fix indirect TCS input when vertex/attribute
index is not the same for each patch
- use the correct functions to build loops in shader
- fix using vmask for writting TCS output
Reviewed-by: Krzysztof Raszkowski <krzysztof.raszkowski@intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3980>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3980>