ShaderFromNirProcessor::ShaderFromNirProcessor(pipe_shader_type ptype,
r600_pipe_shader_selector& sel,
r600_shader &sh_info, int scratch_size,
- enum chip_class chip_class):
+ enum chip_class chip_class,
+ int atomic_base):
m_processor_type(ptype),
m_nesting_depth(0),
m_block_number(0),
m_pending_else(nullptr),
m_scratch_size(scratch_size),
m_next_hwatomic_loc(0),
- m_sel(sel)
+ m_sel(sel),
+ m_atomic_base(atomic_base)
+
{
m_sh_info.processor_type = ptype;
+
}
struct r600_shader_atomic& atom = sh_info().atomics[sh_info().nhwatomic_ranges];
++sh_info().nhwatomic_ranges;
atom.buffer_id = uniform->data.binding;
- atom.hw_idx = m_next_hwatomic_loc;
+ atom.hw_idx = m_atomic_base + m_next_hwatomic_loc;
atom.start = m_next_hwatomic_loc;
atom.end = atom.start + natomics - 1;
m_next_hwatomic_loc = atom.end + 1;
class ShaderFromNirProcessor : public ValuePool {
public:
ShaderFromNirProcessor(pipe_shader_type ptype, r600_pipe_shader_selector& sel,
- r600_shader& sh_info, int scratch_size, enum chip_class _chip_class);
+ r600_shader& sh_info, int scratch_size, enum chip_class _chip_class,
+ int atomic_base);
virtual ~ShaderFromNirProcessor();
void emit_instruction(Instruction *ir);
int m_next_hwatomic_loc;
r600_pipe_shader_selector& m_sel;
+ int m_atomic_base ;
};
}
UNUSED const r600_shader_key& key,
enum chip_class chip_class):
ShaderFromNirProcessor (PIPE_SHADER_COMPUTE, sel, sh->shader,
- sh->scratch_space_needed, chip_class),
+ sh->scratch_space_needed, chip_class, 0),
m_reserved_registers(0)
{
}
r600_pipe_shader_selector &sel,
const r600_shader_key &key,
enum chip_class chip_class):
- ShaderFromNirProcessor(PIPE_SHADER_FRAGMENT, sel, sh, nir.scratch_size, chip_class),
+ ShaderFromNirProcessor(PIPE_SHADER_FRAGMENT, sel, sh, nir.scratch_size, chip_class, 0),
m_max_color_exports(MAX2(key.ps.nr_cbufs,1)),
m_max_counted_color_exports(0),
m_two_sided_color(key.ps.color_two_side),
const r600_shader_key &key,
enum chip_class chip_class):
VertexStage(PIPE_SHADER_GEOMETRY, sel, sh->shader,
- sh->scratch_space_needed, chip_class),
+ sh->scratch_space_needed, chip_class, key.gs.first_atomic_counter),
m_pipe_shader(sh),
m_so_info(&sel.so),
m_first_vertex_emitted(false),
const r600_shader_key& key,
enum chip_class chip_class):
ShaderFromNirProcessor (PIPE_SHADER_TESS_CTRL, sel, sh->shader,
- sh->scratch_space_needed, chip_class),
+ sh->scratch_space_needed, chip_class, key.tcs.first_atomic_counter),
m_reserved_registers(0)
{
sh_info().tcs_prim_mode = key.tcs.prim_mode;
const r600_shader_key& key, r600_shader *gs_shader,
enum chip_class chip_class):
VertexStage(PIPE_SHADER_TESS_EVAL, sel, sh->shader,
- sh->scratch_space_needed, chip_class),
+ sh->scratch_space_needed, chip_class, key.tes.first_atomic_counter),
m_reserved_registers(0),
m_key(key)
struct r600_shader* gs_shader,
enum chip_class chip_class):
VertexStage(PIPE_SHADER_VERTEX, sel, sh->shader,
- sh->scratch_space_needed, chip_class),
+ sh->scratch_space_needed, chip_class, key.vs.first_atomic_counter),
m_num_clip_dist(0),
m_last_param_export(nullptr),
m_last_pos_export(nullptr),