mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-16 04:11:25 +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>
102 lines
3.7 KiB
Plaintext
102 lines
3.7 KiB
Plaintext
OpCapability Shader
|
|
%1 = OpExtInstImport "GLSL.std.450"
|
|
OpMemoryModel Logical GLSL450
|
|
OpEntryPoint Fragment %main "main" %_GLF_color
|
|
OpExecutionMode %main OriginUpperLeft
|
|
OpSource ESSL 310
|
|
OpName %main "main"
|
|
OpName %j "j"
|
|
OpName %_GLF_color "_GLF_color"
|
|
OpName %a "a"
|
|
OpDecorate %j RelaxedPrecision
|
|
OpDecorate %6 RelaxedPrecision
|
|
OpDecorate %7 RelaxedPrecision
|
|
OpDecorate %_GLF_color Location 0
|
|
OpDecorate %8 RelaxedPrecision
|
|
OpDecorate %9 RelaxedPrecision
|
|
OpDecorate %10 RelaxedPrecision
|
|
OpDecorate %11 RelaxedPrecision
|
|
OpDecorate %12 RelaxedPrecision
|
|
%void = OpTypeVoid
|
|
%14 = OpTypeFunction %void
|
|
%int = OpTypeInt 32 1
|
|
%_ptr_Function_int = OpTypePointer Function %int
|
|
%int_0 = OpConstant %int 0
|
|
%int_2 = OpConstant %int 2
|
|
%bool = OpTypeBool
|
|
%int_1 = OpConstant %int 1
|
|
%float = OpTypeFloat 32
|
|
%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
|
|
%26 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
|
|
%int_3 = OpConstant %int 3
|
|
%int_4 = OpConstant %int 4
|
|
%int_5 = OpConstant %int 5
|
|
%uint = OpTypeInt 32 0
|
|
%uint_0 = OpConstant %uint 0
|
|
%_ptr_Output_float = OpTypePointer Output %float
|
|
%_ptr_Function_float = OpTypePointer Function %float
|
|
%main = OpFunction %void None %14
|
|
%34 = OpLabel
|
|
%j = OpVariable %_ptr_Function_int Function
|
|
%a = OpVariable %_ptr_Function_float Function
|
|
OpStore %j %int_0
|
|
OpBranch %35
|
|
%35 = OpLabel
|
|
OpLoopMerge %36 %37 None
|
|
OpBranch %38
|
|
%38 = OpLabel
|
|
%6 = OpLoad %int %j
|
|
%39 = OpSLessThan %bool %6 %int_2
|
|
OpBranchConditional %39 %40 %36
|
|
%40 = OpLabel
|
|
%7 = OpLoad %int %j
|
|
%41 = OpSLessThan %bool %7 %int_1
|
|
OpSelectionMerge %42 None
|
|
OpBranchConditional %41 %43 %42
|
|
%43 = OpLabel
|
|
OpStore %_GLF_color %26
|
|
OpBranch %42
|
|
%42 = OpLabel
|
|
%8 = OpLoad %int %j
|
|
%44 = OpINotEqual %bool %8 %int_3
|
|
OpSelectionMerge %45 None
|
|
OpBranchConditional %44 %46 %45
|
|
%46 = OpLabel
|
|
%9 = OpLoad %int %j
|
|
%47 = OpINotEqual %bool %9 %int_4
|
|
OpSelectionMerge %48 None
|
|
OpBranchConditional %47 %49 %48
|
|
%49 = OpLabel
|
|
%10 = OpLoad %int %j
|
|
%50 = OpIEqual %bool %10 %int_5
|
|
OpSelectionMerge %51 None
|
|
OpBranchConditional %50 %52 %53
|
|
%52 = OpLabel
|
|
%54 = OpExtInst %float %1 Ldexp %float_1 %int_2
|
|
%55 = OpAccessChain %_ptr_Output_float %_GLF_color %uint_0
|
|
OpStore %55 %54
|
|
OpBranch %51
|
|
%53 = OpLabel
|
|
%56 = OpExtInst %float %1 Ldexp %float_1 %int_2
|
|
OpStore %a %56
|
|
OpStore %_GLF_color %26
|
|
OpBranch %51
|
|
%51 = OpLabel
|
|
OpBranch %48
|
|
%48 = OpLabel
|
|
OpBranch %45
|
|
%45 = OpLabel
|
|
OpBranch %37
|
|
%37 = OpLabel
|
|
%11 = OpLoad %int %j
|
|
%12 = OpIAdd %int %11 %int_1
|
|
OpStore %j %12
|
|
OpBranch %35
|
|
%36 = OpLabel
|
|
OpReturn
|
|
OpFunctionEnd
|