mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-17 08:57:26 +00:00
Add support for increment/decrement statements
Refactor the ExpandCompoundAssignment transform to handle these statements, which delivers support for all of the non-WGSL backends. Fixed: tint:1488 Change-Id: I96cdc31851c61f6d92d296447d0b0637907d5fe5 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86004 Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
@@ -1,10 +1,44 @@
|
||||
SKIP: FAILED
|
||||
|
||||
|
||||
@group(0) @binding(0) var<storage, read_write> a : array<u32>;
|
||||
|
||||
fn main() {
|
||||
a[1]++;
|
||||
}
|
||||
|
||||
Failed to generate: Unknown statement: tint::ast::IncrementDecrementStatement
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 21
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
||||
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
||||
OpName %a_block "a_block"
|
||||
OpMemberName %a_block 0 "inner"
|
||||
OpName %a "a"
|
||||
OpName %unused_entry_point "unused_entry_point"
|
||||
OpName %main "main"
|
||||
OpDecorate %a_block Block
|
||||
OpMemberDecorate %a_block 0 Offset 0
|
||||
OpDecorate %_runtimearr_uint ArrayStride 4
|
||||
OpDecorate %a DescriptorSet 0
|
||||
OpDecorate %a Binding 0
|
||||
%uint = OpTypeInt 32 0
|
||||
%_runtimearr_uint = OpTypeRuntimeArray %uint
|
||||
%a_block = OpTypeStruct %_runtimearr_uint
|
||||
%_ptr_StorageBuffer_a_block = OpTypePointer StorageBuffer %a_block
|
||||
%a = OpVariable %_ptr_StorageBuffer_a_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%int = OpTypeInt 32 1
|
||||
%int_1 = OpConstant %int 1
|
||||
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%unused_entry_point = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %6
|
||||
%11 = OpLabel
|
||||
%16 = OpAccessChain %_ptr_StorageBuffer_uint %a %uint_0 %int_1
|
||||
%17 = OpAccessChain %_ptr_StorageBuffer_uint %a %uint_0 %int_1
|
||||
%18 = OpLoad %uint %17
|
||||
%20 = OpIAdd %uint %18 %uint_1
|
||||
OpStore %16 %20
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
Reference in New Issue
Block a user