freedreno/ir3: allow layer/viewport output for VS/GS/DS
authorJonathan Marek <jonathan@marek.ca>
Thu, 9 Jul 2020 18:22:12 +0000 (14:22 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 15 Sep 2020 16:18:45 +0000 (16:18 +0000)
With VK_EXT_shader_viewport_index_layer, these stages can all output the
viewport or layer id, and not just GS anymore.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5832>

src/freedreno/ir3/ir3_compiler_nir.c

index 1438d31..05613a8 100644 (file)
@@ -3140,7 +3140,6 @@ setup_output(struct ir3_context *ctx, nir_intrinsic_instr *intr)
                        so->writes_psize = true;
                        break;
                case VARYING_SLOT_PRIMITIVE_ID:
-               case VARYING_SLOT_LAYER:
                case VARYING_SLOT_GS_VERTEX_FLAGS_IR3:
                        debug_assert(ctx->so->type == MESA_SHADER_GEOMETRY);
                        /* fall through */
@@ -3152,6 +3151,8 @@ setup_output(struct ir3_context *ctx, nir_intrinsic_instr *intr)
                case VARYING_SLOT_CLIP_DIST0:
                case VARYING_SLOT_CLIP_DIST1:
                case VARYING_SLOT_CLIP_VERTEX:
+               case VARYING_SLOT_LAYER:
+               case VARYING_SLOT_VIEWPORT:
                        break;
                default:
                        if (slot >= VARYING_SLOT_VAR0)