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>
128 lines
4.9 KiB
Plaintext
128 lines
4.9 KiB
Plaintext
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 %func_ "func("
|
|
OpName %_GLF_global_loop_count "_GLF_global_loop_count"
|
|
OpName %buf0 "buf0"
|
|
OpMemberName %buf0 0 "_GLF_uniform_int_values"
|
|
OpName %_ ""
|
|
OpName %a "a"
|
|
OpName %_GLF_color "_GLF_color"
|
|
OpDecorate %_arr_int_uint_3 ArrayStride 16
|
|
OpMemberDecorate %buf0 0 Offset 0
|
|
OpDecorate %buf0 Block
|
|
OpDecorate %_ DescriptorSet 0
|
|
OpDecorate %_ Binding 0
|
|
OpDecorate %_GLF_color Location 0
|
|
%void = OpTypeVoid
|
|
%11 = OpTypeFunction %void
|
|
%int = OpTypeInt 32 1
|
|
%13 = OpTypeFunction %int
|
|
%_ptr_Private_int = OpTypePointer Private %int
|
|
%_GLF_global_loop_count = OpVariable %_ptr_Private_int Private
|
|
%int_0 = OpConstant %int 0
|
|
%int_100 = OpConstant %int 100
|
|
%bool = OpTypeBool
|
|
%int_1 = OpConstant %int 1
|
|
%uint = OpTypeInt 32 0
|
|
%uint_3 = OpConstant %uint 3
|
|
%_arr_int_uint_3 = OpTypeArray %int %uint_3
|
|
%buf0 = OpTypeStruct %_arr_int_uint_3
|
|
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
|
|
%_ = OpVariable %_ptr_Uniform_buf0 Uniform
|
|
%_ptr_Uniform_int = OpTypePointer Uniform %int
|
|
%int_2 = OpConstant %int 2
|
|
%false = OpConstantFalse %bool
|
|
%true = OpConstantTrue %bool
|
|
%_ptr_Function_int = OpTypePointer Function %int
|
|
%float = OpTypeFloat 32
|
|
%v4float = OpTypeVector %float 4
|
|
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
|
%_GLF_color = OpVariable %_ptr_Output_v4float Output
|
|
%main = OpFunction %void None %11
|
|
%30 = OpLabel
|
|
%a = OpVariable %_ptr_Function_int Function
|
|
OpStore %_GLF_global_loop_count %int_0
|
|
OpBranch %31
|
|
%31 = OpLabel
|
|
OpLoopMerge %32 %33 None
|
|
OpBranch %34
|
|
%34 = OpLabel
|
|
%35 = OpLoad %int %_GLF_global_loop_count
|
|
%36 = OpIAdd %int %35 %int_1
|
|
OpStore %_GLF_global_loop_count %36
|
|
OpSelectionMerge %37 None
|
|
OpBranchConditional %false %38 %37
|
|
%38 = OpLabel
|
|
OpReturn
|
|
%37 = OpLabel
|
|
OpBranch %33
|
|
%33 = OpLabel
|
|
%39 = OpLoad %int %_GLF_global_loop_count
|
|
%40 = OpSLessThan %bool %39 %int_100
|
|
%41 = OpLogicalAnd %bool %true %40
|
|
OpBranchConditional %41 %31 %32
|
|
%32 = OpLabel
|
|
%42 = OpFunctionCall %int %func_
|
|
OpStore %a %42
|
|
%43 = OpLoad %int %a
|
|
%44 = OpAccessChain %_ptr_Uniform_int %_ %int_0 %int_2
|
|
%45 = OpLoad %int %44
|
|
%46 = OpIEqual %bool %43 %45
|
|
OpSelectionMerge %47 None
|
|
OpBranchConditional %46 %48 %49
|
|
%48 = OpLabel
|
|
%50 = OpAccessChain %_ptr_Uniform_int %_ %int_0 %int_0
|
|
%51 = OpLoad %int %50
|
|
%52 = OpConvertSToF %float %51
|
|
%53 = OpAccessChain %_ptr_Uniform_int %_ %int_0 %int_1
|
|
%54 = OpLoad %int %53
|
|
%55 = OpConvertSToF %float %54
|
|
%56 = OpAccessChain %_ptr_Uniform_int %_ %int_0 %int_1
|
|
%57 = OpLoad %int %56
|
|
%58 = OpConvertSToF %float %57
|
|
%59 = OpAccessChain %_ptr_Uniform_int %_ %int_0 %int_0
|
|
%60 = OpLoad %int %59
|
|
%61 = OpConvertSToF %float %60
|
|
%62 = OpCompositeConstruct %v4float %52 %55 %58 %61
|
|
OpStore %_GLF_color %62
|
|
OpBranch %47
|
|
%49 = OpLabel
|
|
%63 = OpAccessChain %_ptr_Uniform_int %_ %int_0 %int_1
|
|
%64 = OpLoad %int %63
|
|
%65 = OpConvertSToF %float %64
|
|
%66 = OpCompositeConstruct %v4float %65 %65 %65 %65
|
|
OpStore %_GLF_color %66
|
|
OpBranch %47
|
|
%47 = OpLabel
|
|
OpReturn
|
|
OpFunctionEnd
|
|
%func_ = OpFunction %int None %13
|
|
%67 = OpLabel
|
|
OpBranch %68
|
|
%68 = OpLabel
|
|
OpLoopMerge %69 %70 None
|
|
OpBranch %71
|
|
%71 = OpLabel
|
|
%72 = OpLoad %int %_GLF_global_loop_count
|
|
%73 = OpSLessThan %bool %72 %int_100
|
|
OpBranchConditional %73 %74 %69
|
|
%74 = OpLabel
|
|
%75 = OpLoad %int %_GLF_global_loop_count
|
|
%76 = OpIAdd %int %75 %int_1
|
|
OpStore %_GLF_global_loop_count %76
|
|
%77 = OpAccessChain %_ptr_Uniform_int %_ %int_0 %int_0
|
|
%78 = OpLoad %int %77
|
|
OpReturnValue %78
|
|
%70 = OpLabel
|
|
OpBranch %68
|
|
%69 = OpLabel
|
|
%79 = OpAccessChain %_ptr_Uniform_int %_ %int_0 %int_2
|
|
%80 = OpLoad %int %79
|
|
OpReturnValue %80
|
|
OpFunctionEnd
|