mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-13 19:01:24 +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>
37 lines
1.1 KiB
Plaintext
37 lines
1.1 KiB
Plaintext
; Test: SpvParserMemoryTest_ArrayLength_FromAccessChain.spvasm
|
|
; SPIR-V
|
|
; Version: 1.0
|
|
; Generator: Khronos SPIR-V Tools Assembler; 0
|
|
; Bound: 101
|
|
; Schema: 0
|
|
OpCapability Shader
|
|
OpMemoryModel Logical Simple
|
|
OpEntryPoint Fragment %100 "main"
|
|
OpExecutionMode %100 OriginUpperLeft
|
|
OpName %myvar "myvar"
|
|
OpMemberName %_struct_4 0 "first"
|
|
OpMemberName %_struct_4 1 "rtarr"
|
|
OpDecorate %_struct_4 Block
|
|
OpMemberDecorate %_struct_4 0 Offset 0
|
|
OpMemberDecorate %_struct_4 1 Offset 4
|
|
OpDecorate %_runtimearr_uint ArrayStride 4
|
|
OpDecorate %myvar DescriptorSet 0
|
|
OpDecorate %myvar Binding 0
|
|
%void = OpTypeVoid
|
|
%7 = OpTypeFunction %void
|
|
%uint = OpTypeInt 32 0
|
|
%uint_0 = OpConstant %uint 0
|
|
%uint_1 = OpConstant %uint 1
|
|
%_runtimearr_uint = OpTypeRuntimeArray %uint
|
|
%_struct_4 = OpTypeStruct %uint %_runtimearr_uint
|
|
%_ptr_StorageBuffer__struct_4 = OpTypePointer StorageBuffer %_struct_4
|
|
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
|
|
%myvar = OpVariable %_ptr_StorageBuffer__struct_4 StorageBuffer
|
|
%100 = OpFunction %void None %7
|
|
%13 = OpLabel
|
|
%2 = OpAccessChain %_ptr_StorageBuffer__struct_4 %myvar
|
|
%1 = OpArrayLength %uint %2 1
|
|
OpReturn
|
|
OpFunctionEnd
|
|
|