From 74e0a0a72398140a72c2f4a092982d5bef32ad14 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Wed, 15 Apr 2020 16:48:00 +0200 Subject: [PATCH] r600/sfn: Handle LDS output in VS Signed-off-by: Gert Wollny Part-of: --- src/gallium/drivers/r600/sfn/sfn_shader_base.h | 10 +++++++++- src/gallium/drivers/r600/sfn/sfn_shader_vertex.cpp | 8 ++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/r600/sfn/sfn_shader_base.h b/src/gallium/drivers/r600/sfn/sfn_shader_base.h index 70062db6258..44376471819 100644 --- a/src/gallium/drivers/r600/sfn/sfn_shader_base.h +++ b/src/gallium/drivers/r600/sfn/sfn_shader_base.h @@ -110,17 +110,25 @@ protected: bool as_last = true); void inc_atomic_file_count(); - std::bitset<8> m_sv_values; enum ESlots { es_face, es_instanceid, + es_invocation_id, + es_patch_id, es_pos, + es_rel_patch_id, es_sample_mask_in, es_sample_id, + es_tess_factor_base, es_vertexid, + es_tess_coord, + es_primitive_id, + es_last }; + std::bitset m_sv_values; + private: virtual bool allocate_reserved_registers() = 0; diff --git a/src/gallium/drivers/r600/sfn/sfn_shader_vertex.cpp b/src/gallium/drivers/r600/sfn/sfn_shader_vertex.cpp index ba8a583d780..8337553aec2 100644 --- a/src/gallium/drivers/r600/sfn/sfn_shader_vertex.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_shader_vertex.cpp @@ -28,6 +28,7 @@ #include "pipe/p_defines.h" #include "tgsi/tgsi_from_mesa.h" #include "sfn_shader_vertex.h" +#include "sfn_instruction_lds.h" #include @@ -133,6 +134,9 @@ bool VertexShaderFromNir::scan_sysvalue_access(nir_instr *instr) case nir_intrinsic_load_instance_id: m_sv_values.set(es_instanceid); break; + case nir_intrinsic_load_tcs_rel_patch_id_r600: + m_sv_values.set(es_rel_patch_id); + break; default: ; } @@ -148,8 +152,12 @@ bool VertexShaderFromNir::emit_intrinsic_instruction_override(nir_intrinsic_inst switch (instr->intrinsic) { case nir_intrinsic_load_vertex_id: return load_preloaded_value(instr->dest, 0, m_vertex_id); + case nir_intrinsic_load_tcs_rel_patch_id_r600: + return load_preloaded_value(instr->dest, 0, m_rel_vertex_id); case nir_intrinsic_load_instance_id: return load_preloaded_value(instr->dest, 0, m_instance_id); + case nir_intrinsic_store_local_shared_r600: + return emit_store_local_shared(instr); default: return false; } -- 2.30.2