diff options
author | Hans-Kristian Arntzen <post@arntzen-software.no> | 2023-05-10 13:33:54 +0200 |
---|---|---|
committer | Hans-Kristian Arntzen <post@arntzen-software.no> | 2023-05-10 13:33:54 +0200 |
commit | cfd1618e3130490c88efa9578c682767a4f9f14c (patch) | |
tree | 07cd10dd2e10fd3695bebf082519ee507b10fdb3 /reference/shaders-no-opt | |
parent | 193ca867cad5fbc367775f785fcbc18134a040d7 (diff) | |
download | SPIRV-Cross-cfd1618e3130490c88efa9578c682767a4f9f14c.tar.gz SPIRV-Cross-cfd1618e3130490c88efa9578c682767a4f9f14c.tar.bz2 SPIRV-Cross-cfd1618e3130490c88efa9578c682767a4f9f14c.zip |
MSL: Use templated array type when emitting BDA to arrays.
Handling native array types is not really feasible since we need to fuse
the variable declaration with the type declaration.
This is feasible in something like variable_decl, but for plain SSA
pointers, this breaks down.
Diffstat (limited to 'reference/shaders-no-opt')
-rw-r--r-- | reference/shaders-no-opt/asm/comp/bda-to-array-in-buffer.asm.spv16.nocompat.vk.comp.vk | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/reference/shaders-no-opt/asm/comp/bda-to-array-in-buffer.asm.spv16.nocompat.vk.comp.vk b/reference/shaders-no-opt/asm/comp/bda-to-array-in-buffer.asm.spv16.nocompat.vk.comp.vk new file mode 100644 index 00000000..dfb8e318 --- /dev/null +++ b/reference/shaders-no-opt/asm/comp/bda-to-array-in-buffer.asm.spv16.nocompat.vk.comp.vk @@ -0,0 +1,45 @@ +#version 450 +#extension GL_EXT_shader_explicit_arithmetic_types_int8 : require +#extension GL_EXT_shader_8bit_storage : require +#if defined(GL_ARB_gpu_shader_int64) +#extension GL_ARB_gpu_shader_int64 : require +#else +#error No extension available for 64-bit integers. +#endif +#extension GL_EXT_buffer_reference : require +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(buffer_reference) buffer uint8_tPointer +{ + uint8_t value; +}; + +layout(buffer_reference, buffer_reference_align = 4) buffer uintPointer +{ + uint value; +}; + +layout(buffer_reference, buffer_reference_align = 1) buffer uint8_t12_Pointer +{ + uint8_t value[12]; +}; + +layout(set = 0, binding = 0, std430) buffer _7_2 +{ + uint8_tPointer _m0; + uint8_t12_Pointer _m1; +} _2; + +uintPointer _23() +{ + uint8_t12_Pointer _26 = _2._m1; + uintPointer _29 = uintPointer(uint64_t(_26) + 16ul); + _29.value = 1u; + return _29; +} + +void main() +{ + uintPointer _31 = _23(); +} + |