[Mesa-dev] [PATCH 04/12] spirv: Add a switch statement for the block store opcode
Jason Ekstrand
jason at jlekstrand.net
Thu Oct 19 18:04:06 UTC 2017
This parallels what we do for vtn_block_load except that we don't yet
support anything except SSBO loads through this path.
---
src/compiler/spirv/vtn_variables.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index 7bfac46..0909af3 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -848,11 +848,20 @@ static void
vtn_block_store(struct vtn_builder *b, struct vtn_ssa_value *src,
struct vtn_pointer *dst)
{
+ nir_intrinsic_op op;
+ switch (dst->mode) {
+ case vtn_variable_mode_ssbo:
+ op = nir_intrinsic_store_ssbo;
+ break;
+ default:
+ unreachable("Invalid block variable mode");
+ }
+
nir_ssa_def *offset, *index = NULL;
unsigned chain_idx;
offset = vtn_pointer_to_offset(b, dst, &index, &chain_idx);
- _vtn_block_load_store(b, nir_intrinsic_store_ssbo, false, index, offset,
+ _vtn_block_load_store(b, op, false, index, offset,
0, 0, dst->chain, chain_idx, dst->type, &src);
}
--
2.5.0.400.gff86faf
More information about the mesa-dev
mailing list