mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-03 05:01:27 +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>
107 lines
3.9 KiB
Plaintext
107 lines
3.9 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 %makeFrame_ "makeFrame("
|
|
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 %7 RelaxedPrecision
|
|
OpDecorate %_GLF_color Location 0
|
|
OpDecorate %8 RelaxedPrecision
|
|
OpDecorate %9 RelaxedPrecision
|
|
%void = OpTypeVoid
|
|
%11 = OpTypeFunction %void
|
|
%float = OpTypeFloat 32
|
|
%13 = OpTypeFunction %float
|
|
%int = OpTypeInt 32 1
|
|
%int_0 = OpConstant %int 0
|
|
%int_1 = OpConstant %int 1
|
|
%bool = OpTypeBool
|
|
%v2float = OpTypeVector %float 2
|
|
%buf0 = OpTypeStruct %v2float
|
|
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
|
|
%_ = OpVariable %_ptr_Uniform_buf0 Uniform
|
|
%uint = OpTypeInt 32 0
|
|
%uint_1 = OpConstant %uint 1
|
|
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
|
%float_1 = OpConstant %float 1
|
|
%v4float = OpTypeVector %float 4
|
|
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
|
%_GLF_color = OpVariable %_ptr_Output_v4float Output
|
|
%float_0 = OpConstant %float 0
|
|
%27 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
|
|
%false = OpConstantFalse %bool
|
|
%true = OpConstantTrue %bool
|
|
%30 = OpUndef %float
|
|
%31 = OpUndef %bool
|
|
%32 = OpUndef %int
|
|
%main = OpFunction %void None %11
|
|
%33 = OpLabel
|
|
%34 = OpFunctionCall %float %makeFrame_
|
|
OpStore %_GLF_color %27
|
|
OpReturn
|
|
OpFunctionEnd
|
|
%makeFrame_ = OpFunction %float None %13
|
|
%35 = OpLabel
|
|
OpBranch %36
|
|
%36 = OpLabel
|
|
OpLoopMerge %37 %38 None
|
|
OpBranch %39
|
|
%39 = OpLabel
|
|
OpBranch %40
|
|
%40 = OpLabel
|
|
%41 = OpPhi %bool %false %39 %42 %43
|
|
%8 = OpPhi %int %int_0 %39 %7 %43
|
|
%44 = OpPhi %float %30 %39 %45 %43
|
|
%46 = OpSLessThan %bool %8 %int_1
|
|
OpLoopMerge %47 %43 None
|
|
OpBranchConditional %46 %48 %47
|
|
%48 = OpLabel
|
|
OpBranch %49
|
|
%49 = OpLabel
|
|
%50 = OpPhi %float %44 %48 %30 %51
|
|
%9 = OpPhi %int %8 %48 %32 %51
|
|
%52 = OpPhi %bool %41 %48 %31 %51
|
|
%53 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %uint_1
|
|
%54 = OpLoad %float %53
|
|
%55 = OpConvertFToS %int %54
|
|
%56 = OpSLessThan %bool %int_1 %55
|
|
OpLoopMerge %57 %51 None
|
|
OpBranchConditional %56 %58 %57
|
|
%58 = OpLabel
|
|
OpBranch %57
|
|
%51 = OpLabel
|
|
OpBranch %49
|
|
%57 = OpLabel
|
|
%45 = OpPhi %float %50 %49 %float_1 %58
|
|
%42 = OpPhi %bool %52 %49 %true %58
|
|
OpSelectionMerge %59 None
|
|
OpBranchConditional %42 %47 %59
|
|
%59 = OpLabel
|
|
OpBranch %43
|
|
%43 = OpLabel
|
|
%7 = OpIAdd %int %9 %int_1
|
|
OpBranch %40
|
|
%47 = OpLabel
|
|
%60 = OpPhi %float %44 %40 %45 %57
|
|
%61 = OpPhi %bool %41 %40 %42 %57
|
|
OpSelectionMerge %62 None
|
|
OpBranchConditional %61 %37 %62
|
|
%62 = OpLabel
|
|
OpBranch %37
|
|
%38 = OpLabel
|
|
OpBranch %36
|
|
%37 = OpLabel
|
|
%63 = OpPhi %float %60 %47 %float_1 %62
|
|
OpReturnValue %63
|
|
OpFunctionEnd
|