From 723ae8177e88a8a129b664371da46c0c9d004866 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Sat, 16 May 2020 16:44:27 +0200 Subject: [PATCH] r600/sfn: Fix clip vertex output as possible stream variable Signed-off-by: Gert Wollny Reviewed-by: Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/r600/sfn/sfn_vertexstageexport.cpp | 5 +++-- src/gallium/drivers/r600/sfn/sfn_vertexstageexport.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/r600/sfn/sfn_vertexstageexport.cpp b/src/gallium/drivers/r600/sfn/sfn_vertexstageexport.cpp index 097c424a6a0..061097359ba 100644 --- a/src/gallium/drivers/r600/sfn/sfn_vertexstageexport.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_vertexstageexport.cpp @@ -234,7 +234,8 @@ bool VertexStageExportForFS::emit_clip_vertices(const nir_variable *out_var, nir m_proc.sh_info().cc_dist_mask = 0xff; m_proc.sh_info().clip_dist_write = 0xff; - GPRVector clip_vertex = m_proc.vec_from_nir_with_fetch_constant(instr->src[1], 0xf, {0,1,2,3}); + m_clip_vertex = m_proc.vec_from_nir_with_fetch_constant(instr->src[1], 0xf, {0,1,2,3}); + m_proc.add_param_output_reg(out_var->data.driver_location, &m_clip_vertex); for (int i = 0; i < 4; ++i) m_proc.sh_info().output[out_var->data.driver_location].write_mask |= 1 << i; @@ -246,7 +247,7 @@ bool VertexStageExportForFS::emit_clip_vertices(const nir_variable *out_var, nir int ochan = i & 3; AluInstruction *ir = nullptr; for (int j = 0; j < 4; j++) { - ir = new AluInstruction(op2_dot4_ieee, clip_dist[oreg].reg_i(j), clip_vertex.reg_i(j), + ir = new AluInstruction(op2_dot4_ieee, clip_dist[oreg].reg_i(j), m_clip_vertex.reg_i(j), PValue(new UniformValue(512 + i, j, R600_BUFFER_INFO_CONST_BUFFER)), (j == ochan) ? EmitInstruction::write : EmitInstruction::empty); m_proc.emit_instruction(ir); diff --git a/src/gallium/drivers/r600/sfn/sfn_vertexstageexport.h b/src/gallium/drivers/r600/sfn/sfn_vertexstageexport.h index 7e2ca620be6..a48f9d34153 100644 --- a/src/gallium/drivers/r600/sfn/sfn_vertexstageexport.h +++ b/src/gallium/drivers/r600/sfn/sfn_vertexstageexport.h @@ -27,6 +27,7 @@ protected: std::map m_param_map; int m_cur_clip_pos; int m_cur_param; + GPRVector m_clip_vertex; }; class VertexStageExportForFS : public VertexStageExportBase -- 2.30.2