mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 10:49:14 +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
67
test/array/function_parameter.wgsl.expected.spvasm
Normal file
67
test/array/function_parameter.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,67 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 41
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %f1 "f1"
|
||||
OpName %a "a"
|
||||
OpName %f2 "f2"
|
||||
OpName %a_0 "a"
|
||||
OpName %f3 "f3"
|
||||
OpName %a_1 "a"
|
||||
OpName %main "main"
|
||||
OpDecorate %_arr_float_uint_4 ArrayStride 4
|
||||
OpDecorate %_arr__arr_float_uint_4_uint_3 ArrayStride 16
|
||||
OpDecorate %_arr__arr__arr_float_uint_4_uint_3_uint_2 ArrayStride 48
|
||||
%float = OpTypeFloat 32
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_4 = OpConstant %uint 4
|
||||
%_arr_float_uint_4 = OpTypeArray %float %uint_4
|
||||
%1 = OpTypeFunction %float %_arr_float_uint_4
|
||||
%int = OpTypeInt 32 1
|
||||
%int_3 = OpConstant %int 3
|
||||
%uint_3 = OpConstant %uint 3
|
||||
%_arr__arr_float_uint_4_uint_3 = OpTypeArray %_arr_float_uint_4 %uint_3
|
||||
%12 = OpTypeFunction %float %_arr__arr_float_uint_4_uint_3
|
||||
%int_2 = OpConstant %int 2
|
||||
%uint_2 = OpConstant %uint 2
|
||||
%_arr__arr__arr_float_uint_4_uint_3_uint_2 = OpTypeArray %_arr__arr_float_uint_4_uint_3 %uint_2
|
||||
%21 = OpTypeFunction %float %_arr__arr__arr_float_uint_4_uint_3_uint_2
|
||||
%int_1 = OpConstant %int 1
|
||||
%void = OpTypeVoid
|
||||
%31 = OpTypeFunction %void
|
||||
%35 = OpConstantNull %_arr_float_uint_4
|
||||
%36 = OpConstantNull %_arr__arr_float_uint_4_uint_3
|
||||
%37 = OpConstantNull %_arr__arr__arr_float_uint_4_uint_3_uint_2
|
||||
%f1 = OpFunction %float None %1
|
||||
%a = OpFunctionParameter %_arr_float_uint_4
|
||||
%8 = OpLabel
|
||||
%11 = OpCompositeExtract %float %a 3
|
||||
OpReturnValue %11
|
||||
OpFunctionEnd
|
||||
%f2 = OpFunction %float None %12
|
||||
%a_0 = OpFunctionParameter %_arr__arr_float_uint_4_uint_3
|
||||
%17 = OpLabel
|
||||
%19 = OpCompositeExtract %_arr_float_uint_4 %a_0 2
|
||||
%20 = OpCompositeExtract %float %19 3
|
||||
OpReturnValue %20
|
||||
OpFunctionEnd
|
||||
%f3 = OpFunction %float None %21
|
||||
%a_1 = OpFunctionParameter %_arr__arr__arr_float_uint_4_uint_3_uint_2
|
||||
%26 = OpLabel
|
||||
%28 = OpCompositeExtract %_arr__arr_float_uint_4_uint_3 %a_1 1
|
||||
%29 = OpCompositeExtract %_arr_float_uint_4 %28 2
|
||||
%30 = OpCompositeExtract %float %29 3
|
||||
OpReturnValue %30
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %31
|
||||
%34 = OpLabel
|
||||
%38 = OpFunctionCall %float %f1 %35
|
||||
%39 = OpFunctionCall %float %f2 %36
|
||||
%40 = OpFunctionCall %float %f3 %37
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
Reference in New Issue
Block a user