mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 06:20:09 +01:00
r600/sfn: Make allocate_reserved_registers forward to a virtual function
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>
This commit is contained in:
parent
041df79496
commit
9db5536643
14 changed files with 21 additions and 13 deletions
|
|
@ -102,6 +102,12 @@ enum chip_class ShaderFromNirProcessor::get_chip_class(void) const
|
|||
return m_chip_class;
|
||||
}
|
||||
|
||||
bool ShaderFromNirProcessor::allocate_reserved_registers()
|
||||
{
|
||||
bool retval = do_allocate_reserved_registers();
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void remap_shader_info(r600_shader& sh_info,
|
||||
std::vector<rename_reg_pair>& map,
|
||||
UNUSED ValueMap& values)
|
||||
|
|
|
|||
|
|
@ -130,8 +130,10 @@ protected:
|
|||
|
||||
std::bitset<es_last> m_sv_values;
|
||||
|
||||
bool allocate_reserved_registers();
|
||||
|
||||
private:
|
||||
virtual bool allocate_reserved_registers() = 0;
|
||||
virtual bool do_allocate_reserved_registers() = 0;
|
||||
|
||||
bool emit_alu_instruction(nir_instr *instr);
|
||||
bool emit_deref_instruction(nir_deref_instr* instr);
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ bool ComputeShaderFromNir::scan_sysvalue_access(UNUSED nir_instr *instr)
|
|||
{
|
||||
return true;
|
||||
}
|
||||
bool ComputeShaderFromNir::allocate_reserved_registers()
|
||||
bool ComputeShaderFromNir::do_allocate_reserved_registers()
|
||||
{
|
||||
int thread_id_sel = m_reserved_registers++;
|
||||
int wg_id_sel = m_reserved_registers++;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public:
|
|||
private:
|
||||
bool emit_intrinsic_instruction_override(nir_intrinsic_instr* instr) override;
|
||||
|
||||
bool allocate_reserved_registers() override;
|
||||
bool do_allocate_reserved_registers() override;
|
||||
bool do_process_inputs(nir_variable *input) override;
|
||||
bool do_process_outputs(nir_variable *output) override;
|
||||
bool do_emit_load_deref(const nir_variable *in_var, nir_intrinsic_instr* instr) override;
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ bool FragmentShaderFromNir::scan_sysvalue_access(nir_instr *instr)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool FragmentShaderFromNir::allocate_reserved_registers()
|
||||
bool FragmentShaderFromNir::do_allocate_reserved_registers()
|
||||
{
|
||||
assert(!m_reserved_registers);
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ private:
|
|||
|
||||
void emit_shader_start() override;
|
||||
bool do_process_inputs(nir_variable *input) override;
|
||||
bool allocate_reserved_registers() override;
|
||||
bool do_allocate_reserved_registers() override;
|
||||
bool do_process_outputs(nir_variable *output) override;
|
||||
bool do_emit_load_deref(const nir_variable *in_var, nir_intrinsic_instr* instr) override;
|
||||
bool do_emit_store_deref(const nir_variable *out_var, nir_intrinsic_instr* instr) override;
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ bool GeometryShaderFromNir::do_process_outputs(nir_variable *output)
|
|||
}
|
||||
|
||||
|
||||
bool GeometryShaderFromNir::allocate_reserved_registers()
|
||||
bool GeometryShaderFromNir::do_allocate_reserved_registers()
|
||||
{
|
||||
const int sel[6] = {0, 0 ,0, 1, 1, 1};
|
||||
const int chan[6] = {0, 1 ,3, 0, 1, 2};
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ private:
|
|||
};
|
||||
|
||||
bool do_process_inputs(nir_variable *input) override;
|
||||
bool allocate_reserved_registers() override;
|
||||
bool do_allocate_reserved_registers() override;
|
||||
bool do_process_outputs(nir_variable *output) override;
|
||||
bool emit_deref_instruction_override(nir_deref_instr* instr) override;
|
||||
bool emit_intrinsic_instruction_override(nir_intrinsic_instr* instr) override;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ bool TcsShaderFromNir::do_process_outputs(nir_variable *output)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool TcsShaderFromNir::allocate_reserved_registers()
|
||||
bool TcsShaderFromNir::do_allocate_reserved_registers()
|
||||
{
|
||||
if (m_sv_values.test(es_primitive_id)) {
|
||||
m_reserved_registers = 1;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ public:
|
|||
bool scan_sysvalue_access(nir_instr *instr) override;
|
||||
|
||||
private:
|
||||
bool allocate_reserved_registers() override;
|
||||
bool do_allocate_reserved_registers() override;
|
||||
bool emit_intrinsic_instruction_override(nir_intrinsic_instr* instr) override;
|
||||
bool store_tess_factor(nir_intrinsic_instr* instr);
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ bool TEvalShaderFromNir::scan_sysvalue_access(nir_instr *instr)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool TEvalShaderFromNir::allocate_reserved_registers()
|
||||
bool TEvalShaderFromNir::do_allocate_reserved_registers()
|
||||
{
|
||||
if (m_sv_values.test(es_tess_coord)) {
|
||||
m_reserved_registers = 1;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public:
|
|||
bool scan_sysvalue_access(nir_instr *instr) override;
|
||||
PValue primitive_id() override {return m_primitive_id;}
|
||||
private:
|
||||
bool allocate_reserved_registers() override;
|
||||
bool do_allocate_reserved_registers() override;
|
||||
bool emit_intrinsic_instruction_override(nir_intrinsic_instr* instr) override;
|
||||
bool emit_load_tess_coord(nir_intrinsic_instr* instr);
|
||||
bool load_tess_z_coord(nir_intrinsic_instr* instr);
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ bool VertexShaderFromNir::do_process_inputs(nir_variable *input)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool VertexShaderFromNir::allocate_reserved_registers()
|
||||
bool VertexShaderFromNir::do_allocate_reserved_registers()
|
||||
{
|
||||
/* Since the vertex ID is nearly always used, we add it here as an input so
|
||||
* that the registers used for vertex attributes don't get clobbered by the
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ private:
|
|||
|
||||
void emit_shader_start() override;
|
||||
bool do_process_inputs(nir_variable *input) override;
|
||||
bool allocate_reserved_registers() override;
|
||||
bool do_allocate_reserved_registers() override;
|
||||
bool do_process_outputs(nir_variable *output) override;
|
||||
bool emit_intrinsic_instruction_override(nir_intrinsic_instr* instr) override;
|
||||
bool emit_store_local_shared(nir_intrinsic_instr* instr);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue