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

Author: Dave Airlie <airl...@redhat.com>
Date:   Tue Mar 28 20:09:36 2017 +0100

radv: only emit ps_input_cntl is we have any to output

Otherwise we get GPU hangs.

Reported-by: Alex Smith <asm...@feralinteractive.com>
Signed-off-by: Dave Airlie <airl...@redhat.com>

---

 src/amd/vulkan/radv_cmd_buffer.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index e994df65fd..e6f098c208 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -697,9 +697,12 @@ radv_emit_fragment_shader(struct radv_cmd_buffer 
*cmd_buffer,
        radeon_set_context_reg(cmd_buffer->cs, R_028238_CB_TARGET_MASK, 
blend->cb_target_mask);
        radeon_set_context_reg(cmd_buffer->cs, R_02823C_CB_SHADER_MASK, 
blend->cb_shader_mask);
 
-       radeon_set_context_reg_seq(cmd_buffer->cs, 
R_028644_SPI_PS_INPUT_CNTL_0, pipeline->graphics.ps_input_cntl_num);
-       for (unsigned i = 0; i < pipeline->graphics.ps_input_cntl_num; i++)
-               radeon_emit(cmd_buffer->cs, 
pipeline->graphics.ps_input_cntl[i]);
+       if (pipeline->graphics.ps_input_cntl_num) {
+               radeon_set_context_reg_seq(cmd_buffer->cs, 
R_028644_SPI_PS_INPUT_CNTL_0, pipeline->graphics.ps_input_cntl_num);
+               for (unsigned i = 0; i < pipeline->graphics.ps_input_cntl_num; 
i++) {
+                       radeon_emit(cmd_buffer->cs, 
pipeline->graphics.ps_input_cntl[i]);
+               }
+       }
 }
 
 static void

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to