r600/sfn: factor out adding an input in GS
This is a preparation for the next patch that will fix
indirect access using the second index of load_per_vertex_input
Fixes: 37ae4df3e4 ("glsl: remove most IO optimizations that are replaced by nir_opt_varyings")
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36488>
This commit is contained in:
@@ -103,19 +103,26 @@ GeometryShader::process_load_input(nir_intrinsic_instr *instr)
|
||||
(location >= VARYING_SLOT_VAR0 && location <= VARYING_SLOT_VAR31) ||
|
||||
(location >= VARYING_SLOT_TEX0 && location <= VARYING_SLOT_TEX7)) {
|
||||
|
||||
uint64_t bit = 1ull << location;
|
||||
if (!(bit & m_input_mask)) {
|
||||
ShaderInput input(driver_location, location);
|
||||
input.set_ring_offset(16 * driver_location);
|
||||
add_input(input);
|
||||
m_next_input_ring_offset += 16;
|
||||
m_input_mask |= bit;
|
||||
}
|
||||
add_input_at(location, driver_location);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
GeometryShader::add_input_at(gl_varying_slot location, unsigned driver_location)
|
||||
{
|
||||
uint64_t bit = 1ull << location;
|
||||
if (!(bit & m_input_mask)) {
|
||||
ShaderInput input(driver_location, location);
|
||||
input.set_ring_offset(16 * driver_location);
|
||||
add_input(input);
|
||||
m_next_input_ring_offset += 16;
|
||||
m_input_mask |= bit;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
GeometryShader::do_allocate_reserved_registers()
|
||||
{
|
||||
|
||||
@@ -24,6 +24,7 @@ private:
|
||||
|
||||
bool process_store_output(nir_intrinsic_instr *intr);
|
||||
bool process_load_input(nir_intrinsic_instr *intr);
|
||||
void add_input_at(gl_varying_slot location, unsigned driver_location);
|
||||
|
||||
void do_finalize() override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user