Module: Mesa
Branch: master
Commit: 32791a05024d54736eab21379e849480fea78559
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=32791a05024d54736eab21379e849480fea78559

Author: Dave Airlie <[email protected]>
Date:   Mon Mar 19 20:02:58 2018 +0000

radv: don't export NULL layer.

We have some cases where in subpass we want the layer but having
it be 0 and loaded in the frag shader without the vertex shader
exporting it is fine.

So don't export the layer if we don't have a value to put in it.

Fixes: d4c74aed7a8 (radv/multiview: mark layer_input if we have input 
attachments.)
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>

---

 src/amd/vulkan/radv_nir_to_llvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_nir_to_llvm.c 
b/src/amd/vulkan/radv_nir_to_llvm.c
index 7379f348d8..ad046adfdb 100644
--- a/src/amd/vulkan/radv_nir_to_llvm.c
+++ b/src/amd/vulkan/radv_nir_to_llvm.c
@@ -2363,7 +2363,7 @@ handle_vs_outputs_post(struct radv_shader_context *ctx,
                outinfo->export_prim_id = true;
        }
 
-       if (export_layer_id) {
+       if (export_layer_id && layer_value) {
                LLVMValueRef values[4];
 
                values[0] = layer_value;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to