mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 02:39:11 +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
97
test/vk-gl-cts/graphicsfuzz/struct-array-index/0.spvasm
Normal file
97
test/vk-gl-cts/graphicsfuzz/struct-array-index/0.spvasm
Normal file
@@ -0,0 +1,97 @@
|
||||
OpCapability Shader
|
||||
%1 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %_GLF_color
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpSource ESSL 320
|
||||
OpName %main "main"
|
||||
OpName %struct_base "struct_base"
|
||||
OpMemberName %struct_base 0 "data"
|
||||
OpMemberName %struct_base 1 "leftIndex"
|
||||
OpMemberName %struct_base 2 "rightIndex"
|
||||
OpName %struct_array "struct_array"
|
||||
OpName %index "index"
|
||||
OpName %buf0 "buf0"
|
||||
OpMemberName %buf0 0 "injectionSwitch"
|
||||
OpName %_ ""
|
||||
OpName %_GLF_color "_GLF_color"
|
||||
OpMemberDecorate %buf0 0 Offset 0
|
||||
OpDecorate %buf0 Block
|
||||
OpDecorate %_ DescriptorSet 0
|
||||
OpDecorate %_ Binding 0
|
||||
OpDecorate %_GLF_color Location 0
|
||||
%void = OpTypeVoid
|
||||
%10 = OpTypeFunction %void
|
||||
%int = OpTypeInt 32 1
|
||||
%struct_base = OpTypeStruct %int %int %int
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_3 = OpConstant %uint 3
|
||||
%_arr_struct_base_uint_3 = OpTypeArray %struct_base %uint_3
|
||||
%_ptr_Private__arr_struct_base_uint_3 = OpTypePointer Private %_arr_struct_base_uint_3
|
||||
%struct_array = OpVariable %_ptr_Private__arr_struct_base_uint_3 Private
|
||||
%int_1 = OpConstant %int 1
|
||||
%17 = OpConstantComposite %struct_base %int_1 %int_1 %int_1
|
||||
%18 = OpConstantComposite %_arr_struct_base_uint_3 %17 %17 %17
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%int_2 = OpConstant %int 2
|
||||
%_ptr_Private_int = OpTypePointer Private %int
|
||||
%bool = OpTypeBool
|
||||
%float = OpTypeFloat 32
|
||||
%v2float = OpTypeVector %float 2
|
||||
%buf0 = OpTypeStruct %v2float
|
||||
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
|
||||
%_ = OpVariable %_ptr_Uniform_buf0 Uniform
|
||||
%int_0 = OpConstant %int 0
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%_GLF_color = OpVariable %_ptr_Output_v4float Output
|
||||
%float_1 = OpConstant %float 1
|
||||
%float_0 = OpConstant %float 0
|
||||
%34 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
|
||||
%35 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
|
||||
%main = OpFunction %void None %10
|
||||
%36 = OpLabel
|
||||
%index = OpVariable %_ptr_Function_int Function
|
||||
OpStore %struct_array %18
|
||||
OpStore %index %int_1
|
||||
%37 = OpAccessChain %_ptr_Private_int %struct_array %int_1 %int_2
|
||||
OpStore %37 %int_1
|
||||
%38 = OpAccessChain %_ptr_Private_int %struct_array %int_1 %int_1
|
||||
%39 = OpLoad %int %38
|
||||
%40 = OpIEqual %bool %39 %int_1
|
||||
OpSelectionMerge %41 None
|
||||
OpBranchConditional %40 %42 %43
|
||||
%42 = OpLabel
|
||||
%44 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %uint_0
|
||||
%45 = OpLoad %float %44
|
||||
%46 = OpConvertFToS %int %45
|
||||
%47 = OpAccessChain %_ptr_Private_int %struct_array %46 %int_2
|
||||
%48 = OpLoad %int %47
|
||||
OpStore %index %48
|
||||
OpBranch %41
|
||||
%43 = OpLabel
|
||||
%49 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %uint_1
|
||||
%50 = OpLoad %float %49
|
||||
%51 = OpConvertFToS %int %50
|
||||
%52 = OpAccessChain %_ptr_Private_int %struct_array %51 %int_1
|
||||
%53 = OpLoad %int %52
|
||||
OpStore %index %53
|
||||
OpBranch %41
|
||||
%41 = OpLabel
|
||||
%54 = OpAccessChain %_ptr_Private_int %struct_array %int_1 %int_1
|
||||
%55 = OpLoad %int %54
|
||||
%56 = OpIEqual %bool %55 %int_1
|
||||
OpSelectionMerge %57 None
|
||||
OpBranchConditional %56 %58 %59
|
||||
%58 = OpLabel
|
||||
OpStore %_GLF_color %34
|
||||
OpBranch %57
|
||||
%59 = OpLabel
|
||||
OpStore %_GLF_color %35
|
||||
OpBranch %57
|
||||
%57 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
Reference in New Issue
Block a user