SPIRV-Cross/shaders-msl/asm/comp/struct-resource-name-aliasing.asm.comp
Hans-Kristian Arntzen 437fc87a89 MSL: Deal with resource name aliasing.
Apparently we didn't use those yet. MSL seems to be able to alias struct
types and variable types to a degree, so that's why it has escaped
testing until now.
2019-01-18 16:27:57 +01:00

48 lines
1.8 KiB
Plaintext

; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 7
; Bound: 21
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 8 8 1
OpSource HLSL 500
OpName %main "main"
OpName %_main_ "@main("
OpName %bufA "bufA"
OpMemberName %bufA 0 "@data"
OpName %bufA_0 "bufA"
OpName %bufB "bufB"
OpDecorate %_runtimearr_uint ArrayStride 4
OpMemberDecorate %bufA 0 Offset 0
OpDecorate %bufA BufferBlock
OpDecorate %bufA_0 DescriptorSet 0
OpDecorate %bufB DescriptorSet 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%_runtimearr_uint = OpTypeRuntimeArray %uint
%bufA = OpTypeStruct %_runtimearr_uint
%_ptr_Uniform_bufA = OpTypePointer Uniform %bufA
%bufA_0 = OpVariable %_ptr_Uniform_bufA Uniform
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%bufB = OpVariable %_ptr_Uniform_bufA Uniform
%main = OpFunction %void None %3
%5 = OpLabel
%20 = OpFunctionCall %void %_main_
OpReturn
OpFunctionEnd
%_main_ = OpFunction %void None %3
%7 = OpLabel
%17 = OpAccessChain %_ptr_Uniform_uint %bufA_0 %int_0 %int_0
OpStore %17 %uint_0
%19 = OpAccessChain %_ptr_Uniform_uint %bufB %int_0 %int_0
OpStore %19 %uint_0
OpReturn
OpFunctionEnd