mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-12 14:46:08 +00:00
Add tests derived from VK-GL-CTS
This adds SPIR-V assembly and WGSL tests derived from VK-GL-CTS commit 571256871c2e2f03995373e1e4a02958d8cd8cf5. The following procedure was followed: - Those .amber files in VK-GL-CTS wholly owned by Google were identified - All GLSL and SPIR-V shaders were extracted from the Amber files and converted into SPIR-V binaries - The compact-ids pass of spirv-opt was applied to each binary - Duplicate binaries were removed - spirv-opt -O was used to obtain an optimized version of each remaining binary, with duplicates discarded - Binaries that failed validation using spirv-val with target environment SPIR-V 1.3 were discarded - Those binaries that tint could not successfully convert into WGSL were put aside for further investigation - SPIR-V assembly versions of the remaining binaries are included in this CL - test-runner with -generate-expected and -generate-skip was used to generate expected .spvasm, .msl, .hlsl and .wgsl outputs for these SPIR-V assembly tests - Each successfully-generated .expected.wgsl is included in this CL again, as a WGLSL test - test-runner with -generate-expected and -generate-skip was used again, to generate expected outputs for these WGSL tests Change-Id: Ibe9baf2729cf97e0b633db9a426f53362a5de540 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58842 Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Tint LUCI CQ
parent
bd3edb564f
commit
f7e73d4ee3
@@ -0,0 +1,360 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 265
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %tint_symbol %tint_symbol_2
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpName %gl_FragCoord "gl_FragCoord"
|
||||
OpName %buf0 "buf0"
|
||||
OpMemberName %buf0 0 "resolution"
|
||||
OpName %x_24 "x_24"
|
||||
OpName %x_GLF_color "x_GLF_color"
|
||||
OpName %tint_symbol "tint_symbol"
|
||||
OpName %tint_symbol_2 "tint_symbol_2"
|
||||
OpName %cross2d_vf2_vf2_ "cross2d_vf2_vf2_"
|
||||
OpName %a "a"
|
||||
OpName %b "b"
|
||||
OpName %pointInTriangle_vf2_vf2_vf2_vf2_ "pointInTriangle_vf2_vf2_vf2_vf2_"
|
||||
OpName %p "p"
|
||||
OpName %a_1 "a_1"
|
||||
OpName %b_1 "b_1"
|
||||
OpName %c "c"
|
||||
OpName %x_90 "x_90"
|
||||
OpName %x_91 "x_91"
|
||||
OpName %pab "pab"
|
||||
OpName %param "param"
|
||||
OpName %param_1 "param_1"
|
||||
OpName %pbc "pbc"
|
||||
OpName %param_2 "param_2"
|
||||
OpName %param_3 "param_3"
|
||||
OpName %pca "pca"
|
||||
OpName %param_4 "param_4"
|
||||
OpName %param_5 "param_5"
|
||||
OpName %x_140 "x_140"
|
||||
OpName %x_168 "x_168"
|
||||
OpName %x_141_phi "x_141_phi"
|
||||
OpName %x_169_phi "x_169_phi"
|
||||
OpName %x_173_phi "x_173_phi"
|
||||
OpName %main_1 "main_1"
|
||||
OpName %pos "pos"
|
||||
OpName %param_6 "param_6"
|
||||
OpName %param_7 "param_7"
|
||||
OpName %param_8 "param_8"
|
||||
OpName %param_9 "param_9"
|
||||
OpName %main_out "main_out"
|
||||
OpMemberName %main_out 0 "x_GLF_color_1"
|
||||
OpName %tint_symbol_3 "tint_symbol_3"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %main "main"
|
||||
OpDecorate %buf0 Block
|
||||
OpMemberDecorate %buf0 0 Offset 0
|
||||
OpDecorate %x_24 NonWritable
|
||||
OpDecorate %x_24 DescriptorSet 0
|
||||
OpDecorate %x_24 Binding 0
|
||||
OpDecorate %tint_symbol BuiltIn FragCoord
|
||||
OpDecorate %tint_symbol_2 Location 0
|
||||
OpMemberDecorate %main_out 0 Offset 0
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Private_v4float = OpTypePointer Private %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%gl_FragCoord = OpVariable %_ptr_Private_v4float Private %5
|
||||
%v2float = OpTypeVector %float 2
|
||||
%buf0 = OpTypeStruct %v2float
|
||||
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
|
||||
%x_24 = OpVariable %_ptr_Uniform_buf0 Uniform
|
||||
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %5
|
||||
%_ptr_Input_v4float = OpTypePointer Input %v4float
|
||||
%tint_symbol = OpVariable %_ptr_Input_v4float Input
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%tint_symbol_2 = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%15 = OpTypeFunction %float %_ptr_Function_v2float %_ptr_Function_v2float
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%int = OpTypeInt 32 1
|
||||
%40 = OpTypeFunction %int %_ptr_Function_v2float %_ptr_Function_v2float %_ptr_Function_v2float %_ptr_Function_v2float
|
||||
%bool = OpTypeBool
|
||||
%false = OpConstantFalse %bool
|
||||
%_ptr_Function_bool = OpTypePointer Function %bool
|
||||
%52 = OpConstantNull %bool
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%55 = OpConstantNull %int
|
||||
%57 = OpConstantNull %float
|
||||
%59 = OpConstantNull %v2float
|
||||
%float_0 = OpConstant %float 0
|
||||
%true = OpConstantTrue %bool
|
||||
%int_0 = OpConstant %int 0
|
||||
%int_1 = OpConstant %int 1
|
||||
%void = OpTypeVoid
|
||||
%214 = OpTypeFunction %void
|
||||
%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
|
||||
%float_0_699999988 = OpConstant %float 0.699999988
|
||||
%float_0_300000012 = OpConstant %float 0.300000012
|
||||
%233 = OpConstantComposite %v2float %float_0_699999988 %float_0_300000012
|
||||
%float_0_5 = OpConstant %float 0.5
|
||||
%float_0_899999976 = OpConstant %float 0.899999976
|
||||
%236 = OpConstantComposite %v2float %float_0_5 %float_0_899999976
|
||||
%float_0_100000001 = OpConstant %float 0.100000001
|
||||
%float_0_400000006 = OpConstant %float 0.400000006
|
||||
%239 = OpConstantComposite %v2float %float_0_100000001 %float_0_400000006
|
||||
%float_1 = OpConstant %float 1
|
||||
%250 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
|
||||
%251 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1
|
||||
%main_out = OpTypeStruct %v4float
|
||||
%252 = OpTypeFunction %void %main_out
|
||||
%cross2d_vf2_vf2_ = OpFunction %float None %15
|
||||
%a = OpFunctionParameter %_ptr_Function_v2float
|
||||
%b = OpFunctionParameter %_ptr_Function_v2float
|
||||
%20 = OpLabel
|
||||
%25 = OpAccessChain %_ptr_Function_float %a %uint_0
|
||||
%26 = OpLoad %float %25
|
||||
%29 = OpAccessChain %_ptr_Function_float %b %uint_1
|
||||
%30 = OpLoad %float %29
|
||||
%32 = OpAccessChain %_ptr_Function_float %b %uint_0
|
||||
%33 = OpLoad %float %32
|
||||
%35 = OpAccessChain %_ptr_Function_float %a %uint_1
|
||||
%36 = OpLoad %float %35
|
||||
%37 = OpFMul %float %26 %30
|
||||
%38 = OpFMul %float %33 %36
|
||||
%39 = OpFSub %float %37 %38
|
||||
OpReturnValue %39
|
||||
OpFunctionEnd
|
||||
%pointInTriangle_vf2_vf2_vf2_vf2_ = OpFunction %int None %40
|
||||
%p = OpFunctionParameter %_ptr_Function_v2float
|
||||
%a_1 = OpFunctionParameter %_ptr_Function_v2float
|
||||
%b_1 = OpFunctionParameter %_ptr_Function_v2float
|
||||
%c = OpFunctionParameter %_ptr_Function_v2float
|
||||
%47 = OpLabel
|
||||
%x_90 = OpVariable %_ptr_Function_bool Function %52
|
||||
%x_91 = OpVariable %_ptr_Function_int Function %55
|
||||
%pab = OpVariable %_ptr_Function_float Function %57
|
||||
%param = OpVariable %_ptr_Function_v2float Function %59
|
||||
%param_1 = OpVariable %_ptr_Function_v2float Function %59
|
||||
%pbc = OpVariable %_ptr_Function_float Function %57
|
||||
%param_2 = OpVariable %_ptr_Function_v2float Function %59
|
||||
%param_3 = OpVariable %_ptr_Function_v2float Function %59
|
||||
%pca = OpVariable %_ptr_Function_float Function %57
|
||||
%param_4 = OpVariable %_ptr_Function_v2float Function %59
|
||||
%param_5 = OpVariable %_ptr_Function_v2float Function %59
|
||||
%x_140 = OpVariable %_ptr_Function_bool Function %52
|
||||
%x_168 = OpVariable %_ptr_Function_bool Function %52
|
||||
%x_141_phi = OpVariable %_ptr_Function_bool Function %52
|
||||
%x_169_phi = OpVariable %_ptr_Function_bool Function %52
|
||||
%x_173_phi = OpVariable %_ptr_Function_int Function %55
|
||||
OpStore %x_90 %false
|
||||
OpSelectionMerge %72 None
|
||||
OpSwitch %uint_0 %73
|
||||
%73 = OpLabel
|
||||
%75 = OpAccessChain %_ptr_Function_float %p %uint_0
|
||||
%76 = OpLoad %float %75
|
||||
%78 = OpAccessChain %_ptr_Function_float %a_1 %uint_0
|
||||
%79 = OpLoad %float %78
|
||||
%81 = OpAccessChain %_ptr_Function_float %p %uint_1
|
||||
%82 = OpLoad %float %81
|
||||
%84 = OpAccessChain %_ptr_Function_float %a_1 %uint_1
|
||||
%85 = OpLoad %float %84
|
||||
%87 = OpAccessChain %_ptr_Function_float %b_1 %uint_0
|
||||
%88 = OpLoad %float %87
|
||||
%90 = OpAccessChain %_ptr_Function_float %a_1 %uint_0
|
||||
%91 = OpLoad %float %90
|
||||
%93 = OpAccessChain %_ptr_Function_float %b_1 %uint_1
|
||||
%94 = OpLoad %float %93
|
||||
%96 = OpAccessChain %_ptr_Function_float %a_1 %uint_1
|
||||
%97 = OpLoad %float %96
|
||||
%98 = OpFSub %float %76 %79
|
||||
%99 = OpFSub %float %82 %85
|
||||
%100 = OpCompositeConstruct %v2float %98 %99
|
||||
OpStore %param %100
|
||||
%101 = OpFSub %float %88 %91
|
||||
%102 = OpFSub %float %94 %97
|
||||
%103 = OpCompositeConstruct %v2float %101 %102
|
||||
OpStore %param_1 %103
|
||||
%104 = OpFunctionCall %float %cross2d_vf2_vf2_ %param %param_1
|
||||
OpStore %pab %104
|
||||
%108 = OpAccessChain %_ptr_Function_float %p %uint_0
|
||||
%109 = OpLoad %float %108
|
||||
%111 = OpAccessChain %_ptr_Function_float %b_1 %uint_0
|
||||
%112 = OpLoad %float %111
|
||||
%114 = OpAccessChain %_ptr_Function_float %p %uint_1
|
||||
%115 = OpLoad %float %114
|
||||
%117 = OpAccessChain %_ptr_Function_float %b_1 %uint_1
|
||||
%118 = OpLoad %float %117
|
||||
%120 = OpAccessChain %_ptr_Function_float %c %uint_0
|
||||
%121 = OpLoad %float %120
|
||||
%123 = OpAccessChain %_ptr_Function_float %b_1 %uint_0
|
||||
%124 = OpLoad %float %123
|
||||
%126 = OpAccessChain %_ptr_Function_float %c %uint_1
|
||||
%127 = OpLoad %float %126
|
||||
%129 = OpAccessChain %_ptr_Function_float %b_1 %uint_1
|
||||
%130 = OpLoad %float %129
|
||||
%131 = OpFSub %float %109 %112
|
||||
%132 = OpFSub %float %115 %118
|
||||
%133 = OpCompositeConstruct %v2float %131 %132
|
||||
OpStore %param_2 %133
|
||||
%134 = OpFSub %float %121 %124
|
||||
%135 = OpFSub %float %127 %130
|
||||
%136 = OpCompositeConstruct %v2float %134 %135
|
||||
OpStore %param_3 %136
|
||||
%137 = OpFunctionCall %float %cross2d_vf2_vf2_ %param_2 %param_3
|
||||
OpStore %pbc %137
|
||||
%141 = OpFOrdLessThan %bool %104 %float_0
|
||||
OpSelectionMerge %142 None
|
||||
OpBranchConditional %141 %143 %142
|
||||
%143 = OpLabel
|
||||
%144 = OpFOrdLessThan %bool %137 %float_0
|
||||
OpBranch %142
|
||||
%142 = OpLabel
|
||||
%145 = OpPhi %bool %141 %73 %144 %143
|
||||
OpStore %x_141_phi %145
|
||||
%146 = OpLogicalNot %bool %145
|
||||
OpSelectionMerge %147 None
|
||||
OpBranchConditional %146 %148 %147
|
||||
%148 = OpLabel
|
||||
%149 = OpFOrdGreaterThanEqual %bool %104 %float_0
|
||||
OpSelectionMerge %150 None
|
||||
OpBranchConditional %149 %151 %150
|
||||
%151 = OpLabel
|
||||
%152 = OpFOrdGreaterThanEqual %bool %137 %float_0
|
||||
OpBranch %150
|
||||
%150 = OpLabel
|
||||
%153 = OpPhi %bool %149 %148 %152 %151
|
||||
OpStore %x_140 %153
|
||||
%154 = OpLoad %bool %x_140
|
||||
OpStore %x_141_phi %154
|
||||
OpBranch %147
|
||||
%147 = OpLabel
|
||||
%155 = OpLoad %bool %x_141_phi
|
||||
%156 = OpLogicalNot %bool %155
|
||||
OpSelectionMerge %157 None
|
||||
OpBranchConditional %156 %158 %157
|
||||
%158 = OpLabel
|
||||
OpStore %x_90 %true
|
||||
OpStore %x_91 %int_0
|
||||
OpStore %x_173_phi %int_0
|
||||
OpBranch %72
|
||||
%157 = OpLabel
|
||||
%162 = OpAccessChain %_ptr_Function_float %p %uint_0
|
||||
%163 = OpLoad %float %162
|
||||
%165 = OpAccessChain %_ptr_Function_float %c %uint_0
|
||||
%166 = OpLoad %float %165
|
||||
%168 = OpAccessChain %_ptr_Function_float %p %uint_1
|
||||
%169 = OpLoad %float %168
|
||||
%171 = OpAccessChain %_ptr_Function_float %c %uint_1
|
||||
%172 = OpLoad %float %171
|
||||
%174 = OpAccessChain %_ptr_Function_float %a_1 %uint_0
|
||||
%175 = OpLoad %float %174
|
||||
%177 = OpAccessChain %_ptr_Function_float %c %uint_0
|
||||
%178 = OpLoad %float %177
|
||||
%180 = OpAccessChain %_ptr_Function_float %a_1 %uint_1
|
||||
%181 = OpLoad %float %180
|
||||
%183 = OpAccessChain %_ptr_Function_float %c %uint_1
|
||||
%184 = OpLoad %float %183
|
||||
%185 = OpFSub %float %163 %166
|
||||
%186 = OpFSub %float %169 %172
|
||||
%187 = OpCompositeConstruct %v2float %185 %186
|
||||
OpStore %param_4 %187
|
||||
%188 = OpFSub %float %175 %178
|
||||
%189 = OpFSub %float %181 %184
|
||||
%190 = OpCompositeConstruct %v2float %188 %189
|
||||
OpStore %param_5 %190
|
||||
%191 = OpFunctionCall %float %cross2d_vf2_vf2_ %param_4 %param_5
|
||||
OpStore %pca %191
|
||||
%194 = OpFOrdLessThan %bool %104 %float_0
|
||||
OpSelectionMerge %195 None
|
||||
OpBranchConditional %194 %196 %195
|
||||
%196 = OpLabel
|
||||
%197 = OpFOrdLessThan %bool %191 %float_0
|
||||
OpBranch %195
|
||||
%195 = OpLabel
|
||||
%198 = OpPhi %bool %194 %157 %197 %196
|
||||
OpStore %x_169_phi %198
|
||||
%199 = OpLogicalNot %bool %198
|
||||
OpSelectionMerge %200 None
|
||||
OpBranchConditional %199 %201 %200
|
||||
%201 = OpLabel
|
||||
%202 = OpFOrdGreaterThanEqual %bool %104 %float_0
|
||||
OpSelectionMerge %203 None
|
||||
OpBranchConditional %202 %204 %203
|
||||
%204 = OpLabel
|
||||
%205 = OpFOrdGreaterThanEqual %bool %191 %float_0
|
||||
OpBranch %203
|
||||
%203 = OpLabel
|
||||
%206 = OpPhi %bool %202 %201 %205 %204
|
||||
OpStore %x_168 %206
|
||||
%207 = OpLoad %bool %x_168
|
||||
OpStore %x_169_phi %207
|
||||
OpBranch %200
|
||||
%200 = OpLabel
|
||||
%208 = OpLoad %bool %x_169_phi
|
||||
%209 = OpLogicalNot %bool %208
|
||||
OpSelectionMerge %210 None
|
||||
OpBranchConditional %209 %211 %210
|
||||
%211 = OpLabel
|
||||
OpStore %x_90 %true
|
||||
OpStore %x_91 %int_0
|
||||
OpStore %x_173_phi %int_0
|
||||
OpBranch %72
|
||||
%210 = OpLabel
|
||||
OpStore %x_90 %true
|
||||
OpStore %x_91 %int_1
|
||||
OpStore %x_173_phi %int_1
|
||||
OpBranch %72
|
||||
%72 = OpLabel
|
||||
%213 = OpLoad %int %x_173_phi
|
||||
OpReturnValue %213
|
||||
OpFunctionEnd
|
||||
%main_1 = OpFunction %void None %214
|
||||
%217 = OpLabel
|
||||
%pos = OpVariable %_ptr_Function_v2float Function %59
|
||||
%param_6 = OpVariable %_ptr_Function_v2float Function %59
|
||||
%param_7 = OpVariable %_ptr_Function_v2float Function %59
|
||||
%param_8 = OpVariable %_ptr_Function_v2float Function %59
|
||||
%param_9 = OpVariable %_ptr_Function_v2float Function %59
|
||||
%223 = OpLoad %v4float %gl_FragCoord
|
||||
%225 = OpAccessChain %_ptr_Uniform_v2float %x_24 %uint_0
|
||||
%226 = OpLoad %v2float %225
|
||||
%227 = OpCompositeExtract %float %223 0
|
||||
%228 = OpCompositeExtract %float %223 1
|
||||
%229 = OpCompositeConstruct %v2float %227 %228
|
||||
%230 = OpFDiv %v2float %229 %226
|
||||
OpStore %pos %230
|
||||
OpStore %param_6 %230
|
||||
OpStore %param_7 %233
|
||||
OpStore %param_8 %236
|
||||
OpStore %param_9 %239
|
||||
%240 = OpFunctionCall %int %pointInTriangle_vf2_vf2_vf2_vf2_ %param_6 %param_7 %param_8 %param_9
|
||||
%245 = OpIEqual %bool %240 %int_1
|
||||
OpSelectionMerge %246 None
|
||||
OpBranchConditional %245 %247 %248
|
||||
%247 = OpLabel
|
||||
OpStore %x_GLF_color %250
|
||||
OpBranch %246
|
||||
%248 = OpLabel
|
||||
OpStore %x_GLF_color %251
|
||||
OpBranch %246
|
||||
%246 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%tint_symbol_3 = OpFunction %void None %252
|
||||
%tint_symbol_1 = OpFunctionParameter %main_out
|
||||
%256 = OpLabel
|
||||
%257 = OpCompositeExtract %v4float %tint_symbol_1 0
|
||||
OpStore %tint_symbol_2 %257
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %214
|
||||
%259 = OpLabel
|
||||
%260 = OpLoad %v4float %tint_symbol
|
||||
OpStore %gl_FragCoord %260
|
||||
%261 = OpFunctionCall %void %main_1
|
||||
%263 = OpLoad %v4float %x_GLF_color
|
||||
%264 = OpCompositeConstruct %main_out %263
|
||||
%262 = OpFunctionCall %void %tint_symbol_3 %264
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
Reference in New Issue
Block a user