tu: do not corrupt unwritten render targets

There is no point in having a write to an attachment enabled when there
is no corresponding output in the shader. Per VK spec it is an UB,
however a few apps depend on attachment not being changed if FS doesn't
have corresponding output.

Fixes water in Genshin Impact.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Part-of: <!10489>
57 jobs for master
Status Name Job ID Coverage
  Container
manual arm_build #9275004
aarch64 manual
manual windows_build_vs2019 #9275005
windows shell 1809 mesa manual
manual x86_build-base #9275002
manual
manual x86_test-base #9275003
manual
 
  Container 2
created android_build #9275010
created i386_build #9275007
created kernel+rootfs_amd64 #9275013
created kernel+rootfs_arm64 #9275014
aarch64
created kernel+rootfs_armhf #9275015
aarch64
created ppc64el_build #9275008
created s390x_build #9275009
created x86_build #9275006
created x86_test-gl #9275011
created x86_test-vk #9275012
 
  Meson X86 64
created meson-clang #9275021
created meson-clover #9275022
created meson-clover-testing #9275018
created meson-gallium #9275019
created meson-release #9275020
created meson-testing #9275016
created meson-testing-asan #9275017
created meson-vulkan #9275023
 
  Build Misc
created arm_test #9275024
created meson-android #9275025
created meson-arm64 #9275027
aarch64
created meson-arm64-asan #9275028
aarch64
created meson-arm64-build-test #9275029
aarch64
created meson-armhf #9275026
aarch64
created meson-i386 #9275030
created meson-mingw32-x86_64 #9275033
created meson-ppc64el #9275032
created meson-s390x #9275031
kvm
 
  Freedreno
created a306_gles2 #9275034
google-freedreno-db410c
created a306_gles3 1/3 #9275035
google-freedreno-db410c
created a306_gles3 2/3 #9275036
google-freedreno-db410c
created a306_gles3 3/3 #9275037
google-freedreno-db410c
created a306_gles3_options #9275038
google-freedreno-db410c
created a306-traces #9275039
google-freedreno-db410c
created a530_gles2 #9275040
google-freedreno-db820c
created a530_gles31 1/2 #9275043
google-freedreno-db820c
created a530_gles3 1/2 #9275041
google-freedreno-db820c
created a530_gles31 2/2 #9275044
google-freedreno-db820c
created a530_gles3 2/2 #9275042
google-freedreno-db820c
created a530_piglit_gl #9275045
google-freedreno-db820c
created a530_piglit_shader #9275046
google-freedreno-db820c
created a530-traces #9275047
google-freedreno-db820c
created a630_egl #9275052
google-freedreno-cheza
created a630_gl #9275051
google-freedreno-cheza
created a630_gles2 #9275048
google-freedreno-cheza
created a630_gles3 #9275050
google-freedreno-cheza
created a630_gles31 #9275049
google-freedreno-cheza
created a630_gles_others #9275053
google-freedreno-cheza
created a630_piglit #9275057
google-freedreno-cheza
created a630-traces #9275058
google-freedreno-cheza
created a630_vk 1/2 #9275054
google-freedreno-cheza
created a630_vk 2/2 #9275055
google-freedreno-cheza
created a630_vk_sysmem #9275056
google-freedreno-cheza