mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-14 03:11:29 +00:00
Add the unit tests samples from src/reader/spirv when: - they are valid for Vulkan 1.0 (plus some common extensions) - they should translate to valid WGSL Bug: tint:1043 Change-Id: I40a01990dbc40aff5cf7ace0b1aabfd0e437f638 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/60000 Commit-Queue: Ben Clayton <bclayton@google.com> Kokoro: David Neto <dneto@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Reviewed-by: James Price <jrprice@google.com>
52 lines
1.5 KiB
Plaintext
52 lines
1.5 KiB
Plaintext
; Test: SpvParserHandleTest_NeverGenerateConstDeclForHandle_UseVariableDirectly.spvasm
|
|
; SPIR-V
|
|
; Version: 1.0
|
|
; Generator: Khronos SPIR-V Tools Assembler; 0
|
|
; Bound: 101
|
|
; Schema: 0
|
|
OpCapability Shader
|
|
OpCapability Sampled1D
|
|
OpCapability Image1D
|
|
OpCapability StorageImageExtendedFormats
|
|
OpCapability ImageQuery
|
|
OpMemoryModel Logical Simple
|
|
OpEntryPoint Fragment %100 "main"
|
|
OpExecutionMode %100 OriginUpperLeft
|
|
OpName %var "var"
|
|
OpDecorate %2 DescriptorSet 0
|
|
OpDecorate %2 Binding 0
|
|
OpDecorate %3 DescriptorSet 0
|
|
OpDecorate %3 Binding 1
|
|
%float = OpTypeFloat 32
|
|
%v4float = OpTypeVector %float 4
|
|
%v2float = OpTypeVector %float 2
|
|
%7 = OpConstantNull %v2float
|
|
%8 = OpTypeImage %float 2D 0 0 0 1 Unknown
|
|
%9 = OpTypeSampledImage %8
|
|
%10 = OpTypeSampler
|
|
%_ptr_UniformConstant_8 = OpTypePointer UniformConstant %8
|
|
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
|
|
%2 = OpVariable %_ptr_UniformConstant_8 UniformConstant
|
|
%3 = OpVariable %_ptr_UniformConstant_10 UniformConstant
|
|
%void = OpTypeVoid
|
|
%14 = OpTypeFunction %void
|
|
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
|
%100 = OpFunction %void None %14
|
|
%16 = OpLabel
|
|
%var = OpVariable %_ptr_Function_v4float Function
|
|
%17 = OpCopyObject %_ptr_UniformConstant_8 %2
|
|
%18 = OpCopyObject %_ptr_UniformConstant_10 %3
|
|
%19 = OpLoad %8 %17
|
|
%20 = OpLoad %10 %18
|
|
%21 = OpSampledImage %9 %19 %20
|
|
%22 = OpImageSampleImplicitLod %v4float %21 %7
|
|
%23 = OpLoad %8 %17
|
|
%24 = OpLoad %10 %18
|
|
%25 = OpSampledImage %9 %23 %24
|
|
%26 = OpImageSampleImplicitLod %v4float %25 %7
|
|
%27 = OpFAdd %v4float %22 %26
|
|
OpStore %var %27
|
|
OpReturn
|
|
OpFunctionEnd
|
|
|