mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-05 06:03:34 +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>
145 lines
5.5 KiB
Plaintext
145 lines
5.5 KiB
Plaintext
; SPIR-V
|
|
; Version: 1.3
|
|
; Generator: Google Tint Compiler; 0
|
|
; Bound: 81
|
|
; Schema: 0
|
|
OpCapability Shader
|
|
OpMemoryModel Logical GLSL450
|
|
OpEntryPoint GLCompute %main "main" %tint_symbol
|
|
OpExecutionMode %main LocalSize 16 1 1
|
|
OpName %gl_LocalInvocationID "gl_LocalInvocationID"
|
|
OpName %doesNotMatter "doesNotMatter"
|
|
OpMemberName %doesNotMatter 0 "global_seed"
|
|
OpMemberName %doesNotMatter 1 "data"
|
|
OpName %x_7 "x_7"
|
|
OpName %buf1 "buf1"
|
|
OpMemberName %buf1 0 "injectionSwitch"
|
|
OpName %x_10 "x_10"
|
|
OpName %tint_symbol "tint_symbol"
|
|
OpName %main_1 "main_1"
|
|
OpName %lid "lid"
|
|
OpName %val "val"
|
|
OpName %i "i"
|
|
OpName %main "main"
|
|
OpDecorate %doesNotMatter Block
|
|
OpMemberDecorate %doesNotMatter 0 Offset 0
|
|
OpMemberDecorate %doesNotMatter 1 Offset 4
|
|
OpDecorate %_runtimearr_int ArrayStride 4
|
|
OpDecorate %x_7 DescriptorSet 0
|
|
OpDecorate %x_7 Binding 0
|
|
OpDecorate %buf1 Block
|
|
OpMemberDecorate %buf1 0 Offset 0
|
|
OpDecorate %x_10 NonWritable
|
|
OpDecorate %x_10 DescriptorSet 0
|
|
OpDecorate %x_10 Binding 1
|
|
OpDecorate %tint_symbol BuiltIn LocalInvocationId
|
|
%uint = OpTypeInt 32 0
|
|
%v3uint = OpTypeVector %uint 3
|
|
%_ptr_Private_v3uint = OpTypePointer Private %v3uint
|
|
%5 = OpConstantNull %v3uint
|
|
%gl_LocalInvocationID = OpVariable %_ptr_Private_v3uint Private %5
|
|
%int = OpTypeInt 32 1
|
|
%_runtimearr_int = OpTypeRuntimeArray %int
|
|
%doesNotMatter = OpTypeStruct %int %_runtimearr_int
|
|
%_ptr_StorageBuffer_doesNotMatter = OpTypePointer StorageBuffer %doesNotMatter
|
|
%x_7 = OpVariable %_ptr_StorageBuffer_doesNotMatter StorageBuffer
|
|
%float = OpTypeFloat 32
|
|
%v2float = OpTypeVector %float 2
|
|
%buf1 = OpTypeStruct %v2float
|
|
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
|
|
%x_10 = OpVariable %_ptr_Uniform_buf1 Uniform
|
|
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
|
|
%tint_symbol = OpVariable %_ptr_Input_v3uint Input
|
|
%void = OpTypeVoid
|
|
%18 = OpTypeFunction %void
|
|
%_ptr_Function_int = OpTypePointer Function %int
|
|
%24 = OpConstantNull %int
|
|
%uint_0 = OpConstant %uint 0
|
|
%_ptr_Private_uint = OpTypePointer Private %uint
|
|
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
|
|
%int_0 = OpConstant %int 0
|
|
%int_2 = OpConstant %int 2
|
|
%bool = OpTypeBool
|
|
%uint_1 = OpConstant %uint 1
|
|
%int_1 = OpConstant %int 1
|
|
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
|
%float_100 = OpConstant %float 100
|
|
%uint_2 = OpConstant %uint 2
|
|
%uint_264 = OpConstant %uint 264
|
|
%int_42 = OpConstant %int 42
|
|
%main_1 = OpFunction %void None %18
|
|
%21 = OpLabel
|
|
%lid = OpVariable %_ptr_Function_int Function %24
|
|
%val = OpVariable %_ptr_Function_int Function %24
|
|
%i = OpVariable %_ptr_Function_int Function %24
|
|
%29 = OpAccessChain %_ptr_Private_uint %gl_LocalInvocationID %uint_0
|
|
%30 = OpLoad %uint %29
|
|
%31 = OpBitcast %int %30
|
|
OpStore %lid %31
|
|
%33 = OpAccessChain %_ptr_StorageBuffer_int %x_7 %uint_0
|
|
%34 = OpLoad %int %33
|
|
OpStore %val %34
|
|
OpStore %i %int_0
|
|
OpBranch %36
|
|
%36 = OpLabel
|
|
OpLoopMerge %37 %38 None
|
|
OpBranch %39
|
|
%39 = OpLabel
|
|
%40 = OpLoad %int %i
|
|
%42 = OpSLessThan %bool %40 %int_2
|
|
OpSelectionMerge %44 None
|
|
OpBranchConditional %42 %45 %46
|
|
%45 = OpLabel
|
|
OpBranch %44
|
|
%46 = OpLabel
|
|
OpBranch %37
|
|
%44 = OpLabel
|
|
%47 = OpLoad %int %lid
|
|
%48 = OpSGreaterThan %bool %47 %int_0
|
|
OpSelectionMerge %49 None
|
|
OpBranchConditional %48 %50 %49
|
|
%50 = OpLabel
|
|
%51 = OpLoad %int %lid
|
|
%54 = OpISub %int %51 %int_1
|
|
%55 = OpAccessChain %_ptr_StorageBuffer_int %x_7 %uint_1 %54
|
|
%56 = OpLoad %int %55
|
|
%57 = OpLoad %int %val
|
|
%58 = OpIAdd %int %57 %56
|
|
OpStore %val %58
|
|
%60 = OpAccessChain %_ptr_Uniform_float %x_10 %uint_0 %uint_0
|
|
%61 = OpLoad %float %60
|
|
%63 = OpFOrdGreaterThan %bool %61 %float_100
|
|
OpSelectionMerge %64 None
|
|
OpBranchConditional %63 %65 %64
|
|
%65 = OpLabel
|
|
OpBranch %37
|
|
%64 = OpLabel
|
|
OpBranch %49
|
|
%49 = OpLabel
|
|
OpControlBarrier %uint_2 %uint_2 %uint_264
|
|
OpBranch %38
|
|
%38 = OpLabel
|
|
%69 = OpLoad %int %i
|
|
%70 = OpIAdd %int %69 %int_1
|
|
OpStore %i %70
|
|
OpBranch %36
|
|
%37 = OpLabel
|
|
%71 = OpLoad %int %lid
|
|
%72 = OpIEqual %bool %71 %int_0
|
|
OpSelectionMerge %73 None
|
|
OpBranchConditional %72 %74 %73
|
|
%74 = OpLabel
|
|
%75 = OpAccessChain %_ptr_StorageBuffer_int %x_7 %uint_1 %int_0
|
|
OpStore %75 %int_42
|
|
OpBranch %73
|
|
%73 = OpLabel
|
|
OpReturn
|
|
OpFunctionEnd
|
|
%main = OpFunction %void None %18
|
|
%78 = OpLabel
|
|
%79 = OpLoad %v3uint %tint_symbol
|
|
OpStore %gl_LocalInvocationID %79
|
|
%80 = OpFunctionCall %void %main_1
|
|
OpReturn
|
|
OpFunctionEnd
|