diff options
author | Karol Herbst <[email protected]> | 2019-01-31 01:56:25 +0100 |
---|---|---|
committer | Karol Herbst <[email protected]> | 2019-03-19 04:08:07 +0000 |
commit | d0ba326f238f9f2130847696c6c64bbb381f7471 (patch) | |
tree | 302e8edf2687f2c31f9332ae87fcbc36f13d938d /src/compiler/spirv/vtn_variables.c | |
parent | c95afe56a8033a87dca71cc93191d448c2981cf7 (diff) |
nir/spirv: support physical pointers
v2: add load_kernel_input
Signed-off-by: Karol Herbst <[email protected]>
squash! nir/spirv: support physical pointers
Diffstat (limited to 'src/compiler/spirv/vtn_variables.c')
-rw-r--r-- | src/compiler/spirv/vtn_variables.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c index 053d6089e45..da4c57f7c77 100644 --- a/src/compiler/spirv/vtn_variables.c +++ b/src/compiler/spirv/vtn_variables.c @@ -1872,9 +1872,8 @@ vtn_pointer_from_ssa(struct vtn_builder *b, nir_ssa_def *ssa, } else { const struct glsl_type *deref_type = ptr_type->deref->type; if (!vtn_pointer_is_external_block(b, ptr)) { - assert(ssa->bit_size == 32 && ssa->num_components == 1); ptr->deref = nir_build_deref_cast(&b->nb, ssa, nir_mode, - glsl_get_bare_type(deref_type), 0); + deref_type, 0); } else if (vtn_type_contains_block(b, ptr->type) && ptr->mode != vtn_variable_mode_phys_ssbo) { /* This is a pointer to somewhere in an array of blocks, not a @@ -2317,9 +2316,10 @@ vtn_handle_variables(struct vtn_builder *b, SpvOp opcode, case SpvOpAccessChain: case SpvOpPtrAccessChain: - case SpvOpInBoundsAccessChain: { + case SpvOpInBoundsAccessChain: + case SpvOpInBoundsPtrAccessChain: { struct vtn_access_chain *chain = vtn_access_chain_create(b, count - 4); - chain->ptr_as_array = (opcode == SpvOpPtrAccessChain); + chain->ptr_as_array = (opcode == SpvOpPtrAccessChain || opcode == SpvOpInBoundsPtrAccessChain); unsigned idx = 0; for (int i = 4; i < count; i++) { |