summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2019-09-03 18:05:25 +0200
committerSamuel Pitoiset <[email protected]>2019-09-06 15:52:17 +0200
commit84b346eda9c7f2de3256c7fc20a90958cd0b59ca (patch)
tree767f3d96632962fdcea9e5daa3e8d11490c3fb59
parentd21489d415150b93b0ba07aea06dc21ac40fbe9a (diff)
radv: gather viewport in the shader info pass
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
-rw-r--r--src/amd/vulkan/radv_nir_to_llvm.c8
-rw-r--r--src/amd/vulkan/radv_shader_info.c3
2 files changed, 3 insertions, 8 deletions
diff --git a/src/amd/vulkan/radv_nir_to_llvm.c b/src/amd/vulkan/radv_nir_to_llvm.c
index 1719ee389e3..e2d3447879f 100644
--- a/src/amd/vulkan/radv_nir_to_llvm.c
+++ b/src/amd/vulkan/radv_nir_to_llvm.c
@@ -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) {
diff --git a/src/amd/vulkan/radv_shader_info.c b/src/amd/vulkan/radv_shader_info.c
index 43c70e74fad..614a20d5921 100644
--- a/src/amd/vulkan/radv_shader_info.c
+++ b/src/amd/vulkan/radv_shader_info.c
@@ -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;
}