freedreno/ir3: indicate that clipdist arrays are in use
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 20 Nov 2021 08:42:03 +0000 (03:42 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sun, 28 Nov 2021 07:55:58 +0000 (02:55 -0500)
We expose the compact array cap, which means that we get compact
clipdist arrays. Indicate this to the lowering pass so that it works for
gl_ClipDistance from fs, among others.

Fixes, among others, on a420,

tests/spec/glsl-1.30/execution/clipping/fs-clip-distance-interpolated.shader_test

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13891>

src/freedreno/ci/freedreno-a530-fails.txt
src/freedreno/ir3/ir3_nir.c

index 56e4b29..aeff66e 100644 (file)
@@ -478,7 +478,6 @@ spec@nv_copy_image@nv_copy_image-formats,Fail
 spec@nv_copy_image@nv_copy_image-formats@Source: GL_DEPTH32F_STENCIL8/Destination: GL_DEPTH32F_STENCIL8,Fail
 spec@oes_egl_image_external_essl3@oes_egl_image_external_essl3,Crash
 spec@oes_egl_image_external_essl3@oes_egl_image_external_essl3@oes_egl_image_external_essl3_imageLoad,Fail
-spec@glsl-1.30@execution@clipping@fs-clip-distance-interpolated,Crash
 spec@glsl-1.30@execution@fs-large-local-array-vec2,Fail
 spec@glsl-1.30@execution@fs-large-local-array-vec3,Fail
 spec@glsl-1.30@execution@fs-large-local-array-vec4,Fail
index 19e41ac..25eea12 100644 (file)
@@ -668,7 +668,7 @@ ir3_nir_lower_variant(struct ir3_shader_variant *so, nir_shader *s)
    if (s->info.stage == MESA_SHADER_VERTEX) {
       if (so->key.ucp_enables)
          progress |=
-            OPT(s, nir_lower_clip_vs, so->key.ucp_enables, false, false, NULL);
+            OPT(s, nir_lower_clip_vs, so->key.ucp_enables, false, true, NULL);
    } else if (s->info.stage == MESA_SHADER_FRAGMENT) {
       bool layer_zero =
          so->key.layer_zero && (s->info.inputs_read & VARYING_BIT_LAYER);
@@ -676,7 +676,7 @@ ir3_nir_lower_variant(struct ir3_shader_variant *so, nir_shader *s)
          so->key.view_zero && (s->info.inputs_read & VARYING_BIT_VIEWPORT);
 
       if (so->key.ucp_enables && !so->shader->compiler->has_clip_cull)
-         progress |= OPT(s, nir_lower_clip_fs, so->key.ucp_enables, false);
+         progress |= OPT(s, nir_lower_clip_fs, so->key.ucp_enables, true);
       if (layer_zero || view_zero)
          progress |= OPT(s, ir3_nir_lower_view_layer_id, layer_zero, view_zero);
    }