From: Caio Marcelo de Oliveira Filho Date: Fri, 5 Jun 2020 22:58:32 +0000 (-0700) Subject: spirv: Memory semantics is optional for OpControlBarrier X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e5bb4b1ee8c662fb2681b68c965756adbfb0df67;p=mesa.git spirv: Memory semantics is optional for OpControlBarrier Fixes: 3ed2123d77d ("spirv: Use scoped barriers for SpvOpControlBarrier") Reviewed-by: Jordan Justen Reviewed-by: Boris Brezillon Reviewed-by: Jason Ekstrand Part-of: --- diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index 92ccc10654c..cfe180c0489 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -2130,18 +2130,18 @@ vtn_emit_scoped_control_barrier(struct vtn_builder *b, SpvScope exec_scope, SpvScope mem_scope, SpvMemorySemanticsMask semantics) { - nir_memory_semantics nir_semantics; - nir_variable_mode modes; - - nir_semantics = vtn_mem_semantics_to_nir_mem_semantics(b, semantics); - modes = vtn_mem_sematics_to_nir_var_modes(b, semantics); + nir_memory_semantics nir_semantics = + vtn_mem_semantics_to_nir_mem_semantics(b, semantics); + nir_variable_mode modes = vtn_mem_sematics_to_nir_var_modes(b, semantics); + nir_scope nir_exec_scope = vtn_scope_to_nir_scope(b, exec_scope); - /* No barrier to add. */ + /* Memory semantics is optional for OpControlBarrier. */ + nir_scope nir_mem_scope; if (nir_semantics == 0 || modes == 0) - return; + nir_mem_scope = NIR_SCOPE_NONE; + else + nir_mem_scope = vtn_scope_to_nir_scope(b, mem_scope); - nir_scope nir_exec_scope = vtn_scope_to_nir_scope(b, exec_scope); - nir_scope nir_mem_scope = vtn_scope_to_nir_scope(b, mem_scope); nir_scoped_barrier(&b->nb, nir_exec_scope, nir_mem_scope, nir_semantics, modes); }