radv: only emit ps_input_cntl is we have any to output
authorDave Airlie <airlied@redhat.com>
Tue, 28 Mar 2017 19:09:36 +0000 (20:09 +0100)
committerDave Airlie <airlied@redhat.com>
Tue, 28 Mar 2017 19:12:10 +0000 (20:12 +0100)
Otherwise we get GPU hangs.

Reported-by: Alex Smith <asmith@feralinteractive.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_cmd_buffer.c

index e994df65fd2ce0b442ef05e3494f69838cf650ae..e6f098c208d798b5bf37ca6b2d61f74f75697ee3 100644 (file)
@@ -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