From 6aa196b673ea741fdc7f4ceda4976b635091d48b Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Sun, 27 Sep 2020 16:40:55 +0200 Subject: [PATCH] r600/sfn: remove old code to track uniforms as it is no longer needed Signed-off-by: Gert Wollny Part-of: --- .../drivers/r600/sfn/sfn_emitinstruction.cpp | 10 ------- .../drivers/r600/sfn/sfn_emitinstruction.h | 2 -- .../drivers/r600/sfn/sfn_shader_base.cpp | 27 ------------------- .../drivers/r600/sfn/sfn_shader_base.h | 2 -- .../drivers/r600/sfn/sfn_valuepool.cpp | 5 ---- src/gallium/drivers/r600/sfn/sfn_valuepool.h | 7 ----- 6 files changed, 53 deletions(-) diff --git a/src/gallium/drivers/r600/sfn/sfn_emitinstruction.cpp b/src/gallium/drivers/r600/sfn/sfn_emitinstruction.cpp index 06bf690e939..37e31c2b5f0 100644 --- a/src/gallium/drivers/r600/sfn/sfn_emitinstruction.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_emitinstruction.cpp @@ -109,16 +109,6 @@ GPRVector EmitInstruction::vec_from_nir_with_fetch_constant(const nir_src& src, return m_proc.vec_from_nir_with_fetch_constant(src, mask, swizzle, match); } -void EmitInstruction::add_uniform(unsigned index, const PValue &value) -{ - m_proc.add_uniform(index, value); -} - -void EmitInstruction::load_uniform(const nir_alu_src& src) -{ - m_proc.load_uniform(src); -} - int EmitInstruction::lookup_register_index(const nir_src& src) const { return m_proc.lookup_register_index(src); diff --git a/src/gallium/drivers/r600/sfn/sfn_emitinstruction.h b/src/gallium/drivers/r600/sfn/sfn_emitinstruction.h index 5cfb9f6ec22..6662f4391a9 100644 --- a/src/gallium/drivers/r600/sfn/sfn_emitinstruction.h +++ b/src/gallium/drivers/r600/sfn/sfn_emitinstruction.h @@ -79,8 +79,6 @@ protected: GPRVector vec_from_nir_with_fetch_constant(const nir_src& src, unsigned mask, const GPRVector::Swizzle& swizzle, bool match = false); - void add_uniform(unsigned index, const PValue &value); - void load_uniform(const nir_alu_src& src); const nir_variable *get_deref_location(const nir_src& v) const; enum chip_class get_chip_class(void) const; diff --git a/src/gallium/drivers/r600/sfn/sfn_shader_base.cpp b/src/gallium/drivers/r600/sfn/sfn_shader_base.cpp index d288b96e09a..c9e95b10438 100644 --- a/src/gallium/drivers/r600/sfn/sfn_shader_base.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_shader_base.cpp @@ -921,9 +921,6 @@ bool ShaderFromNirProcessor::emit_load_ubo_vec4(nir_intrinsic_instr* instr) ir->set_dest_swizzle(swz); emit_instruction(ir); - for (int i = 0; i < instr->num_components ; ++i) { - add_uniform((instr->dest.ssa.index << 2) + i, trgt.reg_i(i)); - } m_sh_info.indirect_files |= 1 << TGSI_FILE_CONSTANT; return true; } @@ -1111,30 +1108,6 @@ bool ShaderFromNirProcessor::emit_deref_instruction(nir_deref_instr* instr) return false; } -void ShaderFromNirProcessor::load_uniform(const nir_alu_src &src) -{ - AluInstruction *ir = nullptr; - PValue sv[4]; - - assert(src.src.is_ssa); - - for (int i = 0; i < src.src.ssa->num_components ; ++i) { - unsigned uindex = (src.src.ssa->index << 2) + i; - sv[i] = uniform(uindex); - assert(sv[i]); - } - - for (int i = 0; i < src.src.ssa->num_components ; ++i) { - ir = new AluInstruction(op1_mov, create_register_from_nir_src(src.src, i), sv[i], - EmitInstruction::write); - emit_instruction(ir); - } - if (ir) - ir->set_flag(alu_last_instr); -} - - - bool ShaderFromNirProcessor::emit_instruction(EAluOp opcode, PValue dest, std::vector srcs, const std::set& m_flags) diff --git a/src/gallium/drivers/r600/sfn/sfn_shader_base.h b/src/gallium/drivers/r600/sfn/sfn_shader_base.h index 50a0b9e8a51..307473baa1a 100644 --- a/src/gallium/drivers/r600/sfn/sfn_shader_base.h +++ b/src/gallium/drivers/r600/sfn/sfn_shader_base.h @@ -74,8 +74,6 @@ public: void emit_instruction(AluInstruction *ir); void split_constants(nir_alu_instr* instr); - void load_uniform(const nir_alu_src& src); - void remap_registers(); const nir_variable *get_deref_location(const nir_src& src) const; diff --git a/src/gallium/drivers/r600/sfn/sfn_valuepool.cpp b/src/gallium/drivers/r600/sfn/sfn_valuepool.cpp index 87b459f5757..bda3c27b186 100644 --- a/src/gallium/drivers/r600/sfn/sfn_valuepool.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_valuepool.cpp @@ -128,11 +128,6 @@ PValue ValuePool::from_nir(const nir_src& v, unsigned component, unsigned swizzl } } - unsigned uindex = (index << 2) + swizzled; - auto u = m_uniforms.find(uindex); - if (u != m_uniforms.end()) - return u->second; - return PValue(); } diff --git a/src/gallium/drivers/r600/sfn/sfn_valuepool.h b/src/gallium/drivers/r600/sfn/sfn_valuepool.h index f6fbfa1388f..11fdf625329 100644 --- a/src/gallium/drivers/r600/sfn/sfn_valuepool.h +++ b/src/gallium/drivers/r600/sfn/sfn_valuepool.h @@ -159,11 +159,6 @@ public: */ bool create_undef(nir_ssa_undef_instr* instr); - - void add_uniform(unsigned index, const PValue &value); - - PValue uniform(unsigned index); - /** Create a new register with the given index and store it in the * lookup map */ @@ -225,8 +220,6 @@ private: std::map m_local_register_map; std::map m_ssa_register_map; - std::map m_uniforms; - std::map m_registers; static PValue m_undef;