mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-16 12:21:35 +00:00
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>
164 lines
6.8 KiB
Plaintext
164 lines
6.8 KiB
Plaintext
; SPIR-V
|
|
; Version: 1.3
|
|
; Generator: Google Tint Compiler; 0
|
|
; Bound: 108
|
|
; Schema: 0
|
|
OpCapability Shader
|
|
%66 = OpExtInstImport "GLSL.std.450"
|
|
OpMemoryModel Logical GLSL450
|
|
OpEntryPoint Fragment %main "main" %tint_symbol_1
|
|
OpExecutionMode %main OriginUpperLeft
|
|
OpName %buf0 "buf0"
|
|
OpMemberName %buf0 0 "x_GLF_uniform_int_values"
|
|
OpName %x_7 "x_7"
|
|
OpName %x_GLF_color "x_GLF_color"
|
|
OpName %tint_symbol_1 "tint_symbol_1"
|
|
OpName %main_1 "main_1"
|
|
OpName %S "S"
|
|
OpMemberName %S 0 "a"
|
|
OpMemberName %S 1 "b"
|
|
OpMemberName %S 2 "c"
|
|
OpName %A "A"
|
|
OpName %main_out "main_out"
|
|
OpMemberName %main_out 0 "x_GLF_color_1"
|
|
OpName %tint_symbol_2 "tint_symbol_2"
|
|
OpName %tint_symbol "tint_symbol"
|
|
OpName %main "main"
|
|
OpDecorate %buf0 Block
|
|
OpMemberDecorate %buf0 0 Offset 0
|
|
OpDecorate %_arr_int_uint_2 ArrayStride 16
|
|
OpDecorate %x_7 NonWritable
|
|
OpDecorate %x_7 DescriptorSet 0
|
|
OpDecorate %x_7 Binding 0
|
|
OpDecorate %tint_symbol_1 Location 0
|
|
OpMemberDecorate %S 0 Offset 0
|
|
OpMemberDecorate %S 1 Offset 4
|
|
OpMemberDecorate %S 2 Offset 8
|
|
OpDecorate %_arr_S_uint_2 ArrayStride 12
|
|
OpMemberDecorate %main_out 0 Offset 0
|
|
%int = OpTypeInt 32 1
|
|
%uint = OpTypeInt 32 0
|
|
%uint_2 = OpConstant %uint 2
|
|
%_arr_int_uint_2 = OpTypeArray %int %uint_2
|
|
%buf0 = OpTypeStruct %_arr_int_uint_2
|
|
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
|
|
%x_7 = OpVariable %_ptr_Uniform_buf0 Uniform
|
|
%float = OpTypeFloat 32
|
|
%v4float = OpTypeVector %float 4
|
|
%_ptr_Private_v4float = OpTypePointer Private %v4float
|
|
%12 = OpConstantNull %v4float
|
|
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %12
|
|
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
|
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
|
|
%void = OpTypeVoid
|
|
%15 = OpTypeFunction %void
|
|
%S = OpTypeStruct %int %int %int
|
|
%_arr_S_uint_2 = OpTypeArray %S %uint_2
|
|
%_ptr_Function__arr_S_uint_2 = OpTypePointer Function %_arr_S_uint_2
|
|
%23 = OpConstantNull %_arr_S_uint_2
|
|
%uint_0 = OpConstant %uint 0
|
|
%int_1 = OpConstant %int 1
|
|
%_ptr_Uniform_int = OpTypePointer Uniform %int
|
|
%_ptr_Function_S = OpTypePointer Function %S
|
|
%int_0 = OpConstant %int 0
|
|
%uint_1 = OpConstant %uint 1
|
|
%_ptr_Function_int = OpTypePointer Function %int
|
|
%bool = OpTypeBool
|
|
%int_2 = OpConstant %int 2
|
|
%main_out = OpTypeStruct %v4float
|
|
%96 = OpTypeFunction %void %main_out
|
|
%main_1 = OpFunction %void None %15
|
|
%18 = OpLabel
|
|
%A = OpVariable %_ptr_Function__arr_S_uint_2 Function %23
|
|
%27 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_1
|
|
%28 = OpLoad %int %27
|
|
%29 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_1
|
|
%30 = OpLoad %int %29
|
|
%31 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_1
|
|
%32 = OpLoad %int %31
|
|
%33 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_1
|
|
%34 = OpLoad %int %33
|
|
%36 = OpAccessChain %_ptr_Function_S %A %28
|
|
%37 = OpCompositeConstruct %S %30 %32 %34
|
|
OpStore %36 %37
|
|
%39 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_0
|
|
%40 = OpLoad %int %39
|
|
%41 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_1
|
|
%42 = OpLoad %int %41
|
|
%43 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_1
|
|
%44 = OpLoad %int %43
|
|
%45 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_1
|
|
%46 = OpLoad %int %45
|
|
%47 = OpAccessChain %_ptr_Function_S %A %40
|
|
%48 = OpCompositeConstruct %S %42 %44 %46
|
|
OpStore %47 %48
|
|
%49 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_1
|
|
%50 = OpLoad %int %49
|
|
%53 = OpAccessChain %_ptr_Function_int %A %50 %uint_1
|
|
%54 = OpLoad %int %53
|
|
%55 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_1
|
|
%56 = OpLoad %int %55
|
|
%57 = OpIEqual %bool %54 %56
|
|
OpSelectionMerge %59 None
|
|
OpBranchConditional %57 %60 %59
|
|
%60 = OpLabel
|
|
%61 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_1
|
|
%62 = OpLoad %int %61
|
|
%63 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_0
|
|
%64 = OpLoad %int %63
|
|
%65 = OpExtInst %int %66 SClamp %62 %int_1 %int_2
|
|
%68 = OpAccessChain %_ptr_Function_int %A %65 %uint_1
|
|
OpStore %68 %64
|
|
OpBranch %59
|
|
%59 = OpLabel
|
|
%69 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_0
|
|
%70 = OpLoad %int %69
|
|
%71 = OpAccessChain %_ptr_Function_int %A %70 %uint_1
|
|
%72 = OpLoad %int %71
|
|
%73 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_0
|
|
%74 = OpLoad %int %73
|
|
%75 = OpIEqual %bool %72 %74
|
|
OpSelectionMerge %76 None
|
|
OpBranchConditional %75 %77 %78
|
|
%77 = OpLabel
|
|
%79 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_0
|
|
%80 = OpLoad %int %79
|
|
%81 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_1
|
|
%82 = OpLoad %int %81
|
|
%83 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_1
|
|
%84 = OpLoad %int %83
|
|
%85 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_0
|
|
%86 = OpLoad %int %85
|
|
%87 = OpConvertSToF %float %80
|
|
%88 = OpConvertSToF %float %82
|
|
%89 = OpConvertSToF %float %84
|
|
%90 = OpConvertSToF %float %86
|
|
%91 = OpCompositeConstruct %v4float %87 %88 %89 %90
|
|
OpStore %x_GLF_color %91
|
|
OpBranch %76
|
|
%78 = OpLabel
|
|
%92 = OpAccessChain %_ptr_Uniform_int %x_7 %uint_0 %int_0
|
|
%93 = OpLoad %int %92
|
|
%94 = OpConvertSToF %float %93
|
|
%95 = OpCompositeConstruct %v4float %94 %94 %94 %94
|
|
OpStore %x_GLF_color %95
|
|
OpBranch %76
|
|
%76 = OpLabel
|
|
OpReturn
|
|
OpFunctionEnd
|
|
%tint_symbol_2 = OpFunction %void None %96
|
|
%tint_symbol = OpFunctionParameter %main_out
|
|
%100 = OpLabel
|
|
%101 = OpCompositeExtract %v4float %tint_symbol 0
|
|
OpStore %tint_symbol_1 %101
|
|
OpReturn
|
|
OpFunctionEnd
|
|
%main = OpFunction %void None %15
|
|
%103 = OpLabel
|
|
%104 = OpFunctionCall %void %main_1
|
|
%106 = OpLoad %v4float %x_GLF_color
|
|
%107 = OpCompositeConstruct %main_out %106
|
|
%105 = OpFunctionCall %void %tint_symbol_2 %107
|
|
OpReturn
|
|
OpFunctionEnd
|