From: Gert Wollny Date: Tue, 15 Nov 2022 10:48:24 +0000 (+0100) Subject: r600/sfn: Honor shader key w.r.t. atomic counter layout X-Git-Tag: upstream/23.3.3~16840 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0ccf7ed7916bee67c8028bf251ca483b1be07d57;p=platform%2Fupstream%2Fmesa.git r600/sfn: Honor shader key w.r.t. atomic counter layout Fixes: 79ca456b4837b3bc21cf9ef3c03c505c4b4909f6 r600/sfn: rewrite NIR backend Signed-off-by: Gert Wollny Part-of: --- diff --git a/src/gallium/drivers/r600/sfn/sfn_shader.cpp b/src/gallium/drivers/r600/sfn/sfn_shader.cpp index 1b615dd..1283b31 100644 --- a/src/gallium/drivers/r600/sfn/sfn_shader.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_shader.cpp @@ -171,11 +171,12 @@ ShaderInput::set_uses_interpolate_at_centroid() m_uses_interpolate_at_centroid = true; } -Shader::Shader(const char *type_id): +Shader::Shader(const char *type_id, unsigned atomic_base): m_current_block(nullptr), m_type_id(type_id), m_chip_class(ISA_CC_R600), - m_next_block(0) + m_next_block(0), + m_atomic_base(atomic_base) { m_instr_factory = new InstrFactory(); m_chain_instr.this_shader = this; diff --git a/src/gallium/drivers/r600/sfn/sfn_shader.h b/src/gallium/drivers/r600/sfn/sfn_shader.h index 9d7dfa7..3f38247 100644 --- a/src/gallium/drivers/r600/sfn/sfn_shader.h +++ b/src/gallium/drivers/r600/sfn/sfn_shader.h @@ -264,7 +264,7 @@ protected: std::bitset m_sv_values; - Shader(const char *type_id); + Shader(const char *type_id, unsigned atomic_base); const ShaderInput& input(int base) const; diff --git a/src/gallium/drivers/r600/sfn/sfn_shader_cs.cpp b/src/gallium/drivers/r600/sfn/sfn_shader_cs.cpp index 49ef3dc..b19640d 100644 --- a/src/gallium/drivers/r600/sfn/sfn_shader_cs.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_shader_cs.cpp @@ -31,7 +31,7 @@ namespace r600 { ComputeShader::ComputeShader(UNUSED const r600_shader_key& key): - Shader("CS") + Shader("CS", 0) { } diff --git a/src/gallium/drivers/r600/sfn/sfn_shader_fs.cpp b/src/gallium/drivers/r600/sfn/sfn_shader_fs.cpp index c943b4a..c1f34ca 100644 --- a/src/gallium/drivers/r600/sfn/sfn_shader_fs.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_shader_fs.cpp @@ -40,7 +40,7 @@ namespace r600 { using std::string; FragmentShader::FragmentShader(const r600_shader_key& key): - Shader("FS"), + Shader("FS", key.ps.first_atomic_counter), m_dual_source_blend(key.ps.dual_source_blend), m_max_color_exports(MAX2(key.ps.nr_cbufs, 1)), m_export_highest(0), diff --git a/src/gallium/drivers/r600/sfn/sfn_shader_gs.cpp b/src/gallium/drivers/r600/sfn/sfn_shader_gs.cpp index 8e2f175..5eafdb1 100644 --- a/src/gallium/drivers/r600/sfn/sfn_shader_gs.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_shader_gs.cpp @@ -32,7 +32,7 @@ namespace r600 { GeometryShader::GeometryShader(const r600_shader_key& key): - Shader("GS"), + Shader("GS", key.gs.first_atomic_counter), m_tri_strip_adj_fix(key.gs.tri_strip_adj_fix) { } diff --git a/src/gallium/drivers/r600/sfn/sfn_shader_tess.cpp b/src/gallium/drivers/r600/sfn/sfn_shader_tess.cpp index 9c384da..ccc0797 100644 --- a/src/gallium/drivers/r600/sfn/sfn_shader_tess.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_shader_tess.cpp @@ -36,7 +36,7 @@ namespace r600 { using std::string; TCSShader::TCSShader(const r600_shader_key& key): - Shader("TCS"), + Shader("TCS", key.tcs.first_atomic_counter), m_tcs_prim_mode(key.tcs.prim_mode) { } @@ -177,7 +177,7 @@ TCSShader::do_print_properties(std::ostream& os) const TESShader::TESShader(const pipe_stream_output_info *so_info, const r600_shader *gs_shader, const r600_shader_key& key): - VertexStageShader("TES"), + VertexStageShader("TES", key.tes.first_atomic_counter), m_vs_as_gs_a(key.vs.as_gs_a), m_tes_as_es(key.tes.as_es) { diff --git a/src/gallium/drivers/r600/sfn/sfn_shader_vs.cpp b/src/gallium/drivers/r600/sfn/sfn_shader_vs.cpp index 3c51e37..ae86f99 100644 --- a/src/gallium/drivers/r600/sfn/sfn_shader_vs.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_shader_vs.cpp @@ -414,7 +414,7 @@ VertexExportForFs::output_register(int loc) const VertexShader::VertexShader(const pipe_stream_output_info *so_info, r600_shader *gs_shader, r600_shader_key& key): - VertexStageShader("VS"), + VertexStageShader("VS", key.vs.first_atomic_counter), m_vs_as_gs_a(key.vs.as_gs_a) { if (key.vs.as_es)