Module: Mesa Branch: master Commit: e5bb4b1ee8c662fb2681b68c965756adbfb0df67 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e5bb4b1ee8c662fb2681b68c965756adbfb0df67
Author: Caio Marcelo de Oliveira Filho <[email protected]> Date: Fri Jun 5 15:58:32 2020 -0700 spirv: Memory semantics is optional for OpControlBarrier Fixes: 3ed2123d77d ("spirv: Use scoped barriers for SpvOpControlBarrier") Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5365> --- src/compiler/spirv/spirv_to_nir.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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); } _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
