summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_shader_info.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2019-09-03 18:09:00 +0200
committerSamuel Pitoiset <[email protected]>2019-09-06 15:52:19 +0200
commit1877e87f1ebe05065b582d7059fb4e76e17c9e67 (patch)
treea4b0a0d9b78b71cc8532366af0fbdb2e48cc1ae1 /src/amd/vulkan/radv_shader_info.c
parent84b346eda9c7f2de3256c7fc20a90958cd0b59ca (diff)
radv: gather layer in the shader info pass
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_shader_info.c')
-rw-r--r--src/amd/vulkan/radv_shader_info.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_shader_info.c b/src/amd/vulkan/radv_shader_info.c
index 614a20d5921..ce9823f8485 100644
--- a/src/amd/vulkan/radv_shader_info.c
+++ b/src/amd/vulkan/radv_shader_info.c
@@ -574,6 +574,9 @@ gather_info_output_decl(const nir_shader *nir, const nir_variable *var,
case VARYING_SLOT_VIEWPORT:
vs_info->writes_viewport_index = true;
break;
+ case VARYING_SLOT_LAYER:
+ vs_info->writes_layer = true;
+ break;
default:
break;
}
@@ -667,6 +670,23 @@ radv_nir_shader_info_pass(const struct nir_shader *nir,
}
}
+ /* Make sure to export the LayerID if the subpass has multiviews. */
+ if (options->key.has_multiview_view_index) {
+ switch (nir->info.stage) {
+ case MESA_SHADER_VERTEX:
+ info->vs.outinfo.writes_layer = true;
+ break;
+ case MESA_SHADER_TESS_EVAL:
+ info->tes.outinfo.writes_layer = true;
+ break;
+ case MESA_SHADER_GEOMETRY:
+ info->vs.outinfo.writes_layer = true;
+ break;
+ default:
+ break;
+ }
+ }
+
if (nir->info.stage == MESA_SHADER_FRAGMENT)
info->ps.num_interp = nir->num_inputs;