tu: Read some input attachments directly

It can happen that the user reads an input attachment as the first use
of that attachment. In that case there are no subpass dependencies
required at all, because there could be a pipeline barrier before the
renderpass instead, and in any case we assume that dependencies with the
first subpass as a destination can be executed only once outside the
renderpass. The result is that we only do a CACHE_INVALIDATE once
before the entire renderpass, but it's actually required after each GMEM
load, because input attachments read GMEM through UCHE and those writes
to GMEM invalidate UCHE.

While we could add the missing CACHE_INVALIDATE "by hand" somehow, it
turns out it's actually just as easy to do an optimization the blob
does, where it simply doesn't patch those input attachments and reads
them directly instead. This means we can skip allocating memory in GMEM
for them entirely in some circumstances.

This fixes e.g.
dEQP-VK.api.copy_and_blit.core.resolve_image.whole_array_image.4_bit
with TU_DEBUG=forcebin.

Part-of: <!12213>
63 jobs for !12213 with review/tu-input-attachment-flush-fix in 18 minutes and 17 seconds (queued for 7 seconds)
latest detached
Status Name Job ID Coverage
  Sanity
passed sanity #12657065

00:00:11

 
  Container
passed debian/arm_build #12657068
aarch64

00:00:16

passed debian/x86_build-base #12657066

00:00:11

passed debian/x86_test-base #12657067

00:00:12

passed fedora/x86_build #12657069

00:00:11

passed windows_build_vs2019 #12657070
windows shell 1809 mesa

00:00:10

 
  Container 2
passed debian/android_build #12657075

00:00:13

passed debian/i386_build #12657072

00:00:12

passed debian/ppc64el_build #12657073

00:00:12

passed debian/s390x_build #12657074

00:00:13

passed debian/x86_build #12657071

00:00:13

passed debian/x86_test-gl #12657076

00:00:13

passed debian/x86_test-vk #12657077

00:00:19

passed kernel+rootfs_amd64 #12657078

00:00:21

passed kernel+rootfs_arm64 #12657079
aarch64

00:01:11

passed kernel+rootfs_armhf #12657080
aarch64

00:00:09

 
  Build X86 64
passed debian-clang #12657087

00:08:32

passed debian-clover #12657088

00:01:54

passed debian-clover-testing #12657083

00:01:17

passed debian-gallium #12657084

00:05:08

passed debian-release #12657085

00:02:52

passed debian-testing #12657081

00:01:28

passed debian-testing-asan #12657082

00:02:11

passed debian-vulkan #12657089

00:01:52

passed fedora-release #12657086

00:02:13

 
  Build Misc
passed debian-android #12657091

00:01:12

passed debian-arm64 #12657093
aarch64

00:01:26

passed debian-arm64-asan #12657094
aarch64

00:02:53

passed debian-arm64-build-test #12657095
aarch64

00:01:22

passed debian-armhf #12657092
aarch64

00:01:50

passed debian/arm_test #12657090

00:00:17

passed debian-i386 #12657096

00:01:28

passed debian-mingw32-x86_64 #12657097

00:02:08

 
  Freedreno
passed a306_gles2 #12657098
google-freedreno-db410c

00:04:46

passed a306_gles3 1/3 #12657099
google-freedreno-db410c

00:08:40

passed a306_gles3 2/3 #12657100
google-freedreno-db410c

00:08:57

passed a306_gles3 3/3 #12657101
google-freedreno-db410c

00:08:54

passed a306_gles3_options #12657102
google-freedreno-db410c

00:03:41

passed a306-traces #12657103
google-freedreno-db410c

00:02:38

passed a530_gles2 #12657104
google-freedreno-db820c

00:05:47

passed a530_gles31 1/2 #12657107
google-freedreno-db820c

00:05:30

passed a530_gles3 1/2 #12657105
google-freedreno-db820c

00:07:49

passed a530_gles31 2/2 #12657108
google-freedreno-db820c

00:06:10

passed a530_gles3 2/2 #12657106
google-freedreno-db820c

00:07:21

passed a530_piglit_shader 1/2 #12657109
google-freedreno-db820c

00:08:14

passed a530_piglit_shader 2/2 #12657110
google-freedreno-db820c

00:09:10

passed a530-traces #12657111
google-freedreno-db820c

00:07:29

passed a630_egl #12657116
google-freedreno-cheza

00:02:11

passed a630_gl #12657115
google-freedreno-cheza

00:01:46

passed a630_gles2 #12657112
google-freedreno-cheza

00:01:33

passed a630_gles3 #12657114
google-freedreno-cheza

00:04:41

passed a630_gles31 #12657113
google-freedreno-cheza

00:09:26

passed a630_gles_others #12657117
google-freedreno-cheza

00:05:40

passed a630_piglit #12657121
google-freedreno-cheza

00:08:28

passed a630-traces #12657122
google-freedreno-cheza

00:03:50

passed a630-traces-performance #12657124
google-freedreno-cheza manual

00:07:15

passed a630-traces-restricted #12657123
google-freedreno-cheza

00:03:50

passed a630_vk 1/2 #12657118
google-freedreno-cheza

00:09:51

passed a630_vk 2/2 #12657119
google-freedreno-cheza

00:09:56

passed a630_vk_sysmem #12657120
google-freedreno-cheza

00:02:13

 
  Software Renderer
passed softpipe-asan-gles31 #12657127

00:01:33

passed softpipe-deqp 1/2 #12657125

00:06:05

passed softpipe-deqp 2/2 #12657126

00:08:08