load->src[1] = nir_src_for_ssa(addr_to_offset(b, addr, addr_format));
}
- if (mode == nir_var_mem_ssbo || mode == nir_var_mem_global || mode == nir_var_mem_ubo)
+ if (nir_intrinsic_infos[op].index_map[NIR_INTRINSIC_ACCESS] > 0)
nir_intrinsic_set_access(load, nir_intrinsic_access(intrin));
unsigned bit_size = intrin->dest.ssa.bit_size;
nir_intrinsic_set_write_mask(store, write_mask);
- if (mode == nir_var_mem_ssbo || mode == nir_var_mem_global)
+ if (nir_intrinsic_infos[op].index_map[NIR_INTRINSIC_ACCESS] > 0)
nir_intrinsic_set_access(store, nir_intrinsic_access(intrin));
/* TODO: We should try and provide a better alignment. For OpenCL, we need
/* Global atomics don't have access flags because they assume that the
* address may be non-uniform.
*/
- if (!addr_format_is_global(addr_format) && mode != nir_var_mem_shared)
+ if (nir_intrinsic_infos[op].index_map[NIR_INTRINSIC_ACCESS] > 0)
nir_intrinsic_set_access(atomic, nir_intrinsic_access(intrin));
assert(intrin->dest.ssa.num_components == 1);