[Mesa-dev] [PATCH 04/11] radv: Use 0 for the layer id if the vertex shader does not export it.

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Wed Aug 23 20:51:46 UTC 2017


To use when we have e.g. input attachments, but there is no layer
export in the previous shader and hence no layered rendering.
---
 src/amd/vulkan/radv_pipeline.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index bd5eeb776c4..5d94acc1519 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -1995,10 +1995,11 @@ static void calculate_ps_inputs(struct radv_pipeline *pipeline)
 
 	if (ps->info.fs.layer_input) {
 		unsigned vs_offset = outinfo->vs_output_param_offset[VARYING_SLOT_LAYER];
-		if (vs_offset != AC_EXP_PARAM_UNDEFINED) {
+		if (vs_offset != AC_EXP_PARAM_UNDEFINED)
 			pipeline->graphics.ps_input_cntl[ps_offset] = offset_to_ps_input(vs_offset, true);
-			++ps_offset;
-		}
+		else
+			pipeline->graphics.ps_input_cntl[ps_offset] = offset_to_ps_input(AC_EXP_PARAM_DEFAULT_VAL_0000, true);
+		++ps_offset;
 	}
 
 	if (ps->info.fs.has_pcoord) {
-- 
2.14.1



More information about the mesa-dev mailing list