Commit 7eed6596 authored by Rhys Perry's avatar Rhys Perry
Browse files

nir/deref: stop assuming coherent accesses of different SSBOs may alias

Whether it's coherent should be irrelevant and the ACCESS_RESTRICT check
above should consider all cases aliasing unless NIR makes it clear they're

Signed-off-by: Rhys Perry's avatarRhys Perry <>
parent 0eef1927
Pipeline #601353 waiting for manual action with stages
......@@ -442,28 +442,6 @@ modes_may_alias(nir_variable_mode a, nir_variable_mode b)
return a & b;
static bool
deref_path_contains_coherent_decoration(nir_deref_path *path)
assert(path->path[0]->deref_type == nir_deref_type_var);
if (path->path[0]->var->data.access & ACCESS_COHERENT)
return true;
for (nir_deref_instr **p = &path->path[1]; *p; p++) {
if ((*p)->deref_type != nir_deref_type_struct)
const struct glsl_type *struct_type = (*(p - 1))->type;
const struct glsl_struct_field *field =
glsl_get_struct_field_data(struct_type, (*p)->strct.index);
if (field->memory_coherent)
return true;
return false;
nir_compare_deref_paths(nir_deref_path *a_path,
nir_deref_path *b_path)
......@@ -506,16 +484,6 @@ nir_compare_deref_paths(nir_deref_path *a_path,
!(b_path->path[0]->var->data.access & ACCESS_RESTRICT))
return nir_derefs_may_alias_bit;
/* If they are both declared coherent or have coherent somewhere in
* their path (due to a member of an interface being declared
* coherent), we have to assume we that we could have any kind of
* aliasing. Otherwise, they could still alias but the client didn't
* tell us and that's their fault.
if (deref_path_contains_coherent_decoration(a_path) &&
return nir_derefs_may_alias_bit;
/* Per SPV_KHR_workgroup_memory_explicit_layout and GL_EXT_shared_memory_block,
* shared blocks alias each other.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment