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:
James Price
2022-04-07 13:42:45 +00:00
parent b02fe31e46
commit d68d3a9809
76 changed files with 2052 additions and 838 deletions

View File

@@ -1,10 +1,13 @@
SKIP: FAILED
#version 310 es
@group(0) @binding(0) var<storage, read_write> a : array<u32>;
fn main() {
a[1]--;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
layout(binding = 0, std430) buffer a_block_1 {
uint inner[];
} a;
void tint_symbol() {
a.inner[1] = (a.inner[1] - 1u);
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,10 +1,10 @@
SKIP: FAILED
@group(0) @binding(0) var<storage, read_write> a : array<u32>;
fn main() {
a[1]--;
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
Failed to generate: error: cannot modify value of type 'u32'
RWByteAddressBuffer a : register(u0, space0);
void main() {
a.Store(4u, asuint((a.Load(4u) - 1u)));
}

View File

@@ -1,10 +1,7 @@
SKIP: FAILED
#include <metal_stdlib>
@group(0) @binding(0) var<storage, read_write> a : array<u32>;
fn tint_symbol() {
a[1]--;
using namespace metal;
void tint_symbol(device uint (*const tint_symbol_2)[1]) {
(*(tint_symbol_2))[1] = ((*(tint_symbol_2))[1] - 1u);
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -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 = OpISub %uint %18 %uint_1
OpStore %16 %20
OpReturn
OpFunctionEnd

View File

@@ -1,47 +1,70 @@
SKIP: FAILED
#version 310 es
struct S {
a : array<vec4<i32>, 4>,
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
struct S {
ivec4 a[4];
};
@group(0) @binding(0) var<storage, read_write> buffer : array<S>;
var<private> v : u32;
fn idx1() -> i32 {
v--;
layout(binding = 0, std430) buffer tint_symbol_block_1 {
S inner[];
} tint_symbol;
uint v = 0u;
int idx1() {
v = (v - 1u);
return 1;
}
fn idx2() -> i32 {
v--;
int idx2() {
v = (v - 1u);
return 2;
}
fn idx3() -> i32 {
v--;
int idx3() {
v = (v - 1u);
return 3;
}
fn idx4() -> i32 {
v--;
int idx4() {
v = (v - 1u);
return 4;
}
fn idx5() -> i32 {
v--;
int idx5() {
v = (v - 1u);
return 0;
}
fn idx6() -> i32 {
v--;
int idx6() {
v = (v - 1u);
return 2;
}
fn main() {
for(buffer[idx1()].a[idx2()][idx3()]--; (v < 10u); buffer[idx4()].a[idx5()][idx6()]--) {
void tint_symbol_1() {
int tint_symbol_6 = idx1();
int tint_symbol_7 = idx2();
int tint_symbol_2_save = tint_symbol_6;
int tint_symbol_2_save_1 = tint_symbol_7;
int tint_symbol_3 = idx3();
{
tint_symbol.inner[tint_symbol_2_save].a[tint_symbol_2_save_1][tint_symbol_3] = (tint_symbol.inner[tint_symbol_2_save].a[tint_symbol_2_save_1][tint_symbol_3] - 1);
while (true) {
if (!((v < 10u))) {
break;
}
{
}
{
int tint_symbol_8 = idx4();
int tint_symbol_9 = idx5();
int tint_symbol_4_save = tint_symbol_8;
int tint_symbol_4_save_1 = tint_symbol_9;
int tint_symbol_5 = idx6();
tint_symbol.inner[tint_symbol_4_save].a[tint_symbol_4_save_1][tint_symbol_5] = (tint_symbol.inner[tint_symbol_4_save].a[tint_symbol_4_save_1][tint_symbol_5] - 1);
}
}
}
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,47 +1,63 @@
SKIP: FAILED
struct S {
a : array<vec4<i32>, 4>,
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
@group(0) @binding(0) var<storage, read_write> buffer : array<S>;
RWByteAddressBuffer buffer : register(u0, space0);
static uint v = 0u;
var<private> v : u32;
fn idx1() -> i32 {
v--;
int idx1() {
v = (v - 1u);
return 1;
}
fn idx2() -> i32 {
v--;
int idx2() {
v = (v - 1u);
return 2;
}
fn idx3() -> i32 {
v--;
int idx3() {
v = (v - 1u);
return 3;
}
fn idx4() -> i32 {
v--;
int idx4() {
v = (v - 1u);
return 4;
}
fn idx5() -> i32 {
v--;
int idx5() {
v = (v - 1u);
return 0;
}
fn idx6() -> i32 {
v--;
int idx6() {
v = (v - 1u);
return 2;
}
fn main() {
for(buffer[idx1()].a[idx2()][idx3()]--; (v < 10u); buffer[idx4()].a[idx5()][idx6()]--) {
void main() {
const int tint_symbol_4 = idx1();
const int tint_symbol_5 = idx2();
const int tint_symbol_save = tint_symbol_4;
const int tint_symbol_save_1 = tint_symbol_5;
const int tint_symbol_1 = idx3();
{
buffer.Store((((64u * uint(tint_symbol_save)) + (16u * uint(tint_symbol_save_1))) + (4u * uint(tint_symbol_1))), asuint((asint(buffer.Load((((64u * uint(tint_symbol_save)) + (16u * uint(tint_symbol_save_1))) + (4u * uint(tint_symbol_1))))) - 1)));
[loop] while (true) {
if (!((v < 10u))) {
break;
}
{
}
{
const int tint_symbol_6 = idx4();
const int tint_symbol_7 = idx5();
const int tint_symbol_2_save = tint_symbol_6;
const int tint_symbol_2_save_1 = tint_symbol_7;
const int tint_symbol_3 = idx6();
buffer.Store((((64u * uint(tint_symbol_2_save)) + (16u * uint(tint_symbol_2_save_1))) + (4u * uint(tint_symbol_3))), asuint((asint(buffer.Load((((64u * uint(tint_symbol_2_save)) + (16u * uint(tint_symbol_2_save_1))) + (4u * uint(tint_symbol_3))))) - 1)));
}
}
}
}
Failed to generate: error: cannot modify value of type 'i32'

View File

@@ -1,47 +1,67 @@
SKIP: FAILED
#include <metal_stdlib>
using namespace metal;
struct tint_array_wrapper {
/* 0x0000 */ int4 arr[4];
};
struct S {
a : array<vec4<i32>, 4>,
}
/* 0x0000 */ tint_array_wrapper a;
};
@group(0) @binding(0) var<storage, read_write> tint_symbol : array<S>;
var<private> v : u32;
fn idx1() -> i32 {
v--;
int idx1(thread uint* const tint_symbol_10) {
*(tint_symbol_10) = (*(tint_symbol_10) - 1u);
return 1;
}
fn idx2() -> i32 {
v--;
int idx2(thread uint* const tint_symbol_11) {
*(tint_symbol_11) = (*(tint_symbol_11) - 1u);
return 2;
}
fn idx3() -> i32 {
v--;
int idx3(thread uint* const tint_symbol_12) {
*(tint_symbol_12) = (*(tint_symbol_12) - 1u);
return 3;
}
fn idx4() -> i32 {
v--;
int idx4(thread uint* const tint_symbol_13) {
*(tint_symbol_13) = (*(tint_symbol_13) - 1u);
return 4;
}
fn idx5() -> i32 {
v--;
int idx5(thread uint* const tint_symbol_14) {
*(tint_symbol_14) = (*(tint_symbol_14) - 1u);
return 0;
}
fn idx6() -> i32 {
v--;
int idx6(thread uint* const tint_symbol_15) {
*(tint_symbol_15) = (*(tint_symbol_15) - 1u);
return 2;
}
fn tint_symbol_1() {
for(tint_symbol[idx1()].a[idx2()][idx3()]--; (v < 10u); tint_symbol[idx4()].a[idx5()][idx6()]--) {
void tint_symbol_1(thread uint* const tint_symbol_16, device S (*const tint_symbol_17)[1]) {
int const tint_symbol_6 = idx1(tint_symbol_16);
int const tint_symbol_7 = idx2(tint_symbol_16);
int const tint_symbol_2_save = tint_symbol_6;
int const tint_symbol_2_save_1 = tint_symbol_7;
int const tint_symbol_3 = idx3(tint_symbol_16);
{
(*(tint_symbol_17))[tint_symbol_2_save].a.arr[tint_symbol_2_save_1][tint_symbol_3] = as_type<int>((as_type<uint>((*(tint_symbol_17))[tint_symbol_2_save].a.arr[tint_symbol_2_save_1][tint_symbol_3]) - as_type<uint>(1)));
while (true) {
if (!((*(tint_symbol_16) < 10u))) {
break;
}
{
}
{
int const tint_symbol_8 = idx4(tint_symbol_16);
int const tint_symbol_9 = idx5(tint_symbol_16);
int const tint_symbol_4_save = tint_symbol_8;
int const tint_symbol_4_save_1 = tint_symbol_9;
int const tint_symbol_5 = idx6(tint_symbol_16);
(*(tint_symbol_17))[tint_symbol_4_save].a.arr[tint_symbol_4_save_1][tint_symbol_5] = as_type<int>((as_type<uint>((*(tint_symbol_17))[tint_symbol_4_save].a.arr[tint_symbol_4_save_1][tint_symbol_5]) - as_type<uint>(1)));
}
}
}
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,47 +1,139 @@
SKIP: FAILED
struct S {
a : array<vec4<i32>, 4>,
}
@group(0) @binding(0) var<storage, read_write> buffer : array<S>;
var<private> v : u32;
fn idx1() -> i32 {
v--;
return 1;
}
fn idx2() -> i32 {
v--;
return 2;
}
fn idx3() -> i32 {
v--;
return 3;
}
fn idx4() -> i32 {
v--;
return 4;
}
fn idx5() -> i32 {
v--;
return 0;
}
fn idx6() -> i32 {
v--;
return 2;
}
fn main() {
for(buffer[idx1()].a[idx2()][idx3()]--; (v < 10u); buffer[idx4()].a[idx5()][idx6()]--) {
}
}
Failed to generate: Unknown statement: tint::ast::IncrementDecrementStatement
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 78
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %buffer_block "buffer_block"
OpMemberName %buffer_block 0 "inner"
OpName %S "S"
OpMemberName %S 0 "a"
OpName %buffer "buffer"
OpName %v "v"
OpName %unused_entry_point "unused_entry_point"
OpName %idx1 "idx1"
OpName %idx2 "idx2"
OpName %idx3 "idx3"
OpName %idx4 "idx4"
OpName %idx5 "idx5"
OpName %idx6 "idx6"
OpName %main "main"
OpDecorate %buffer_block Block
OpMemberDecorate %buffer_block 0 Offset 0
OpMemberDecorate %S 0 Offset 0
OpDecorate %_arr_v4int_uint_4 ArrayStride 16
OpDecorate %_runtimearr_S ArrayStride 64
OpDecorate %buffer DescriptorSet 0
OpDecorate %buffer Binding 0
%int = OpTypeInt 32 1
%v4int = OpTypeVector %int 4
%uint = OpTypeInt 32 0
%uint_4 = OpConstant %uint 4
%_arr_v4int_uint_4 = OpTypeArray %v4int %uint_4
%S = OpTypeStruct %_arr_v4int_uint_4
%_runtimearr_S = OpTypeRuntimeArray %S
%buffer_block = OpTypeStruct %_runtimearr_S
%_ptr_StorageBuffer_buffer_block = OpTypePointer StorageBuffer %buffer_block
%buffer = OpVariable %_ptr_StorageBuffer_buffer_block StorageBuffer
%_ptr_Private_uint = OpTypePointer Private %uint
%13 = OpConstantNull %uint
%v = OpVariable %_ptr_Private_uint Private %13
%void = OpTypeVoid
%14 = OpTypeFunction %void
%18 = OpTypeFunction %int
%uint_1 = OpConstant %uint 1
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%int_0 = OpConstant %int 0
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%uint_10 = OpConstant %uint 10
%bool = OpTypeBool
%unused_entry_point = OpFunction %void None %14
%17 = OpLabel
OpReturn
OpFunctionEnd
%idx1 = OpFunction %int None %18
%20 = OpLabel
%21 = OpLoad %uint %v
%23 = OpISub %uint %21 %uint_1
OpStore %v %23
OpReturnValue %int_1
OpFunctionEnd
%idx2 = OpFunction %int None %18
%26 = OpLabel
%27 = OpLoad %uint %v
%28 = OpISub %uint %27 %uint_1
OpStore %v %28
OpReturnValue %int_2
OpFunctionEnd
%idx3 = OpFunction %int None %18
%31 = OpLabel
%32 = OpLoad %uint %v
%33 = OpISub %uint %32 %uint_1
OpStore %v %33
OpReturnValue %int_3
OpFunctionEnd
%idx4 = OpFunction %int None %18
%36 = OpLabel
%37 = OpLoad %uint %v
%38 = OpISub %uint %37 %uint_1
OpStore %v %38
OpReturnValue %int_4
OpFunctionEnd
%idx5 = OpFunction %int None %18
%41 = OpLabel
%42 = OpLoad %uint %v
%43 = OpISub %uint %42 %uint_1
OpStore %v %43
OpReturnValue %int_0
OpFunctionEnd
%idx6 = OpFunction %int None %18
%46 = OpLabel
%47 = OpLoad %uint %v
%48 = OpISub %uint %47 %uint_1
OpStore %v %48
OpReturnValue %int_2
OpFunctionEnd
%main = OpFunction %void None %14
%50 = OpLabel
%51 = OpFunctionCall %int %idx1
%52 = OpFunctionCall %int %idx2
%53 = OpFunctionCall %int %idx3
%56 = OpAccessChain %_ptr_StorageBuffer_int %buffer %uint_0 %51 %uint_0 %52 %53
%57 = OpAccessChain %_ptr_StorageBuffer_int %buffer %uint_0 %51 %uint_0 %52 %53
%58 = OpLoad %int %57
%59 = OpISub %int %58 %int_1
OpStore %56 %59
OpBranch %60
%60 = OpLabel
OpLoopMerge %61 %62 None
OpBranch %63
%63 = OpLabel
%65 = OpLoad %uint %v
%67 = OpULessThan %bool %65 %uint_10
%64 = OpLogicalNot %bool %67
OpSelectionMerge %69 None
OpBranchConditional %64 %70 %69
%70 = OpLabel
OpBranch %61
%69 = OpLabel
OpBranch %62
%62 = OpLabel
%71 = OpFunctionCall %int %idx4
%72 = OpFunctionCall %int %idx5
%73 = OpFunctionCall %int %idx6
%74 = OpAccessChain %_ptr_StorageBuffer_int %buffer %uint_0 %71 %uint_0 %72 %73
%75 = OpAccessChain %_ptr_StorageBuffer_int %buffer %uint_0 %71 %uint_0 %72 %73
%76 = OpLoad %int %75
%77 = OpISub %int %76 %int_1
OpStore %74 %77
OpBranch %60
%61 = OpLabel
OpReturn
OpFunctionEnd

View File

@@ -1,11 +1,20 @@
SKIP: FAILED
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
struct i_block {
uint inner;
};
@group(0) @binding(0) var<storage, read_write> i : u32;
fn main() {
for(; (i < 10u); i--) {
layout(binding = 0, std430) buffer i_block_1 {
uint inner;
} i;
void tint_symbol() {
{
for(; (i.inner < 10u); i.inner = (i.inner - 1u)) {
}
}
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,11 +1,13 @@
SKIP: FAILED
@group(0) @binding(0) var<storage, read_write> i : u32;
fn main() {
for(; (i < 10u); i--) {
}
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
Failed to generate: error: cannot modify value of type 'u32'
RWByteAddressBuffer i : register(u0, space0);
void main() {
{
[loop] for(; (i.Load(0u) < 10u); i.Store(0u, asuint((i.Load(0u) - 1u)))) {
}
}
}

View File

@@ -1,11 +1,8 @@
SKIP: FAILED
#include <metal_stdlib>
@group(0) @binding(0) var<storage, read_write> i : u32;
fn tint_symbol() {
for(; (i < 10u); i--) {
using namespace metal;
void tint_symbol(device uint* const tint_symbol_1) {
for(; (*(tint_symbol_1) < 10u); *(tint_symbol_1) = (*(tint_symbol_1) - 1u)) {
}
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,11 +1,60 @@
SKIP: FAILED
@group(0) @binding(0) var<storage, read_write> i : u32;
fn main() {
for(; (i < 10u); i--) {
}
}
Failed to generate: Unknown statement: tint::ast::IncrementDecrementStatement
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 30
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %i_block "i_block"
OpMemberName %i_block 0 "inner"
OpName %i "i"
OpName %unused_entry_point "unused_entry_point"
OpName %main "main"
OpDecorate %i_block Block
OpMemberDecorate %i_block 0 Offset 0
OpDecorate %i DescriptorSet 0
OpDecorate %i Binding 0
%uint = OpTypeInt 32 0
%i_block = OpTypeStruct %uint
%_ptr_StorageBuffer_i_block = OpTypePointer StorageBuffer %i_block
%i = OpVariable %_ptr_StorageBuffer_i_block StorageBuffer
%void = OpTypeVoid
%5 = OpTypeFunction %void
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%uint_10 = OpConstant %uint 10
%bool = OpTypeBool
%uint_1 = OpConstant %uint 1
%unused_entry_point = OpFunction %void None %5
%8 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %5
%10 = OpLabel
OpBranch %11
%11 = OpLabel
OpLoopMerge %12 %13 None
OpBranch %14
%14 = OpLabel
%18 = OpAccessChain %_ptr_StorageBuffer_uint %i %uint_0
%19 = OpLoad %uint %18
%21 = OpULessThan %bool %19 %uint_10
%15 = OpLogicalNot %bool %21
OpSelectionMerge %23 None
OpBranchConditional %15 %24 %23
%24 = OpLabel
OpBranch %12
%23 = OpLabel
OpBranch %13
%13 = OpLabel
%25 = OpAccessChain %_ptr_StorageBuffer_uint %i %uint_0
%26 = OpAccessChain %_ptr_StorageBuffer_uint %i %uint_0
%27 = OpLoad %uint %26
%29 = OpISub %uint %27 %uint_1
OpStore %25 %29
OpBranch %11
%12 = OpLabel
OpReturn
OpFunctionEnd

View File

@@ -1,11 +1,20 @@
SKIP: FAILED
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
struct i_block {
uint inner;
};
@group(0) @binding(0) var<storage, read_write> i : u32;
fn main() {
for(i--; (i < 10u); ) {
layout(binding = 0, std430) buffer i_block_1 {
uint inner;
} i;
void tint_symbol() {
{
for(i.inner = (i.inner - 1u); (i.inner < 10u); ) {
}
}
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,11 +1,13 @@
SKIP: FAILED
@group(0) @binding(0) var<storage, read_write> i : u32;
fn main() {
for(i--; (i < 10u); ) {
}
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
Failed to generate: error: cannot modify value of type 'u32'
RWByteAddressBuffer i : register(u0, space0);
void main() {
{
[loop] for(i.Store(0u, asuint((i.Load(0u) - 1u))); (i.Load(0u) < 10u); ) {
}
}
}

View File

@@ -1,11 +1,8 @@
SKIP: FAILED
#include <metal_stdlib>
@group(0) @binding(0) var<storage, read_write> i : u32;
fn tint_symbol() {
for(i--; (i < 10u); ) {
using namespace metal;
void tint_symbol(device uint* const tint_symbol_1) {
for(*(tint_symbol_1) = (*(tint_symbol_1) - 1u); (*(tint_symbol_1) < 10u); ) {
}
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,11 +1,60 @@
SKIP: FAILED
@group(0) @binding(0) var<storage, read_write> i : u32;
fn main() {
for(i--; (i < 10u); ) {
}
}
Failed to generate: Unknown statement: tint::ast::IncrementDecrementStatement
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 30
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %i_block "i_block"
OpMemberName %i_block 0 "inner"
OpName %i "i"
OpName %unused_entry_point "unused_entry_point"
OpName %main "main"
OpDecorate %i_block Block
OpMemberDecorate %i_block 0 Offset 0
OpDecorate %i DescriptorSet 0
OpDecorate %i Binding 0
%uint = OpTypeInt 32 0
%i_block = OpTypeStruct %uint
%_ptr_StorageBuffer_i_block = OpTypePointer StorageBuffer %i_block
%i = OpVariable %_ptr_StorageBuffer_i_block StorageBuffer
%void = OpTypeVoid
%5 = OpTypeFunction %void
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%uint_1 = OpConstant %uint 1
%uint_10 = OpConstant %uint 10
%bool = OpTypeBool
%unused_entry_point = OpFunction %void None %5
%8 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %5
%10 = OpLabel
%13 = OpAccessChain %_ptr_StorageBuffer_uint %i %uint_0
%14 = OpAccessChain %_ptr_StorageBuffer_uint %i %uint_0
%15 = OpLoad %uint %14
%17 = OpISub %uint %15 %uint_1
OpStore %13 %17
OpBranch %18
%18 = OpLabel
OpLoopMerge %19 %20 None
OpBranch %21
%21 = OpLabel
%23 = OpAccessChain %_ptr_StorageBuffer_uint %i %uint_0
%24 = OpLoad %uint %23
%26 = OpULessThan %bool %24 %uint_10
%22 = OpLogicalNot %bool %26
OpSelectionMerge %28 None
OpBranchConditional %22 %29 %28
%29 = OpLabel
OpBranch %19
%28 = OpLabel
OpBranch %20
%20 = OpLabel
OpBranch %18
%19 = OpLabel
OpReturn
OpFunctionEnd

View File

@@ -1,9 +1,11 @@
SKIP: FAILED
#version 310 es
fn main() {
var i = 0;
i--;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
void tint_symbol() {
int i = 0;
i = (i - 1);
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,9 +1,9 @@
SKIP: FAILED
fn main() {
var i = 0;
i--;
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement
void main() {
int i = 0;
i = (i - 1);
}

View File

@@ -1,9 +1,8 @@
SKIP: FAILED
#include <metal_stdlib>
fn tint_symbol() {
var i = 0;
i--;
using namespace metal;
void tint_symbol() {
int i = 0;
i = as_type<int>((as_type<uint>(i) - as_type<uint>(1)));
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,9 +1,32 @@
SKIP: FAILED
fn main() {
var i = 0;
i--;
}
Failed to generate: Unknown statement: tint::ast::IncrementDecrementStatement
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 15
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %main "main"
OpName %i "i"
%void = OpTypeVoid
%1 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%_ptr_Function_int = OpTypePointer Function %int
%11 = OpConstantNull %int
%int_1 = OpConstant %int 1
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %1
%6 = OpLabel
%i = OpVariable %_ptr_Function_int Function %11
OpStore %i %int_0
%12 = OpLoad %int %i
%14 = OpISub %int %12 %int_1
OpStore %i %14
OpReturn
OpFunctionEnd

View File

@@ -1,10 +1,11 @@
SKIP: FAILED
#version 310 es
var<private> i : i32 = 0;
fn main() {
i--;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
int i = 0;
void tint_symbol() {
i = (i - 1);
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,10 +1,10 @@
SKIP: FAILED
var<private> i : i32 = 0;
fn main() {
i--;
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement
static int i = 0;
void main() {
i = (i - 1);
}

View File

@@ -1,10 +1,7 @@
SKIP: FAILED
#include <metal_stdlib>
var<private> i : i32 = 0;
fn tint_symbol() {
i--;
using namespace metal;
void tint_symbol(thread int* const tint_symbol_1) {
*(tint_symbol_1) = as_type<int>((as_type<uint>(*(tint_symbol_1)) - as_type<uint>(1)));
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,10 +1,30 @@
SKIP: FAILED
var<private> i : i32 = 0;
fn main() {
i--;
}
Failed to generate: Unknown statement: tint::ast::IncrementDecrementStatement
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 14
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %i "i"
OpName %unused_entry_point "unused_entry_point"
OpName %main "main"
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%_ptr_Private_int = OpTypePointer Private %int
%i = OpVariable %_ptr_Private_int Private %int_0
%void = OpTypeVoid
%5 = OpTypeFunction %void
%int_1 = OpConstant %int 1
%unused_entry_point = OpFunction %void None %5
%8 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %5
%10 = OpLabel
%11 = OpLoad %int %i
%13 = OpISub %int %11 %int_1
OpStore %i %13
OpReturn
OpFunctionEnd

View File

@@ -1,10 +1,17 @@
SKIP: FAILED
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
struct i_block {
uint inner;
};
@group(0) @binding(0) var<storage, read_write> i : u32;
fn main() {
i--;
layout(binding = 0, std430) buffer i_block_1 {
uint inner;
} i;
void tint_symbol() {
i.inner = (i.inner - 1u);
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,10 +1,10 @@
SKIP: FAILED
@group(0) @binding(0) var<storage, read_write> i : u32;
fn main() {
i--;
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
Failed to generate: error: cannot modify value of type 'u32'
RWByteAddressBuffer i : register(u0, space0);
void main() {
i.Store(0u, asuint((i.Load(0u) - 1u)));
}

View File

@@ -1,10 +1,7 @@
SKIP: FAILED
#include <metal_stdlib>
@group(0) @binding(0) var<storage, read_write> i : u32;
fn tint_symbol() {
i--;
using namespace metal;
void tint_symbol(device uint* const tint_symbol_1) {
*(tint_symbol_1) = (*(tint_symbol_1) - 1u);
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,10 +1,40 @@
SKIP: FAILED
@group(0) @binding(0) var<storage, read_write> i : u32;
fn main() {
i--;
}
Failed to generate: Unknown statement: tint::ast::IncrementDecrementStatement
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 18
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %i_block "i_block"
OpMemberName %i_block 0 "inner"
OpName %i "i"
OpName %unused_entry_point "unused_entry_point"
OpName %main "main"
OpDecorate %i_block Block
OpMemberDecorate %i_block 0 Offset 0
OpDecorate %i DescriptorSet 0
OpDecorate %i Binding 0
%uint = OpTypeInt 32 0
%i_block = OpTypeStruct %uint
%_ptr_StorageBuffer_i_block = OpTypePointer StorageBuffer %i_block
%i = OpVariable %_ptr_StorageBuffer_i_block StorageBuffer
%void = OpTypeVoid
%5 = OpTypeFunction %void
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%uint_1 = OpConstant %uint 1
%unused_entry_point = OpFunction %void None %5
%8 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %5
%10 = OpLabel
%13 = OpAccessChain %_ptr_StorageBuffer_uint %i %uint_0
%14 = OpAccessChain %_ptr_StorageBuffer_uint %i %uint_0
%15 = OpLoad %uint %14
%17 = OpISub %uint %15 %uint_1
OpStore %13 %17
OpReturn
OpFunctionEnd

View File

@@ -1,11 +1,19 @@
SKIP: FAILED
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
struct a_block {
uvec4 inner;
};
@group(0) @binding(0) var<storage, read_write> a : vec4<u32>;
fn main() {
a[1]--;
a.z--;
layout(binding = 0, std430) buffer a_block_1 {
uvec4 inner;
} a;
void tint_symbol() {
int tint_symbol_2 = 1;
a.inner[tint_symbol_2] = (a.inner[tint_symbol_2] - 1u);
a.inner.z = (a.inner.z - 1u);
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,11 +1,12 @@
SKIP: FAILED
@group(0) @binding(0) var<storage, read_write> a : vec4<u32>;
fn main() {
a[1]--;
a.z--;
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
Failed to generate: error: cannot modify value of type 'u32'
RWByteAddressBuffer a : register(u0, space0);
void main() {
const int tint_symbol_1 = 1;
a.Store((4u * uint(tint_symbol_1)), asuint((a.Load((4u * uint(tint_symbol_1))) - 1u)));
a.Store(8u, asuint((a.Load(8u) - 1u)));
}

View File

@@ -1,11 +1,9 @@
SKIP: FAILED
#include <metal_stdlib>
@group(0) @binding(0) var<storage, read_write> a : vec4<u32>;
fn tint_symbol() {
a[1]--;
a.z--;
using namespace metal;
void tint_symbol(device uint4* const tint_symbol_3) {
int const tint_symbol_2 = 1;
(*(tint_symbol_3))[tint_symbol_2] = ((*(tint_symbol_3))[tint_symbol_2] - 1u);
(*(tint_symbol_3))[2] = ((*(tint_symbol_3))[2] - 1u);
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,11 +1,49 @@
SKIP: FAILED
@group(0) @binding(0) var<storage, read_write> a : vec4<u32>;
fn main() {
a[1]--;
a.z--;
}
Failed to generate: Unknown statement: tint::ast::IncrementDecrementStatement
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 26
; 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 %a DescriptorSet 0
OpDecorate %a Binding 0
%uint = OpTypeInt 32 0
%v4uint = OpTypeVector %uint 4
%a_block = OpTypeStruct %v4uint
%_ptr_StorageBuffer_a_block = OpTypePointer StorageBuffer %a_block
%a = OpVariable %_ptr_StorageBuffer_a_block StorageBuffer
%void = OpTypeVoid
%6 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%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 = OpISub %uint %18 %uint_1
OpStore %16 %20
%22 = OpAccessChain %_ptr_StorageBuffer_uint %a %uint_0 %uint_2
%23 = OpAccessChain %_ptr_StorageBuffer_uint %a %uint_0 %uint_2
%24 = OpLoad %uint %23
%25 = OpISub %uint %24 %uint_1
OpStore %22 %25
OpReturn
OpFunctionEnd

View File

@@ -1,10 +1,11 @@
SKIP: FAILED
#version 310 es
var<workgroup> i : i32;
fn main() {
i--;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
shared int i;
void tint_symbol() {
i = (i - 1);
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,10 +1,10 @@
SKIP: FAILED
var<workgroup> i : i32;
fn main() {
i--;
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement
groupshared int i;
void main() {
i = (i - 1);
}

View File

@@ -1,10 +1,7 @@
SKIP: FAILED
#include <metal_stdlib>
var<workgroup> i : i32;
fn tint_symbol() {
i--;
using namespace metal;
void tint_symbol(threadgroup int* const tint_symbol_1) {
*(tint_symbol_1) = as_type<int>((as_type<uint>(*(tint_symbol_1)) - as_type<uint>(1)));
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,10 +1,29 @@
SKIP: FAILED
var<workgroup> i : i32;
fn main() {
i--;
}
Failed to generate: Unknown statement: tint::ast::IncrementDecrementStatement
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 13
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %i "i"
OpName %unused_entry_point "unused_entry_point"
OpName %main "main"
%int = OpTypeInt 32 1
%_ptr_Workgroup_int = OpTypePointer Workgroup %int
%i = OpVariable %_ptr_Workgroup_int Workgroup
%void = OpTypeVoid
%4 = OpTypeFunction %void
%int_1 = OpConstant %int 1
%unused_entry_point = OpFunction %void None %4
%7 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %4
%9 = OpLabel
%10 = OpLoad %int %i
%12 = OpISub %int %10 %int_1
OpStore %i %12
OpReturn
OpFunctionEnd

View File

@@ -1,10 +1,13 @@
SKIP: FAILED
#version 310 es
@group(0) @binding(0) var<storage, read_write> a : array<u32>;
fn main() {
a[1]++;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
layout(binding = 0, std430) buffer a_block_1 {
uint inner[];
} a;
void tint_symbol() {
a.inner[1] = (a.inner[1] + 1u);
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,10 +1,10 @@
SKIP: FAILED
@group(0) @binding(0) var<storage, read_write> a : array<u32>;
fn main() {
a[1]++;
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
Failed to generate: error: cannot modify value of type 'u32'
RWByteAddressBuffer a : register(u0, space0);
void main() {
a.Store(4u, asuint((a.Load(4u) + 1u)));
}

View File

@@ -1,10 +1,7 @@
SKIP: FAILED
#include <metal_stdlib>
@group(0) @binding(0) var<storage, read_write> a : array<u32>;
fn tint_symbol() {
a[1]++;
using namespace metal;
void tint_symbol(device uint (*const tint_symbol_2)[1]) {
(*(tint_symbol_2))[1] = ((*(tint_symbol_2))[1] + 1u);
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -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

View File

@@ -1,47 +1,70 @@
SKIP: FAILED
#version 310 es
struct S {
a : array<vec4<i32>, 4>,
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
struct S {
ivec4 a[4];
};
@group(0) @binding(0) var<storage, read_write> buffer : array<S>;
var<private> v : u32;
fn idx1() -> i32 {
v++;
layout(binding = 0, std430) buffer tint_symbol_block_1 {
S inner[];
} tint_symbol;
uint v = 0u;
int idx1() {
v = (v + 1u);
return 1;
}
fn idx2() -> i32 {
v++;
int idx2() {
v = (v + 1u);
return 2;
}
fn idx3() -> i32 {
v++;
int idx3() {
v = (v + 1u);
return 3;
}
fn idx4() -> i32 {
v++;
int idx4() {
v = (v + 1u);
return 4;
}
fn idx5() -> i32 {
v++;
int idx5() {
v = (v + 1u);
return 0;
}
fn idx6() -> i32 {
v++;
int idx6() {
v = (v + 1u);
return 2;
}
fn main() {
for(buffer[idx1()].a[idx2()][idx3()]++; (v < 10u); buffer[idx4()].a[idx5()][idx6()]++) {
void tint_symbol_1() {
int tint_symbol_6 = idx1();
int tint_symbol_7 = idx2();
int tint_symbol_2_save = tint_symbol_6;
int tint_symbol_2_save_1 = tint_symbol_7;
int tint_symbol_3 = idx3();
{
tint_symbol.inner[tint_symbol_2_save].a[tint_symbol_2_save_1][tint_symbol_3] = (tint_symbol.inner[tint_symbol_2_save].a[tint_symbol_2_save_1][tint_symbol_3] + 1);
while (true) {
if (!((v < 10u))) {
break;
}
{
}
{
int tint_symbol_8 = idx4();
int tint_symbol_9 = idx5();
int tint_symbol_4_save = tint_symbol_8;
int tint_symbol_4_save_1 = tint_symbol_9;
int tint_symbol_5 = idx6();
tint_symbol.inner[tint_symbol_4_save].a[tint_symbol_4_save_1][tint_symbol_5] = (tint_symbol.inner[tint_symbol_4_save].a[tint_symbol_4_save_1][tint_symbol_5] + 1);
}
}
}
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,47 +1,63 @@
SKIP: FAILED
struct S {
a : array<vec4<i32>, 4>,
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
@group(0) @binding(0) var<storage, read_write> buffer : array<S>;
RWByteAddressBuffer buffer : register(u0, space0);
static uint v = 0u;
var<private> v : u32;
fn idx1() -> i32 {
v++;
int idx1() {
v = (v + 1u);
return 1;
}
fn idx2() -> i32 {
v++;
int idx2() {
v = (v + 1u);
return 2;
}
fn idx3() -> i32 {
v++;
int idx3() {
v = (v + 1u);
return 3;
}
fn idx4() -> i32 {
v++;
int idx4() {
v = (v + 1u);
return 4;
}
fn idx5() -> i32 {
v++;
int idx5() {
v = (v + 1u);
return 0;
}
fn idx6() -> i32 {
v++;
int idx6() {
v = (v + 1u);
return 2;
}
fn main() {
for(buffer[idx1()].a[idx2()][idx3()]++; (v < 10u); buffer[idx4()].a[idx5()][idx6()]++) {
void main() {
const int tint_symbol_4 = idx1();
const int tint_symbol_5 = idx2();
const int tint_symbol_save = tint_symbol_4;
const int tint_symbol_save_1 = tint_symbol_5;
const int tint_symbol_1 = idx3();
{
buffer.Store((((64u * uint(tint_symbol_save)) + (16u * uint(tint_symbol_save_1))) + (4u * uint(tint_symbol_1))), asuint((asint(buffer.Load((((64u * uint(tint_symbol_save)) + (16u * uint(tint_symbol_save_1))) + (4u * uint(tint_symbol_1))))) + 1)));
[loop] while (true) {
if (!((v < 10u))) {
break;
}
{
}
{
const int tint_symbol_6 = idx4();
const int tint_symbol_7 = idx5();
const int tint_symbol_2_save = tint_symbol_6;
const int tint_symbol_2_save_1 = tint_symbol_7;
const int tint_symbol_3 = idx6();
buffer.Store((((64u * uint(tint_symbol_2_save)) + (16u * uint(tint_symbol_2_save_1))) + (4u * uint(tint_symbol_3))), asuint((asint(buffer.Load((((64u * uint(tint_symbol_2_save)) + (16u * uint(tint_symbol_2_save_1))) + (4u * uint(tint_symbol_3))))) + 1)));
}
}
}
}
Failed to generate: error: cannot modify value of type 'i32'

View File

@@ -1,47 +1,67 @@
SKIP: FAILED
#include <metal_stdlib>
using namespace metal;
struct tint_array_wrapper {
/* 0x0000 */ int4 arr[4];
};
struct S {
a : array<vec4<i32>, 4>,
}
/* 0x0000 */ tint_array_wrapper a;
};
@group(0) @binding(0) var<storage, read_write> tint_symbol : array<S>;
var<private> v : u32;
fn idx1() -> i32 {
v++;
int idx1(thread uint* const tint_symbol_10) {
*(tint_symbol_10) = (*(tint_symbol_10) + 1u);
return 1;
}
fn idx2() -> i32 {
v++;
int idx2(thread uint* const tint_symbol_11) {
*(tint_symbol_11) = (*(tint_symbol_11) + 1u);
return 2;
}
fn idx3() -> i32 {
v++;
int idx3(thread uint* const tint_symbol_12) {
*(tint_symbol_12) = (*(tint_symbol_12) + 1u);
return 3;
}
fn idx4() -> i32 {
v++;
int idx4(thread uint* const tint_symbol_13) {
*(tint_symbol_13) = (*(tint_symbol_13) + 1u);
return 4;
}
fn idx5() -> i32 {
v++;
int idx5(thread uint* const tint_symbol_14) {
*(tint_symbol_14) = (*(tint_symbol_14) + 1u);
return 0;
}
fn idx6() -> i32 {
v++;
int idx6(thread uint* const tint_symbol_15) {
*(tint_symbol_15) = (*(tint_symbol_15) + 1u);
return 2;
}
fn tint_symbol_1() {
for(tint_symbol[idx1()].a[idx2()][idx3()]++; (v < 10u); tint_symbol[idx4()].a[idx5()][idx6()]++) {
void tint_symbol_1(thread uint* const tint_symbol_16, device S (*const tint_symbol_17)[1]) {
int const tint_symbol_6 = idx1(tint_symbol_16);
int const tint_symbol_7 = idx2(tint_symbol_16);
int const tint_symbol_2_save = tint_symbol_6;
int const tint_symbol_2_save_1 = tint_symbol_7;
int const tint_symbol_3 = idx3(tint_symbol_16);
{
(*(tint_symbol_17))[tint_symbol_2_save].a.arr[tint_symbol_2_save_1][tint_symbol_3] = as_type<int>((as_type<uint>((*(tint_symbol_17))[tint_symbol_2_save].a.arr[tint_symbol_2_save_1][tint_symbol_3]) + as_type<uint>(1)));
while (true) {
if (!((*(tint_symbol_16) < 10u))) {
break;
}
{
}
{
int const tint_symbol_8 = idx4(tint_symbol_16);
int const tint_symbol_9 = idx5(tint_symbol_16);
int const tint_symbol_4_save = tint_symbol_8;
int const tint_symbol_4_save_1 = tint_symbol_9;
int const tint_symbol_5 = idx6(tint_symbol_16);
(*(tint_symbol_17))[tint_symbol_4_save].a.arr[tint_symbol_4_save_1][tint_symbol_5] = as_type<int>((as_type<uint>((*(tint_symbol_17))[tint_symbol_4_save].a.arr[tint_symbol_4_save_1][tint_symbol_5]) + as_type<uint>(1)));
}
}
}
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,47 +1,139 @@
SKIP: FAILED
struct S {
a : array<vec4<i32>, 4>,
}
@group(0) @binding(0) var<storage, read_write> buffer : array<S>;
var<private> v : u32;
fn idx1() -> i32 {
v++;
return 1;
}
fn idx2() -> i32 {
v++;
return 2;
}
fn idx3() -> i32 {
v++;
return 3;
}
fn idx4() -> i32 {
v++;
return 4;
}
fn idx5() -> i32 {
v++;
return 0;
}
fn idx6() -> i32 {
v++;
return 2;
}
fn main() {
for(buffer[idx1()].a[idx2()][idx3()]++; (v < 10u); buffer[idx4()].a[idx5()][idx6()]++) {
}
}
Failed to generate: Unknown statement: tint::ast::IncrementDecrementStatement
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 78
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %buffer_block "buffer_block"
OpMemberName %buffer_block 0 "inner"
OpName %S "S"
OpMemberName %S 0 "a"
OpName %buffer "buffer"
OpName %v "v"
OpName %unused_entry_point "unused_entry_point"
OpName %idx1 "idx1"
OpName %idx2 "idx2"
OpName %idx3 "idx3"
OpName %idx4 "idx4"
OpName %idx5 "idx5"
OpName %idx6 "idx6"
OpName %main "main"
OpDecorate %buffer_block Block
OpMemberDecorate %buffer_block 0 Offset 0
OpMemberDecorate %S 0 Offset 0
OpDecorate %_arr_v4int_uint_4 ArrayStride 16
OpDecorate %_runtimearr_S ArrayStride 64
OpDecorate %buffer DescriptorSet 0
OpDecorate %buffer Binding 0
%int = OpTypeInt 32 1
%v4int = OpTypeVector %int 4
%uint = OpTypeInt 32 0
%uint_4 = OpConstant %uint 4
%_arr_v4int_uint_4 = OpTypeArray %v4int %uint_4
%S = OpTypeStruct %_arr_v4int_uint_4
%_runtimearr_S = OpTypeRuntimeArray %S
%buffer_block = OpTypeStruct %_runtimearr_S
%_ptr_StorageBuffer_buffer_block = OpTypePointer StorageBuffer %buffer_block
%buffer = OpVariable %_ptr_StorageBuffer_buffer_block StorageBuffer
%_ptr_Private_uint = OpTypePointer Private %uint
%13 = OpConstantNull %uint
%v = OpVariable %_ptr_Private_uint Private %13
%void = OpTypeVoid
%14 = OpTypeFunction %void
%18 = OpTypeFunction %int
%uint_1 = OpConstant %uint 1
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%int_0 = OpConstant %int 0
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%uint_10 = OpConstant %uint 10
%bool = OpTypeBool
%unused_entry_point = OpFunction %void None %14
%17 = OpLabel
OpReturn
OpFunctionEnd
%idx1 = OpFunction %int None %18
%20 = OpLabel
%21 = OpLoad %uint %v
%23 = OpIAdd %uint %21 %uint_1
OpStore %v %23
OpReturnValue %int_1
OpFunctionEnd
%idx2 = OpFunction %int None %18
%26 = OpLabel
%27 = OpLoad %uint %v
%28 = OpIAdd %uint %27 %uint_1
OpStore %v %28
OpReturnValue %int_2
OpFunctionEnd
%idx3 = OpFunction %int None %18
%31 = OpLabel
%32 = OpLoad %uint %v
%33 = OpIAdd %uint %32 %uint_1
OpStore %v %33
OpReturnValue %int_3
OpFunctionEnd
%idx4 = OpFunction %int None %18
%36 = OpLabel
%37 = OpLoad %uint %v
%38 = OpIAdd %uint %37 %uint_1
OpStore %v %38
OpReturnValue %int_4
OpFunctionEnd
%idx5 = OpFunction %int None %18
%41 = OpLabel
%42 = OpLoad %uint %v
%43 = OpIAdd %uint %42 %uint_1
OpStore %v %43
OpReturnValue %int_0
OpFunctionEnd
%idx6 = OpFunction %int None %18
%46 = OpLabel
%47 = OpLoad %uint %v
%48 = OpIAdd %uint %47 %uint_1
OpStore %v %48
OpReturnValue %int_2
OpFunctionEnd
%main = OpFunction %void None %14
%50 = OpLabel
%51 = OpFunctionCall %int %idx1
%52 = OpFunctionCall %int %idx2
%53 = OpFunctionCall %int %idx3
%56 = OpAccessChain %_ptr_StorageBuffer_int %buffer %uint_0 %51 %uint_0 %52 %53
%57 = OpAccessChain %_ptr_StorageBuffer_int %buffer %uint_0 %51 %uint_0 %52 %53
%58 = OpLoad %int %57
%59 = OpIAdd %int %58 %int_1
OpStore %56 %59
OpBranch %60
%60 = OpLabel
OpLoopMerge %61 %62 None
OpBranch %63
%63 = OpLabel
%65 = OpLoad %uint %v
%67 = OpULessThan %bool %65 %uint_10
%64 = OpLogicalNot %bool %67
OpSelectionMerge %69 None
OpBranchConditional %64 %70 %69
%70 = OpLabel
OpBranch %61
%69 = OpLabel
OpBranch %62
%62 = OpLabel
%71 = OpFunctionCall %int %idx4
%72 = OpFunctionCall %int %idx5
%73 = OpFunctionCall %int %idx6
%74 = OpAccessChain %_ptr_StorageBuffer_int %buffer %uint_0 %71 %uint_0 %72 %73
%75 = OpAccessChain %_ptr_StorageBuffer_int %buffer %uint_0 %71 %uint_0 %72 %73
%76 = OpLoad %int %75
%77 = OpIAdd %int %76 %int_1
OpStore %74 %77
OpBranch %60
%61 = OpLabel
OpReturn
OpFunctionEnd

View File

@@ -1,11 +1,20 @@
SKIP: FAILED
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
struct i_block {
uint inner;
};
@group(0) @binding(0) var<storage, read_write> i : u32;
fn main() {
for(; (i < 10u); i++) {
layout(binding = 0, std430) buffer i_block_1 {
uint inner;
} i;
void tint_symbol() {
{
for(; (i.inner < 10u); i.inner = (i.inner + 1u)) {
}
}
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,11 +1,13 @@
SKIP: FAILED
@group(0) @binding(0) var<storage, read_write> i : u32;
fn main() {
for(; (i < 10u); i++) {
}
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
Failed to generate: error: cannot modify value of type 'u32'
RWByteAddressBuffer i : register(u0, space0);
void main() {
{
[loop] for(; (i.Load(0u) < 10u); i.Store(0u, asuint((i.Load(0u) + 1u)))) {
}
}
}

View File

@@ -1,11 +1,8 @@
SKIP: FAILED
#include <metal_stdlib>
@group(0) @binding(0) var<storage, read_write> i : u32;
fn tint_symbol() {
for(; (i < 10u); i++) {
using namespace metal;
void tint_symbol(device uint* const tint_symbol_1) {
for(; (*(tint_symbol_1) < 10u); *(tint_symbol_1) = (*(tint_symbol_1) + 1u)) {
}
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,11 +1,60 @@
SKIP: FAILED
@group(0) @binding(0) var<storage, read_write> i : u32;
fn main() {
for(; (i < 10u); i++) {
}
}
Failed to generate: Unknown statement: tint::ast::IncrementDecrementStatement
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 30
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %i_block "i_block"
OpMemberName %i_block 0 "inner"
OpName %i "i"
OpName %unused_entry_point "unused_entry_point"
OpName %main "main"
OpDecorate %i_block Block
OpMemberDecorate %i_block 0 Offset 0
OpDecorate %i DescriptorSet 0
OpDecorate %i Binding 0
%uint = OpTypeInt 32 0
%i_block = OpTypeStruct %uint
%_ptr_StorageBuffer_i_block = OpTypePointer StorageBuffer %i_block
%i = OpVariable %_ptr_StorageBuffer_i_block StorageBuffer
%void = OpTypeVoid
%5 = OpTypeFunction %void
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%uint_10 = OpConstant %uint 10
%bool = OpTypeBool
%uint_1 = OpConstant %uint 1
%unused_entry_point = OpFunction %void None %5
%8 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %5
%10 = OpLabel
OpBranch %11
%11 = OpLabel
OpLoopMerge %12 %13 None
OpBranch %14
%14 = OpLabel
%18 = OpAccessChain %_ptr_StorageBuffer_uint %i %uint_0
%19 = OpLoad %uint %18
%21 = OpULessThan %bool %19 %uint_10
%15 = OpLogicalNot %bool %21
OpSelectionMerge %23 None
OpBranchConditional %15 %24 %23
%24 = OpLabel
OpBranch %12
%23 = OpLabel
OpBranch %13
%13 = OpLabel
%25 = OpAccessChain %_ptr_StorageBuffer_uint %i %uint_0
%26 = OpAccessChain %_ptr_StorageBuffer_uint %i %uint_0
%27 = OpLoad %uint %26
%29 = OpIAdd %uint %27 %uint_1
OpStore %25 %29
OpBranch %11
%12 = OpLabel
OpReturn
OpFunctionEnd

View File

@@ -1,11 +1,20 @@
SKIP: FAILED
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
struct i_block {
uint inner;
};
@group(0) @binding(0) var<storage, read_write> i : u32;
fn main() {
for(i++; (i < 10u); ) {
layout(binding = 0, std430) buffer i_block_1 {
uint inner;
} i;
void tint_symbol() {
{
for(i.inner = (i.inner + 1u); (i.inner < 10u); ) {
}
}
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,11 +1,13 @@
SKIP: FAILED
@group(0) @binding(0) var<storage, read_write> i : u32;
fn main() {
for(i++; (i < 10u); ) {
}
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
Failed to generate: error: cannot modify value of type 'u32'
RWByteAddressBuffer i : register(u0, space0);
void main() {
{
[loop] for(i.Store(0u, asuint((i.Load(0u) + 1u))); (i.Load(0u) < 10u); ) {
}
}
}

View File

@@ -1,11 +1,8 @@
SKIP: FAILED
#include <metal_stdlib>
@group(0) @binding(0) var<storage, read_write> i : u32;
fn tint_symbol() {
for(i++; (i < 10u); ) {
using namespace metal;
void tint_symbol(device uint* const tint_symbol_1) {
for(*(tint_symbol_1) = (*(tint_symbol_1) + 1u); (*(tint_symbol_1) < 10u); ) {
}
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,11 +1,60 @@
SKIP: FAILED
@group(0) @binding(0) var<storage, read_write> i : u32;
fn main() {
for(i++; (i < 10u); ) {
}
}
Failed to generate: Unknown statement: tint::ast::IncrementDecrementStatement
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 30
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %i_block "i_block"
OpMemberName %i_block 0 "inner"
OpName %i "i"
OpName %unused_entry_point "unused_entry_point"
OpName %main "main"
OpDecorate %i_block Block
OpMemberDecorate %i_block 0 Offset 0
OpDecorate %i DescriptorSet 0
OpDecorate %i Binding 0
%uint = OpTypeInt 32 0
%i_block = OpTypeStruct %uint
%_ptr_StorageBuffer_i_block = OpTypePointer StorageBuffer %i_block
%i = OpVariable %_ptr_StorageBuffer_i_block StorageBuffer
%void = OpTypeVoid
%5 = OpTypeFunction %void
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%uint_1 = OpConstant %uint 1
%uint_10 = OpConstant %uint 10
%bool = OpTypeBool
%unused_entry_point = OpFunction %void None %5
%8 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %5
%10 = OpLabel
%13 = OpAccessChain %_ptr_StorageBuffer_uint %i %uint_0
%14 = OpAccessChain %_ptr_StorageBuffer_uint %i %uint_0
%15 = OpLoad %uint %14
%17 = OpIAdd %uint %15 %uint_1
OpStore %13 %17
OpBranch %18
%18 = OpLabel
OpLoopMerge %19 %20 None
OpBranch %21
%21 = OpLabel
%23 = OpAccessChain %_ptr_StorageBuffer_uint %i %uint_0
%24 = OpLoad %uint %23
%26 = OpULessThan %bool %24 %uint_10
%22 = OpLogicalNot %bool %26
OpSelectionMerge %28 None
OpBranchConditional %22 %29 %28
%29 = OpLabel
OpBranch %19
%28 = OpLabel
OpBranch %20
%20 = OpLabel
OpBranch %18
%19 = OpLabel
OpReturn
OpFunctionEnd

View File

@@ -1,9 +1,11 @@
SKIP: FAILED
#version 310 es
fn main() {
var i = 0;
i++;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
void tint_symbol() {
int i = 0;
i = (i + 1);
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,9 +1,9 @@
SKIP: FAILED
fn main() {
var i = 0;
i++;
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement
void main() {
int i = 0;
i = (i + 1);
}

View File

@@ -1,9 +1,8 @@
SKIP: FAILED
#include <metal_stdlib>
fn tint_symbol() {
var i = 0;
i++;
using namespace metal;
void tint_symbol() {
int i = 0;
i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)));
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,9 +1,32 @@
SKIP: FAILED
fn main() {
var i = 0;
i++;
}
Failed to generate: Unknown statement: tint::ast::IncrementDecrementStatement
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 15
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %unused_entry_point "unused_entry_point"
OpName %main "main"
OpName %i "i"
%void = OpTypeVoid
%1 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%_ptr_Function_int = OpTypePointer Function %int
%11 = OpConstantNull %int
%int_1 = OpConstant %int 1
%unused_entry_point = OpFunction %void None %1
%4 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %1
%6 = OpLabel
%i = OpVariable %_ptr_Function_int Function %11
OpStore %i %int_0
%12 = OpLoad %int %i
%14 = OpIAdd %int %12 %int_1
OpStore %i %14
OpReturn
OpFunctionEnd

View File

@@ -1,10 +1,11 @@
SKIP: FAILED
#version 310 es
var<private> i : i32 = 0;
fn main() {
i++;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
int i = 0;
void tint_symbol() {
i = (i + 1);
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,10 +1,10 @@
SKIP: FAILED
var<private> i : i32 = 0;
fn main() {
i++;
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement
static int i = 0;
void main() {
i = (i + 1);
}

View File

@@ -1,10 +1,7 @@
SKIP: FAILED
#include <metal_stdlib>
var<private> i : i32 = 0;
fn tint_symbol() {
i++;
using namespace metal;
void tint_symbol(thread int* const tint_symbol_1) {
*(tint_symbol_1) = as_type<int>((as_type<uint>(*(tint_symbol_1)) + as_type<uint>(1)));
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,10 +1,30 @@
SKIP: FAILED
var<private> i : i32 = 0;
fn main() {
i++;
}
Failed to generate: Unknown statement: tint::ast::IncrementDecrementStatement
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 14
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %i "i"
OpName %unused_entry_point "unused_entry_point"
OpName %main "main"
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%_ptr_Private_int = OpTypePointer Private %int
%i = OpVariable %_ptr_Private_int Private %int_0
%void = OpTypeVoid
%5 = OpTypeFunction %void
%int_1 = OpConstant %int 1
%unused_entry_point = OpFunction %void None %5
%8 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %5
%10 = OpLabel
%11 = OpLoad %int %i
%13 = OpIAdd %int %11 %int_1
OpStore %i %13
OpReturn
OpFunctionEnd

View File

@@ -1,10 +1,17 @@
SKIP: FAILED
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
struct i_block {
uint inner;
};
@group(0) @binding(0) var<storage, read_write> i : u32;
fn main() {
i++;
layout(binding = 0, std430) buffer i_block_1 {
uint inner;
} i;
void tint_symbol() {
i.inner = (i.inner + 1u);
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,10 +1,10 @@
SKIP: FAILED
@group(0) @binding(0) var<storage, read_write> i : u32;
fn main() {
i++;
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
Failed to generate: error: cannot modify value of type 'u32'
RWByteAddressBuffer i : register(u0, space0);
void main() {
i.Store(0u, asuint((i.Load(0u) + 1u)));
}

View File

@@ -1,10 +1,7 @@
SKIP: FAILED
#include <metal_stdlib>
@group(0) @binding(0) var<storage, read_write> i : u32;
fn tint_symbol() {
i++;
using namespace metal;
void tint_symbol(device uint* const tint_symbol_1) {
*(tint_symbol_1) = (*(tint_symbol_1) + 1u);
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,10 +1,40 @@
SKIP: FAILED
@group(0) @binding(0) var<storage, read_write> i : u32;
fn main() {
i++;
}
Failed to generate: Unknown statement: tint::ast::IncrementDecrementStatement
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 18
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %i_block "i_block"
OpMemberName %i_block 0 "inner"
OpName %i "i"
OpName %unused_entry_point "unused_entry_point"
OpName %main "main"
OpDecorate %i_block Block
OpMemberDecorate %i_block 0 Offset 0
OpDecorate %i DescriptorSet 0
OpDecorate %i Binding 0
%uint = OpTypeInt 32 0
%i_block = OpTypeStruct %uint
%_ptr_StorageBuffer_i_block = OpTypePointer StorageBuffer %i_block
%i = OpVariable %_ptr_StorageBuffer_i_block StorageBuffer
%void = OpTypeVoid
%5 = OpTypeFunction %void
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%uint_1 = OpConstant %uint 1
%unused_entry_point = OpFunction %void None %5
%8 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %5
%10 = OpLabel
%13 = OpAccessChain %_ptr_StorageBuffer_uint %i %uint_0
%14 = OpAccessChain %_ptr_StorageBuffer_uint %i %uint_0
%15 = OpLoad %uint %14
%17 = OpIAdd %uint %15 %uint_1
OpStore %13 %17
OpReturn
OpFunctionEnd

View File

@@ -1,11 +1,19 @@
SKIP: FAILED
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
struct a_block {
uvec4 inner;
};
@group(0) @binding(0) var<storage, read_write> a : vec4<u32>;
fn main() {
a[1]++;
a.z++;
layout(binding = 0, std430) buffer a_block_1 {
uvec4 inner;
} a;
void tint_symbol() {
int tint_symbol_2 = 1;
a.inner[tint_symbol_2] = (a.inner[tint_symbol_2] + 1u);
a.inner.z = (a.inner.z + 1u);
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,11 +1,12 @@
SKIP: FAILED
@group(0) @binding(0) var<storage, read_write> a : vec4<u32>;
fn main() {
a[1]++;
a.z++;
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
Failed to generate: error: cannot modify value of type 'u32'
RWByteAddressBuffer a : register(u0, space0);
void main() {
const int tint_symbol_1 = 1;
a.Store((4u * uint(tint_symbol_1)), asuint((a.Load((4u * uint(tint_symbol_1))) + 1u)));
a.Store(8u, asuint((a.Load(8u) + 1u)));
}

View File

@@ -1,11 +1,9 @@
SKIP: FAILED
#include <metal_stdlib>
@group(0) @binding(0) var<storage, read_write> a : vec4<u32>;
fn tint_symbol() {
a[1]++;
a.z++;
using namespace metal;
void tint_symbol(device uint4* const tint_symbol_3) {
int const tint_symbol_2 = 1;
(*(tint_symbol_3))[tint_symbol_2] = ((*(tint_symbol_3))[tint_symbol_2] + 1u);
(*(tint_symbol_3))[2] = ((*(tint_symbol_3))[2] + 1u);
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,11 +1,49 @@
SKIP: FAILED
@group(0) @binding(0) var<storage, read_write> a : vec4<u32>;
fn main() {
a[1]++;
a.z++;
}
Failed to generate: Unknown statement: tint::ast::IncrementDecrementStatement
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 26
; 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 %a DescriptorSet 0
OpDecorate %a Binding 0
%uint = OpTypeInt 32 0
%v4uint = OpTypeVector %uint 4
%a_block = OpTypeStruct %v4uint
%_ptr_StorageBuffer_a_block = OpTypePointer StorageBuffer %a_block
%a = OpVariable %_ptr_StorageBuffer_a_block StorageBuffer
%void = OpTypeVoid
%6 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%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
%22 = OpAccessChain %_ptr_StorageBuffer_uint %a %uint_0 %uint_2
%23 = OpAccessChain %_ptr_StorageBuffer_uint %a %uint_0 %uint_2
%24 = OpLoad %uint %23
%25 = OpIAdd %uint %24 %uint_1
OpStore %22 %25
OpReturn
OpFunctionEnd

View File

@@ -1,10 +1,11 @@
SKIP: FAILED
#version 310 es
var<workgroup> i : i32;
fn main() {
i++;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
shared int i;
void tint_symbol() {
i = (i + 1);
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,10 +1,10 @@
SKIP: FAILED
var<workgroup> i : i32;
fn main() {
i++;
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement
groupshared int i;
void main() {
i = (i + 1);
}

View File

@@ -1,10 +1,7 @@
SKIP: FAILED
#include <metal_stdlib>
var<workgroup> i : i32;
fn tint_symbol() {
i++;
using namespace metal;
void tint_symbol(threadgroup int* const tint_symbol_1) {
*(tint_symbol_1) = as_type<int>((as_type<uint>(*(tint_symbol_1)) + as_type<uint>(1)));
}
Failed to generate: error: unknown statement type: tint::ast::IncrementDecrementStatement

View File

@@ -1,10 +1,29 @@
SKIP: FAILED
var<workgroup> i : i32;
fn main() {
i++;
}
Failed to generate: Unknown statement: tint::ast::IncrementDecrementStatement
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 13
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %i "i"
OpName %unused_entry_point "unused_entry_point"
OpName %main "main"
%int = OpTypeInt 32 1
%_ptr_Workgroup_int = OpTypePointer Workgroup %int
%i = OpVariable %_ptr_Workgroup_int Workgroup
%void = OpTypeVoid
%4 = OpTypeFunction %void
%int_1 = OpConstant %int 1
%unused_entry_point = OpFunction %void None %4
%7 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %4
%9 = OpLabel
%10 = OpLoad %int %i
%12 = OpIAdd %int %10 %int_1
OpStore %i %12
OpReturn
OpFunctionEnd