diff options
author | Gert Wollny <[email protected]> | 2020-05-06 23:59:34 +0200 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-05-19 07:52:13 +0000 |
commit | d777c040958f3881d065123b73a7abcf422809a7 (patch) | |
tree | 298d88c68037210e6742ea1e4369ce29743e6539 /src/gallium/drivers/r600 | |
parent | 607d7fb587b4c479d4af3b5e2abd8c588bffce53 (diff) |
r600/sfn: Add support for viewport index output
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Dave Airlie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5085>
Diffstat (limited to 'src/gallium/drivers/r600')
-rw-r--r-- | src/gallium/drivers/r600/sfn/sfn_shader_geometry.cpp | 5 | ||||
-rw-r--r-- | src/gallium/drivers/r600/sfn/sfn_vertexstageexport.cpp | 17 |
2 files changed, 20 insertions, 2 deletions
diff --git a/src/gallium/drivers/r600/sfn/sfn_shader_geometry.cpp b/src/gallium/drivers/r600/sfn/sfn_shader_geometry.cpp index 2edc86ff361..f9993c34120 100644 --- a/src/gallium/drivers/r600/sfn/sfn_shader_geometry.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_shader_geometry.cpp @@ -137,6 +137,11 @@ bool GeometryShaderFromNir::do_process_outputs(nir_variable *output) output->data.location == VARYING_SLOT_CLIP_DIST1) { m_num_clip_dist += 4; } + + if (output->data.location == VARYING_SLOT_VIEWPORT) { + sh_info().vs_out_viewport = 1; + sh_info().vs_out_misc_write = 1; + } return true; } return false; diff --git a/src/gallium/drivers/r600/sfn/sfn_vertexstageexport.cpp b/src/gallium/drivers/r600/sfn/sfn_vertexstageexport.cpp index 3de3418c7a4..f7ce29a1a98 100644 --- a/src/gallium/drivers/r600/sfn/sfn_vertexstageexport.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_vertexstageexport.cpp @@ -81,7 +81,7 @@ bool VertexStageExportBase::do_process_outputs(nir_variable *output) if (output->data.location == VARYING_SLOT_PSIZ || output->data.location == VARYING_SLOT_EDGE || - output->data.location == VARYING_SLOT_LAYER) + output->data.location == VARYING_SLOT_LAYER) // VIEWPORT? m_cur_clip_pos = 2; if (output->data.location != VARYING_SLOT_POS && @@ -110,6 +110,11 @@ bool VertexStageExportForFS::store_deref(const nir_variable *out_var, nir_intrin std::array<uint32_t, 4> swizzle_override = {7 ,0, 7, 7}; return emit_varying_pos(out_var, instr, &swizzle_override); } + case VARYING_SLOT_VIEWPORT: { + std::array<uint32_t, 4> swizzle_override = {7, 7, 7, 0}; + return emit_varying_pos(out_var, instr, &swizzle_override) && + emit_varying_param(out_var, instr); + } case VARYING_SLOT_CLIP_VERTEX: return emit_clip_vertices(out_var, instr); case VARYING_SLOT_CLIP_DIST0: @@ -177,6 +182,11 @@ bool VertexStageExportForFS::emit_varying_pos(const nir_variable *out_var, nir_i case VARYING_SLOT_LAYER: export_slot = 1; break; + case VARYING_SLOT_VIEWPORT: + m_proc.sh_info().vs_out_misc_write = 1; + m_proc.sh_info().vs_out_viewport = 1; + export_slot = 1; + break; case VARYING_SLOT_POS: break; case VARYING_SLOT_CLIP_DIST0: @@ -407,8 +417,11 @@ bool VertexStageExportForGS::store_deref(const nir_variable *out_var, nir_intrin } } - if (out_var->data.location == VARYING_SLOT_VIEWPORT) + if (out_var->data.location == VARYING_SLOT_VIEWPORT) { + m_proc.sh_info().vs_out_viewport = 1; + m_proc.sh_info().vs_out_misc_write = 1; return true; + } if (ring_offset == -1) { sfn_log << SfnLog::err << "VS defines output at " |