r600/sfn: Fix clip vertex output as possible stream variable
authorGert Wollny <gert.wollny@collabora.com>
Sat, 16 May 2020 14:44:27 +0000 (16:44 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 19 May 2020 07:52:13 +0000 (07:52 +0000)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5085>

src/gallium/drivers/r600/sfn/sfn_vertexstageexport.cpp
src/gallium/drivers/r600/sfn/sfn_vertexstageexport.h

index 097c424a6a082e2defa4f1a280b2a54bed5f9ad5..061097359ba35d682b3e5d0015b2d6e6b9c17cee 100644 (file)
@@ -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);
index 7e2ca620be611ba913dce2368bfbdff4f0088cbd..a48f9d34153e59494a7d2ce1ddcfa3419db09bc5 100644 (file)
@@ -27,6 +27,7 @@ protected:
    std::map<unsigned, unsigned> m_param_map;
    int m_cur_clip_pos;
    int m_cur_param;
+   GPRVector m_clip_vertex;
 };
 
 class VertexStageExportForFS : public VertexStageExportBase