bool needs_edge_flag;
+ /* Whether shader uses atomic operations. */
+ bool uses_atomic_load_store;
+
/** Constant data scraped from the shader by nir_opt_large_constants */
struct pipe_resource *const_data;
brw_preprocess_nir(screen->compiler, nir, NULL);
- NIR_PASS_V(nir, brw_nir_lower_image_load_store, devinfo);
+ NIR_PASS_V(nir, brw_nir_lower_image_load_store, devinfo,
+ &ish->uses_atomic_load_store);
NIR_PASS_V(nir, iris_lower_storage_image_derefs);
nir_sweep(nir);
*/
uint32_t *param;
uint32_t *pull_param;
+
+ /* Whether shader uses atomic operations. */
+ bool uses_atomic_load_store;
};
static inline uint32_t *
bool brw_nir_lower_conversions(nir_shader *nir);
bool brw_nir_lower_image_load_store(nir_shader *nir,
- const struct gen_device_info *devinfo);
+ const struct gen_device_info *devinfo,
+ bool *uses_atomic_load_store);
void brw_nir_rewrite_image_intrinsic(nir_intrinsic_instr *intrin,
nir_ssa_def *index);
void brw_nir_rewrite_bindless_image_intrinsic(nir_intrinsic_instr *intrin,
bool
brw_nir_lower_image_load_store(nir_shader *shader,
- const struct gen_device_info *devinfo)
+ const struct gen_device_info *devinfo,
+ bool *uses_atomic_load_store)
{
bool progress = false;
case nir_intrinsic_image_deref_atomic_xor:
case nir_intrinsic_image_deref_atomic_exchange:
case nir_intrinsic_image_deref_atomic_comp_swap:
+ if (uses_atomic_load_store)
+ *uses_atomic_load_store = true;
if (lower_image_atomic_instr(&b, devinfo, intrin))
progress = true;
break;
nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir));
- NIR_PASS_V(nir, brw_nir_lower_image_load_store, compiler->devinfo);
+ NIR_PASS_V(nir, brw_nir_lower_image_load_store, compiler->devinfo, NULL);
NIR_PASS_V(nir, nir_lower_explicit_io, nir_var_mem_global,
nir_address_format_64bit_global);
prog->info.textures_used = prog->nir->info.textures_used;
prog->info.textures_used_by_txf = prog->nir->info.textures_used_by_txf;
- NIR_PASS_V(prog->nir, brw_nir_lower_image_load_store, devinfo);
+ NIR_PASS_V(prog->nir, brw_nir_lower_image_load_store, devinfo, NULL);
if (prog->nir->info.stage == MESA_SHADER_COMPUTE &&
shader_prog->data->spirv) {