mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-08 06:05:55 +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>
175 lines
7.1 KiB
Plaintext
175 lines
7.1 KiB
Plaintext
OpCapability Shader
|
|
%1 = OpExtInstImport "GLSL.std.450"
|
|
OpMemoryModel Logical GLSL450
|
|
OpEntryPoint Fragment %main "main" %gl_FragCoord %_GLF_color
|
|
OpExecutionMode %main OriginUpperLeft
|
|
OpSource ESSL 310
|
|
OpName %main "main"
|
|
OpName %a "a"
|
|
OpName %b "b"
|
|
OpName %gl_FragCoord "gl_FragCoord"
|
|
OpName %buf0 "buf0"
|
|
OpMemberName %buf0 0 "one"
|
|
OpName %_ ""
|
|
OpName %_GLF_color "_GLF_color"
|
|
OpDecorate %gl_FragCoord BuiltIn FragCoord
|
|
OpMemberDecorate %buf0 0 Offset 0
|
|
OpDecorate %buf0 Block
|
|
OpDecorate %_ DescriptorSet 0
|
|
OpDecorate %_ Binding 0
|
|
OpDecorate %_GLF_color Location 0
|
|
%void = OpTypeVoid
|
|
%10 = OpTypeFunction %void
|
|
%float = OpTypeFloat 32
|
|
%v2float = OpTypeVector %float 2
|
|
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
|
%float_1 = OpConstant %float 1
|
|
%15 = OpConstantComposite %v2float %float_1 %float_1
|
|
%v3float = OpTypeVector %float 3
|
|
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
|
%float_0 = OpConstant %float 0
|
|
%19 = OpConstantComposite %v3float %float_0 %float_0 %float_0
|
|
%v4float = OpTypeVector %float 4
|
|
%_ptr_Input_v4float = OpTypePointer Input %v4float
|
|
%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
|
|
%uint = OpTypeInt 32 0
|
|
%uint_1 = OpConstant %uint 1
|
|
%_ptr_Input_float = OpTypePointer Input %float
|
|
%int = OpTypeInt 32 1
|
|
%int_40 = OpConstant %int 40
|
|
%bool = OpTypeBool
|
|
%float_0_100000001 = OpConstant %float 0.100000001
|
|
%29 = OpConstantComposite %v3float %float_0_100000001 %float_0_100000001 %float_0_100000001
|
|
%int_60 = OpConstant %int 60
|
|
%float_0_200000003 = OpConstant %float 0.200000003
|
|
%32 = OpConstantComposite %v3float %float_0_200000003 %float_0_200000003 %float_0_200000003
|
|
%float_80 = OpConstant %float 80
|
|
%uint_0 = OpConstant %uint 0
|
|
%_ptr_Function_float = OpTypePointer Function %float
|
|
%buf0 = OpTypeStruct %float
|
|
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
|
|
%_ = OpVariable %_ptr_Uniform_buf0 Uniform
|
|
%int_0 = OpConstant %int 0
|
|
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
|
%float_0_00999999978 = OpConstant %float 0.00999999978
|
|
%int_100 = OpConstant %int 100
|
|
%int_500 = OpConstant %int 500
|
|
%float_0_540302277 = OpConstant %float 0.540302277
|
|
%float_n0_99996084 = OpConstant %float -0.99996084
|
|
%44 = OpConstantComposite %v3float %float_0_540302277 %float_0_540302277 %float_n0_99996084
|
|
%float_1_01999998 = OpConstant %float 1.01999998
|
|
%uint_2 = OpConstant %uint 2
|
|
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
|
%_GLF_color = OpVariable %_ptr_Output_v4float Output
|
|
%48 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
|
|
%49 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
|
|
%main = OpFunction %void None %10
|
|
%50 = OpLabel
|
|
%a = OpVariable %_ptr_Function_v2float Function
|
|
%b = OpVariable %_ptr_Function_v3float Function
|
|
OpStore %a %15
|
|
OpStore %b %19
|
|
%51 = OpAccessChain %_ptr_Input_float %gl_FragCoord %uint_1
|
|
%52 = OpLoad %float %51
|
|
%53 = OpConvertFToS %int %52
|
|
%54 = OpSLessThan %bool %53 %int_40
|
|
OpSelectionMerge %55 None
|
|
OpBranchConditional %54 %56 %57
|
|
%56 = OpLabel
|
|
OpStore %b %29
|
|
OpBranch %55
|
|
%57 = OpLabel
|
|
%58 = OpAccessChain %_ptr_Input_float %gl_FragCoord %uint_1
|
|
%59 = OpLoad %float %58
|
|
%60 = OpConvertFToS %int %59
|
|
%61 = OpSLessThan %bool %60 %int_60
|
|
OpSelectionMerge %62 None
|
|
OpBranchConditional %61 %63 %64
|
|
%63 = OpLabel
|
|
OpStore %b %32
|
|
OpBranch %62
|
|
%64 = OpLabel
|
|
%65 = OpAccessChain %_ptr_Input_float %gl_FragCoord %uint_1
|
|
%66 = OpLoad %float %65
|
|
%67 = OpFOrdLessThan %bool %66 %float_80
|
|
OpSelectionMerge %68 None
|
|
OpBranchConditional %67 %69 %70
|
|
%69 = OpLabel
|
|
%71 = OpAccessChain %_ptr_Function_float %a %uint_0
|
|
%72 = OpLoad %float %71
|
|
%73 = OpAccessChain %_ptr_Uniform_float %_ %int_0
|
|
%74 = OpLoad %float %73
|
|
%75 = OpCompositeConstruct %v3float %74 %74 %74
|
|
%76 = OpCompositeConstruct %v3float %72 %72 %72
|
|
%77 = OpFAdd %v3float %76 %75
|
|
%78 = OpExtInst %v3float %1 Cos %77
|
|
%79 = OpCompositeConstruct %v3float %float_0_00999999978 %float_0_00999999978 %float_0_00999999978
|
|
%80 = OpFAdd %v3float %78 %79
|
|
OpStore %b %80
|
|
OpBranch %68
|
|
%70 = OpLabel
|
|
%81 = OpAccessChain %_ptr_Input_float %gl_FragCoord %uint_1
|
|
%82 = OpLoad %float %81
|
|
%83 = OpConvertFToS %int %82
|
|
%84 = OpSLessThan %bool %83 %int_100
|
|
OpSelectionMerge %85 None
|
|
OpBranchConditional %84 %86 %87
|
|
%86 = OpLabel
|
|
%88 = OpAccessChain %_ptr_Uniform_float %_ %int_0
|
|
%89 = OpLoad %float %88
|
|
%90 = OpCompositeConstruct %v3float %89 %89 %89
|
|
%91 = OpExtInst %v3float %1 Cos %90
|
|
OpStore %b %91
|
|
OpBranch %85
|
|
%87 = OpLabel
|
|
%92 = OpAccessChain %_ptr_Input_float %gl_FragCoord %uint_1
|
|
%93 = OpLoad %float %92
|
|
%94 = OpConvertFToS %int %93
|
|
%95 = OpSLessThan %bool %94 %int_500
|
|
OpSelectionMerge %96 None
|
|
OpBranchConditional %95 %97 %96
|
|
%97 = OpLabel
|
|
OpStore %b %44
|
|
OpBranch %96
|
|
%96 = OpLabel
|
|
OpBranch %85
|
|
%85 = OpLabel
|
|
OpBranch %68
|
|
%68 = OpLabel
|
|
OpBranch %62
|
|
%62 = OpLabel
|
|
OpBranch %55
|
|
%55 = OpLabel
|
|
%98 = OpAccessChain %_ptr_Function_float %b %uint_0
|
|
%99 = OpLoad %float %98
|
|
%100 = OpFOrdLessThan %bool %99 %float_1_01999998
|
|
OpSelectionMerge %101 None
|
|
OpBranchConditional %100 %102 %101
|
|
%102 = OpLabel
|
|
%103 = OpAccessChain %_ptr_Function_float %b %uint_1
|
|
%104 = OpLoad %float %103
|
|
%105 = OpFOrdLessThan %bool %104 %float_1_01999998
|
|
OpBranch %101
|
|
%101 = OpLabel
|
|
%106 = OpPhi %bool %100 %55 %105 %102
|
|
OpSelectionMerge %107 None
|
|
OpBranchConditional %106 %108 %107
|
|
%108 = OpLabel
|
|
%109 = OpAccessChain %_ptr_Function_float %b %uint_2
|
|
%110 = OpLoad %float %109
|
|
%111 = OpFOrdLessThan %bool %110 %float_1_01999998
|
|
OpBranch %107
|
|
%107 = OpLabel
|
|
%112 = OpPhi %bool %106 %101 %111 %108
|
|
OpSelectionMerge %113 None
|
|
OpBranchConditional %112 %114 %115
|
|
%114 = OpLabel
|
|
OpStore %_GLF_color %48
|
|
OpBranch %113
|
|
%115 = OpLabel
|
|
OpStore %_GLF_color %49
|
|
OpBranch %113
|
|
%113 = OpLabel
|
|
OpReturn
|
|
OpFunctionEnd
|