intel: Implement Gen12 workaround for array textures of size 1

Gen12 does not support RENDER_SURFACE_STATE::SurfaceArray = true &&
RENDER_SURFACE_STATE::Depth = 0. SurfaceArray can only be set to true
if Depth >= 1.

We workaround this limitation by adding the max(value, 1) snippet in
the shaders on the 3 components for texture array sizes.

Tested on Gen9 with the following Vulkan CTS tests :
dEQP-VK.image.image_size.2d_array.*

v2: Drop debug print (Tapani)
    Switch to GEN:BUG instead of Wa_

v3: Fix dEQP-VK.image.image_size.1d_array.* cases (Lionel)

v4: Fix dEQP-VK.glsl.texture_functions.query.texturesize.* cases
    (Missing tex_op handling) (Lionel)

v5: Missing break statement (Lionel)

v6: Fixup comment (Tapani)

v7: Fixup comment again (Tapani)

v8: Don't use sample_dim as index (Jason)
    Rename pass
    Simplify control flow

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com> (v7)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Tested-by: Marge Bot <mesa/mesa!3362>
Part-of: <mesa/mesa!3362>
38 jobs for !3362 with review/gen12-workarounds in 14 minutes and 53 seconds (queued for 4 seconds)
detached
Status Job ID Name Coverage
  Container
passed #1466459
aarch64
arm_build

00:00:21

passed #1466460
aarch64
arm_test

00:00:20

passed #1466454
x86_build

00:00:21

passed #1466457
x86_build_old

00:00:20

passed #1466456
x86_test-gl

00:00:23

 
  Build
passed #1466465
aarch64
meson-arm64

00:03:45

passed #1466464
aarch64
meson-armhf

00:02:41

passed #1466466
meson-clang

00:07:05

passed #1466469
meson-clover

00:08:24

passed #1466470
meson-clover-old-llvm

00:08:10

passed #1466472
meson-i386

00:04:27

passed #1466463
meson-main

00:08:46

passed #1466473
meson-mingw32-x86_64

00:04:11

passed #1466462
meson-testing

00:04:53

passed #1466471
meson-vulkan

00:02:55

passed #1466474
scons

00:04:40

passed #1466475
scons-old-llvm

00:04:13

passed #1466467
scons-swr

00:02:53

passed #1466468
scons-win64

00:05:18

 
  Test
passed #1466494
db410c
arm64_a306_gles2

00:06:16

passed #1466491
mesa-cheza
arm64_a630_gles2

00:01:50

passed #1466493
mesa-cheza
arm64_a630_gles3

00:06:36

passed #1466492
mesa-cheza
arm64_a630_gles31

00:04:31

passed #1466479
lava-meson-gxl-s905x-libretech-cc
lima-mali450-test:arm64

00:08:40

passed #1466476
lava-sun50i-h6-pine-h64
panfrost-t720-test:arm64

00:07:59

passed #1466477
lava-rk3288-veyron-jaq
panfrost-t760-test:armhf

00:05:43

passed #1466478
lava-rk3399-gru-kevin
panfrost-t860-test:arm64

00:05:20

passed #1466481
piglit-glslparser

00:04:45

passed #1466480
piglit-quick_gl

00:09:35

passed #1466482
piglit-quick_shader

00:06:13

passed #1466483
test-llvmpipe-gles2

00:03:58

passed #1466484
test-softpipe-gles2

00:01:55

passed #1466487
test-softpipe-gles31 1/4

00:03:12

passed #1466485
test-softpipe-gles3 1/2

00:05:02

passed #1466488
test-softpipe-gles31 2/4

00:04:07

passed #1466489
test-softpipe-gles31 3/4

00:04:59

passed #1466490
test-softpipe-gles31 4/4

00:03:18

passed #1466486
test-softpipe-gles3 2/2

00:03:21