mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-17 00:47:13 +00:00
writer/msl: Wrap each array type in a struct
This allows them to be used in various places that WGSL allows, such as function return types and parameters, and as the type of the RHS of an assignment. Fixed: tint:814 Fixed: tint:820 Change-Id: Idb6a901b9a34e96bb9733cc158191e7b3bafaa0e Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/52844 Auto-Submit: James Price <jrprice@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: James Price <jrprice@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Tint LUCI CQ
parent
5c0820c76b
commit
94ac078990
112
test/array/assign_to_function_var.wgsl.expected.spvasm
Normal file
112
test/array/assign_to_function_var.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,112 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 60
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %src_private "src_private"
|
||||
OpName %src_workgroup "src_workgroup"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "arr"
|
||||
OpName %src_uniform "src_uniform"
|
||||
OpName %src_storage "src_storage"
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %ret_arr "ret_arr"
|
||||
OpName %ret_struct_arr "ret_struct_arr"
|
||||
OpName %foo "foo"
|
||||
OpName %src_param "src_param"
|
||||
OpName %src_function "src_function"
|
||||
OpName %dst "dst"
|
||||
OpName %dst_nested "dst_nested"
|
||||
OpName %src_nested "src_nested"
|
||||
OpDecorate %_arr_int_uint_4 ArrayStride 16
|
||||
OpDecorate %S Block
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %src_uniform DescriptorSet 0
|
||||
OpDecorate %src_uniform Binding 0
|
||||
OpDecorate %src_storage DescriptorSet 0
|
||||
OpDecorate %src_storage Binding 1
|
||||
OpDecorate %_arr_int_uint_2 ArrayStride 4
|
||||
OpDecorate %_arr__arr_int_uint_2_uint_3 ArrayStride 8
|
||||
OpDecorate %_arr__arr__arr_int_uint_2_uint_3_uint_4 ArrayStride 24
|
||||
%int = OpTypeInt 32 1
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_4 = OpConstant %uint 4
|
||||
%_arr_int_uint_4 = OpTypeArray %int %uint_4
|
||||
%_ptr_Private__arr_int_uint_4 = OpTypePointer Private %_arr_int_uint_4
|
||||
%7 = OpConstantNull %_arr_int_uint_4
|
||||
%src_private = OpVariable %_ptr_Private__arr_int_uint_4 Private %7
|
||||
%_ptr_Workgroup__arr_int_uint_4 = OpTypePointer Workgroup %_arr_int_uint_4
|
||||
%src_workgroup = OpVariable %_ptr_Workgroup__arr_int_uint_4 Workgroup
|
||||
%S = OpTypeStruct %_arr_int_uint_4
|
||||
%_ptr_Uniform_S = OpTypePointer Uniform %S
|
||||
%src_uniform = OpVariable %_ptr_Uniform_S Uniform
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%src_storage = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%15 = OpTypeFunction %void
|
||||
%19 = OpTypeFunction %_arr_int_uint_4
|
||||
%22 = OpTypeFunction %S
|
||||
%25 = OpConstantNull %S
|
||||
%26 = OpTypeFunction %void %_arr_int_uint_4
|
||||
%_ptr_Function__arr_int_uint_4 = OpTypePointer Function %_arr_int_uint_4
|
||||
%int_1 = OpConstant %int 1
|
||||
%int_2 = OpConstant %int 2
|
||||
%int_3 = OpConstant %int 3
|
||||
%36 = OpConstantComposite %_arr_int_uint_4 %int_1 %int_2 %int_3 %int_3
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_Uniform__arr_int_uint_4 = OpTypePointer Uniform %_arr_int_uint_4
|
||||
%_ptr_StorageBuffer__arr_int_uint_4 = OpTypePointer StorageBuffer %_arr_int_uint_4
|
||||
%uint_2 = OpConstant %uint 2
|
||||
%_arr_int_uint_2 = OpTypeArray %int %uint_2
|
||||
%uint_3 = OpConstant %uint 3
|
||||
%_arr__arr_int_uint_2_uint_3 = OpTypeArray %_arr_int_uint_2 %uint_3
|
||||
%_arr__arr__arr_int_uint_2_uint_3_uint_4 = OpTypeArray %_arr__arr_int_uint_2_uint_3 %uint_4
|
||||
%_ptr_Function__arr__arr__arr_int_uint_2_uint_3_uint_4 = OpTypePointer Function %_arr__arr__arr_int_uint_2_uint_3_uint_4
|
||||
%57 = OpConstantNull %_arr__arr__arr_int_uint_2_uint_3_uint_4
|
||||
%unused_entry_point = OpFunction %void None %15
|
||||
%18 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%ret_arr = OpFunction %_arr_int_uint_4 None %19
|
||||
%21 = OpLabel
|
||||
OpReturnValue %7
|
||||
OpFunctionEnd
|
||||
%ret_struct_arr = OpFunction %S None %22
|
||||
%24 = OpLabel
|
||||
OpReturnValue %25
|
||||
OpFunctionEnd
|
||||
%foo = OpFunction %void None %26
|
||||
%src_param = OpFunctionParameter %_arr_int_uint_4
|
||||
%29 = OpLabel
|
||||
%src_function = OpVariable %_ptr_Function__arr_int_uint_4 Function %7
|
||||
%dst = OpVariable %_ptr_Function__arr_int_uint_4 Function %7
|
||||
%dst_nested = OpVariable %_ptr_Function__arr__arr__arr_int_uint_2_uint_3_uint_4 Function %57
|
||||
%src_nested = OpVariable %_ptr_Function__arr__arr__arr_int_uint_2_uint_3_uint_4 Function %57
|
||||
OpStore %dst %36
|
||||
OpStore %dst %src_param
|
||||
%37 = OpFunctionCall %_arr_int_uint_4 %ret_arr
|
||||
OpStore %dst %37
|
||||
OpStore %dst %7
|
||||
%38 = OpLoad %_arr_int_uint_4 %src_function
|
||||
OpStore %dst %38
|
||||
%39 = OpLoad %_arr_int_uint_4 %src_private
|
||||
OpStore %dst %39
|
||||
%40 = OpLoad %_arr_int_uint_4 %src_workgroup
|
||||
OpStore %dst %40
|
||||
%41 = OpFunctionCall %S %ret_struct_arr
|
||||
%42 = OpCompositeExtract %_arr_int_uint_4 %41 0
|
||||
OpStore %dst %42
|
||||
%45 = OpAccessChain %_ptr_Uniform__arr_int_uint_4 %src_uniform %uint_0
|
||||
%46 = OpLoad %_arr_int_uint_4 %45
|
||||
OpStore %dst %46
|
||||
%48 = OpAccessChain %_ptr_StorageBuffer__arr_int_uint_4 %src_storage %uint_0
|
||||
%49 = OpLoad %_arr_int_uint_4 %48
|
||||
OpStore %dst %49
|
||||
%59 = OpLoad %_arr__arr__arr_int_uint_2_uint_3_uint_4 %src_nested
|
||||
OpStore %dst_nested %59
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
Reference in New Issue
Block a user