From 3d7e5ec758b5de13fa46c4d75b5119896df3ae76 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Fri, 16 Jun 2023 17:22:04 -0700 Subject: [PATCH] spirv: Expose some memory related functions in vtn_private.h Reviewed-by: Ian Romanick Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/compiler/spirv/vtn_private.h | 7 +++++++ src/compiler/spirv/vtn_variables.c | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h index 830c154..e295e12 100644 --- a/src/compiler/spirv/vtn_private.h +++ b/src/compiler/spirv/vtn_private.h @@ -1032,5 +1032,12 @@ vtn_parse_switch(struct vtn_builder *b, const uint32_t *branch, struct list_head *case_list); +bool vtn_get_mem_operands(struct vtn_builder *b, const uint32_t *w, unsigned count, + unsigned *idx, SpvMemoryAccessMask *access, unsigned *alignment, + SpvScope *dest_scope, SpvScope *src_scope); +void vtn_emit_make_visible_barrier(struct vtn_builder *b, SpvMemoryAccessMask access, + SpvScope scope, enum vtn_variable_mode mode); +void vtn_emit_make_available_barrier(struct vtn_builder *b, SpvMemoryAccessMask access, + SpvScope scope, enum vtn_variable_mode mode); #endif /* _VTN_PRIVATE_H_ */ diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c index 8fb5956..9b627c0 100644 --- a/src/compiler/spirv/vtn_variables.c +++ b/src/compiler/spirv/vtn_variables.c @@ -2368,7 +2368,7 @@ nir_sloppy_bitcast(nir_builder *b, nir_def *val, return nir_shrink_zero_pad_vec(b, val, num_components); } -static bool +bool vtn_get_mem_operands(struct vtn_builder *b, const uint32_t *w, unsigned count, unsigned *idx, SpvMemoryAccessMask *access, unsigned *alignment, SpvScope *dest_scope, SpvScope *src_scope) @@ -2435,7 +2435,7 @@ vtn_mode_to_memory_semantics(enum vtn_variable_mode mode) } } -static void +void vtn_emit_make_visible_barrier(struct vtn_builder *b, SpvMemoryAccessMask access, SpvScope scope, enum vtn_variable_mode mode) { @@ -2447,7 +2447,7 @@ vtn_emit_make_visible_barrier(struct vtn_builder *b, SpvMemoryAccessMask access, vtn_mode_to_memory_semantics(mode)); } -static void +void vtn_emit_make_available_barrier(struct vtn_builder *b, SpvMemoryAccessMask access, SpvScope scope, enum vtn_variable_mode mode) { -- 2.7.4