void nir_lower_bitmap(nir_shader *shader, const nir_lower_bitmap_options *options);
-bool nir_lower_atomics_to_ssbo(nir_shader *shader, unsigned ssbo_offset);
+bool nir_lower_atomics_to_ssbo(nir_shader *shader);
typedef enum {
nir_lower_int_source_mods = 1 << 0,
#endif
/*
- * Remap atomic counters to SSBOs, starting from the passed in ssbo_offset.
+ * Remap atomic counters to SSBOs, starting from the shader's next SSBO slot
+ * (info.num_ssbos).
*/
static bool
}
bool
-nir_lower_atomics_to_ssbo(nir_shader *shader, unsigned ssbo_offset)
+nir_lower_atomics_to_ssbo(nir_shader *shader)
{
+ unsigned ssbo_offset = shader->info.num_ssbos;
bool progress = false;
nir_foreach_function(function, shader) {
NIR_PASS_V(nir, nir_lower_var_copies);
nir_print_shader(nir, stdout);
NIR_PASS_V(nir, gl_nir_lower_atomics, prog, true);
- NIR_PASS_V(nir, nir_lower_atomics_to_ssbo, 8);
+ NIR_PASS_V(nir, nir_lower_atomics_to_ssbo);
nir_print_shader(nir, stdout);
switch (stage) {
NIR_PASS_V(nir, nir_lower_var_copies);
nir_print_shader(nir, stdout);
NIR_PASS_V(nir, gl_nir_lower_atomics, prog, true);
- NIR_PASS_V(nir, nir_lower_atomics_to_ssbo, 8);
+ NIR_PASS_V(nir, nir_lower_atomics_to_ssbo);
nir_print_shader(nir, stdout);
switch (stage) {
brw_shader_gather_info(prog->nir, prog);
NIR_PASS_V(prog->nir, gl_nir_lower_atomics, shProg, false);
- NIR_PASS_V(prog->nir, nir_lower_atomics_to_ssbo,
- prog->nir->info.num_ssbos);
+ NIR_PASS_V(prog->nir, nir_lower_atomics_to_ssbo);
nir_sweep(prog->nir);
nir_remove_dead_variables(nir, mask);
if (!st->has_hw_atomics)
- NIR_PASS_V(nir, nir_lower_atomics_to_ssbo, prog->info.num_ssbos);
+ NIR_PASS_V(nir, nir_lower_atomics_to_ssbo);
st_finalize_nir_before_variants(nir);