radv: gather viewport in the shader info pass
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 3 Sep 2019 16:05:25 +0000 (18:05 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 6 Sep 2019 13:52:17 +0000 (15:52 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_nir_to_llvm.c
src/amd/vulkan/radv_shader_info.c

index 1719ee389e350c4fa7b5f7ec26b83ff18102d890..e2d3447879f9eb8f0b9511fe57e08923ede0cd4d 100644 (file)
@@ -2792,10 +2792,6 @@ handle_vs_outputs_post(struct radv_shader_context *ctx,
                outinfo->writes_layer = true;
        }
 
-       if (ctx->output_mask & (1ull << VARYING_SLOT_VIEWPORT)) {
-               outinfo->writes_viewport_index = true;
-       }
-
        if (ctx->shader_info->so.num_outputs &&
            !ctx->is_gs_copy_shader) {
                /* The GS copy shader emission already emits streamout. */
@@ -3514,10 +3510,6 @@ static void gfx10_ngg_gs_emit_epilogue_2(struct radv_shader_context *ctx)
                        outinfo->writes_layer = true;
                }
 
-               if (ctx->output_mask & (1ull << VARYING_SLOT_VIEWPORT)) {
-                       outinfo->writes_viewport_index = true;
-               }
-
                unsigned out_idx = 0;
                gep_idx[1] = ctx->ac.i32_0;
                for (unsigned i = 0; i < AC_LLVM_MAX_OUTPUTS; ++i) {
index 43c70e74fad6a459d45968b504ed5dd5b2a1a559..614a20d5921f3fe97c738dbb85f1f57b3a6a238c 100644 (file)
@@ -571,6 +571,9 @@ gather_info_output_decl(const nir_shader *nir, const nir_variable *var,
                case VARYING_SLOT_PSIZ:
                        vs_info->writes_pointsize = true;
                        break;
+               case VARYING_SLOT_VIEWPORT:
+                       vs_info->writes_viewport_index = true;
+                       break;
                default:
                        break;
                }