mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 21:47:47 +00:00
tint->dawn: Shuffle source tree in preperation of merging repos
docs/ -> docs/tint/ fuzzers/ -> src/tint/fuzzers/ samples/ -> src/tint/cmd/ src/ -> src/tint/ test/ -> test/tint/ BUG=tint:1418,tint:1433 Change-Id: Id2aa79f989aef3245b80ef4aa37a27ff16cd700b Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80482 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
committed by
Tint LUCI CQ
parent
38f1e9c75c
commit
dbc13af287
12
test/tint/builtins/arrayLength/complex_via_let.wgsl
Normal file
12
test/tint/builtins/arrayLength/complex_via_let.wgsl
Normal file
@@ -0,0 +1,12 @@
|
||||
struct S {
|
||||
a : array<i32>;
|
||||
};
|
||||
|
||||
@group(0) @binding(0) var<storage, read> G : S;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let p = &G;
|
||||
let p2 = &((*p).a);
|
||||
let l1 : u32 = arrayLength(p2);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#version 310 es
|
||||
|
||||
layout(binding = 0, std430) buffer S_1 {
|
||||
int a[];
|
||||
} G;
|
||||
void tint_symbol() {
|
||||
uint l1 = uint(G.a.length());
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
ByteAddressBuffer G : register(t0, space0);
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
uint tint_symbol_1 = 0u;
|
||||
G.GetDimensions(tint_symbol_1);
|
||||
const uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u);
|
||||
const uint l1 = tint_symbol_2;
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
};
|
||||
|
||||
struct S {
|
||||
int a[1];
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant tint_symbol_1* tint_symbol_3 [[buffer(30)]]) {
|
||||
uint const l1 = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 12
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpName %G "G"
|
||||
OpName %main "main"
|
||||
OpDecorate %S Block
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %_runtimearr_int ArrayStride 4
|
||||
OpDecorate %G NonWritable
|
||||
OpDecorate %G DescriptorSet 0
|
||||
OpDecorate %G Binding 0
|
||||
%int = OpTypeInt 32 1
|
||||
%_runtimearr_int = OpTypeRuntimeArray %int
|
||||
%S = OpTypeStruct %_runtimearr_int
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%G = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%main = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%10 = OpArrayLength %uint %G 0
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,12 @@
|
||||
struct S {
|
||||
a : array<i32>;
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<storage, read> G : S;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let p = &(G);
|
||||
let p2 = &((*(p)).a);
|
||||
let l1 : u32 = arrayLength(p2);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
@group(0) @binding(0) var<storage, read> G : array<i32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let p = &G;
|
||||
let p2 = &(*p);
|
||||
let l1 : u32 = arrayLength(p2);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#version 310 es
|
||||
|
||||
layout(binding = 0, std430) buffer G_block_1 {
|
||||
int inner[];
|
||||
} G;
|
||||
void tint_symbol() {
|
||||
uint l1 = uint(G.inner.length());
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
ByteAddressBuffer G : register(t0, space0);
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
uint tint_symbol_1 = 0u;
|
||||
G.GetDimensions(tint_symbol_1);
|
||||
const uint tint_symbol_2 = (tint_symbol_1 / 4u);
|
||||
const uint l1 = tint_symbol_2;
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant tint_symbol_1* tint_symbol_3 [[buffer(30)]]) {
|
||||
uint const l1 = ((*(tint_symbol_3)).buffer_size[0u][0u] / 4u);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 12
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %G_block "G_block"
|
||||
OpMemberName %G_block 0 "inner"
|
||||
OpName %G "G"
|
||||
OpName %main "main"
|
||||
OpDecorate %G_block Block
|
||||
OpMemberDecorate %G_block 0 Offset 0
|
||||
OpDecorate %_runtimearr_int ArrayStride 4
|
||||
OpDecorate %G NonWritable
|
||||
OpDecorate %G DescriptorSet 0
|
||||
OpDecorate %G Binding 0
|
||||
%int = OpTypeInt 32 1
|
||||
%_runtimearr_int = OpTypeRuntimeArray %int
|
||||
%G_block = OpTypeStruct %_runtimearr_int
|
||||
%_ptr_StorageBuffer_G_block = OpTypePointer StorageBuffer %G_block
|
||||
%G = OpVariable %_ptr_StorageBuffer_G_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%main = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%10 = OpArrayLength %uint %G 0
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,8 @@
|
||||
@group(0) @binding(0) var<storage, read> G : array<i32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let p = &(G);
|
||||
let p2 = &(*(p));
|
||||
let l1 : u32 = arrayLength(p2);
|
||||
}
|
||||
13
test/tint/builtins/arrayLength/deprecated.wgsl
Normal file
13
test/tint/builtins/arrayLength/deprecated.wgsl
Normal file
@@ -0,0 +1,13 @@
|
||||
struct S {
|
||||
a : array<i32>;
|
||||
};
|
||||
|
||||
@group(0) @binding(0) var<storage, read> G : S;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let l1 : u32 = arrayLength(&G.a);
|
||||
|
||||
let p = &G.a;
|
||||
let l2 : u32 = arrayLength(p);
|
||||
}
|
||||
15
test/tint/builtins/arrayLength/deprecated.wgsl.expected.glsl
Normal file
15
test/tint/builtins/arrayLength/deprecated.wgsl.expected.glsl
Normal file
@@ -0,0 +1,15 @@
|
||||
#version 310 es
|
||||
|
||||
layout(binding = 0, std430) buffer S_1 {
|
||||
int a[];
|
||||
} G;
|
||||
void tint_symbol() {
|
||||
uint l1 = uint(G.a.length());
|
||||
uint l2 = uint(G.a.length());
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
11
test/tint/builtins/arrayLength/deprecated.wgsl.expected.hlsl
Normal file
11
test/tint/builtins/arrayLength/deprecated.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,11 @@
|
||||
ByteAddressBuffer G : register(t0, space0);
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
uint tint_symbol_1 = 0u;
|
||||
G.GetDimensions(tint_symbol_1);
|
||||
const uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u);
|
||||
const uint l1 = tint_symbol_2;
|
||||
const uint l2 = tint_symbol_2;
|
||||
return;
|
||||
}
|
||||
17
test/tint/builtins/arrayLength/deprecated.wgsl.expected.msl
Normal file
17
test/tint/builtins/arrayLength/deprecated.wgsl.expected.msl
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
};
|
||||
|
||||
struct S {
|
||||
int a[1];
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant tint_symbol_1* tint_symbol_3 [[buffer(30)]]) {
|
||||
uint const l1 = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
|
||||
uint const l2 = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 13
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpName %G "G"
|
||||
OpName %main "main"
|
||||
OpDecorate %S Block
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %_runtimearr_int ArrayStride 4
|
||||
OpDecorate %G NonWritable
|
||||
OpDecorate %G DescriptorSet 0
|
||||
OpDecorate %G Binding 0
|
||||
%int = OpTypeInt 32 1
|
||||
%_runtimearr_int = OpTypeRuntimeArray %int
|
||||
%S = OpTypeStruct %_runtimearr_int
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%G = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%main = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%10 = OpArrayLength %uint %G 0
|
||||
%12 = OpArrayLength %uint %G 0
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
12
test/tint/builtins/arrayLength/deprecated.wgsl.expected.wgsl
Normal file
12
test/tint/builtins/arrayLength/deprecated.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,12 @@
|
||||
struct S {
|
||||
a : array<i32>;
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<storage, read> G : S;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let l1 : u32 = arrayLength(&(G.a));
|
||||
let p = &(G.a);
|
||||
let l2 : u32 = arrayLength(p);
|
||||
}
|
||||
10
test/tint/builtins/arrayLength/simple.wgsl
Normal file
10
test/tint/builtins/arrayLength/simple.wgsl
Normal file
@@ -0,0 +1,10 @@
|
||||
struct S {
|
||||
a : array<i32>;
|
||||
};
|
||||
|
||||
@group(0) @binding(0) var<storage, read> G : S;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let l1 : u32 = arrayLength(&G.a);
|
||||
}
|
||||
14
test/tint/builtins/arrayLength/simple.wgsl.expected.glsl
Normal file
14
test/tint/builtins/arrayLength/simple.wgsl.expected.glsl
Normal file
@@ -0,0 +1,14 @@
|
||||
#version 310 es
|
||||
|
||||
layout(binding = 0, std430) buffer S_1 {
|
||||
int a[];
|
||||
} G;
|
||||
void tint_symbol() {
|
||||
uint l1 = uint(G.a.length());
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
10
test/tint/builtins/arrayLength/simple.wgsl.expected.hlsl
Normal file
10
test/tint/builtins/arrayLength/simple.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,10 @@
|
||||
ByteAddressBuffer G : register(t0, space0);
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
uint tint_symbol_1 = 0u;
|
||||
G.GetDimensions(tint_symbol_1);
|
||||
const uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u);
|
||||
const uint l1 = tint_symbol_2;
|
||||
return;
|
||||
}
|
||||
16
test/tint/builtins/arrayLength/simple.wgsl.expected.msl
Normal file
16
test/tint/builtins/arrayLength/simple.wgsl.expected.msl
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
};
|
||||
|
||||
struct S {
|
||||
int a[1];
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant tint_symbol_1* tint_symbol_3 [[buffer(30)]]) {
|
||||
uint const l1 = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
|
||||
return;
|
||||
}
|
||||
|
||||
32
test/tint/builtins/arrayLength/simple.wgsl.expected.spvasm
Normal file
32
test/tint/builtins/arrayLength/simple.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,32 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 12
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpName %G "G"
|
||||
OpName %main "main"
|
||||
OpDecorate %S Block
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %_runtimearr_int ArrayStride 4
|
||||
OpDecorate %G NonWritable
|
||||
OpDecorate %G DescriptorSet 0
|
||||
OpDecorate %G Binding 0
|
||||
%int = OpTypeInt 32 1
|
||||
%_runtimearr_int = OpTypeRuntimeArray %int
|
||||
%S = OpTypeStruct %_runtimearr_int
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%G = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%main = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%10 = OpArrayLength %uint %G 0
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
10
test/tint/builtins/arrayLength/simple.wgsl.expected.wgsl
Normal file
10
test/tint/builtins/arrayLength/simple.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,10 @@
|
||||
struct S {
|
||||
a : array<i32>;
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<storage, read> G : S;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let l1 : u32 = arrayLength(&(G.a));
|
||||
}
|
||||
6
test/tint/builtins/arrayLength/simple_no_struct.wgsl
Normal file
6
test/tint/builtins/arrayLength/simple_no_struct.wgsl
Normal file
@@ -0,0 +1,6 @@
|
||||
@group(0) @binding(0) var<storage, read> G : array<i32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let l1 : u32 = arrayLength(&G);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#version 310 es
|
||||
|
||||
layout(binding = 0, std430) buffer G_block_1 {
|
||||
int inner[];
|
||||
} G;
|
||||
void tint_symbol() {
|
||||
uint l1 = uint(G.inner.length());
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
ByteAddressBuffer G : register(t0, space0);
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
uint tint_symbol_1 = 0u;
|
||||
G.GetDimensions(tint_symbol_1);
|
||||
const uint tint_symbol_2 = (tint_symbol_1 / 4u);
|
||||
const uint l1 = tint_symbol_2;
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant tint_symbol_1* tint_symbol_3 [[buffer(30)]]) {
|
||||
uint const l1 = ((*(tint_symbol_3)).buffer_size[0u][0u] / 4u);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 12
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %G_block "G_block"
|
||||
OpMemberName %G_block 0 "inner"
|
||||
OpName %G "G"
|
||||
OpName %main "main"
|
||||
OpDecorate %G_block Block
|
||||
OpMemberDecorate %G_block 0 Offset 0
|
||||
OpDecorate %_runtimearr_int ArrayStride 4
|
||||
OpDecorate %G NonWritable
|
||||
OpDecorate %G DescriptorSet 0
|
||||
OpDecorate %G Binding 0
|
||||
%int = OpTypeInt 32 1
|
||||
%_runtimearr_int = OpTypeRuntimeArray %int
|
||||
%G_block = OpTypeStruct %_runtimearr_int
|
||||
%_ptr_StorageBuffer_G_block = OpTypePointer StorageBuffer %G_block
|
||||
%G = OpVariable %_ptr_StorageBuffer_G_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%main = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%10 = OpArrayLength %uint %G 0
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,6 @@
|
||||
@group(0) @binding(0) var<storage, read> G : array<i32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let l1 : u32 = arrayLength(&(G));
|
||||
}
|
||||
12
test/tint/builtins/arrayLength/via_let.wgsl
Normal file
12
test/tint/builtins/arrayLength/via_let.wgsl
Normal file
@@ -0,0 +1,12 @@
|
||||
struct S {
|
||||
a : array<i32>;
|
||||
};
|
||||
|
||||
@group(0) @binding(0) var<storage, read> G : S;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let p = &G.a;
|
||||
let p2 = p;
|
||||
let l1 : u32 = arrayLength(p2);
|
||||
}
|
||||
14
test/tint/builtins/arrayLength/via_let.wgsl.expected.glsl
Normal file
14
test/tint/builtins/arrayLength/via_let.wgsl.expected.glsl
Normal file
@@ -0,0 +1,14 @@
|
||||
#version 310 es
|
||||
|
||||
layout(binding = 0, std430) buffer S_1 {
|
||||
int a[];
|
||||
} G;
|
||||
void tint_symbol() {
|
||||
uint l1 = uint(G.a.length());
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
10
test/tint/builtins/arrayLength/via_let.wgsl.expected.hlsl
Normal file
10
test/tint/builtins/arrayLength/via_let.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,10 @@
|
||||
ByteAddressBuffer G : register(t0, space0);
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
uint tint_symbol_1 = 0u;
|
||||
G.GetDimensions(tint_symbol_1);
|
||||
const uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u);
|
||||
const uint l1 = tint_symbol_2;
|
||||
return;
|
||||
}
|
||||
16
test/tint/builtins/arrayLength/via_let.wgsl.expected.msl
Normal file
16
test/tint/builtins/arrayLength/via_let.wgsl.expected.msl
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
};
|
||||
|
||||
struct S {
|
||||
int a[1];
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant tint_symbol_1* tint_symbol_3 [[buffer(30)]]) {
|
||||
uint const l1 = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
|
||||
return;
|
||||
}
|
||||
|
||||
32
test/tint/builtins/arrayLength/via_let.wgsl.expected.spvasm
Normal file
32
test/tint/builtins/arrayLength/via_let.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,32 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 12
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpName %G "G"
|
||||
OpName %main "main"
|
||||
OpDecorate %S Block
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %_runtimearr_int ArrayStride 4
|
||||
OpDecorate %G NonWritable
|
||||
OpDecorate %G DescriptorSet 0
|
||||
OpDecorate %G Binding 0
|
||||
%int = OpTypeInt 32 1
|
||||
%_runtimearr_int = OpTypeRuntimeArray %int
|
||||
%S = OpTypeStruct %_runtimearr_int
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%G = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%main = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%10 = OpArrayLength %uint %G 0
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
12
test/tint/builtins/arrayLength/via_let.wgsl.expected.wgsl
Normal file
12
test/tint/builtins/arrayLength/via_let.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,12 @@
|
||||
struct S {
|
||||
a : array<i32>;
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<storage, read> G : S;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let p = &(G.a);
|
||||
let p2 = p;
|
||||
let l1 : u32 = arrayLength(p2);
|
||||
}
|
||||
13
test/tint/builtins/arrayLength/via_let_complex.wgsl
Normal file
13
test/tint/builtins/arrayLength/via_let_complex.wgsl
Normal file
@@ -0,0 +1,13 @@
|
||||
struct S {
|
||||
a : array<i32>;
|
||||
};
|
||||
|
||||
@group(0) @binding(0) var<storage, read> G : S;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let p = &*&G;
|
||||
let p2 = &*p;
|
||||
let p3 = &((*p).a);
|
||||
let l1 : u32 = arrayLength(&*p3);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#version 310 es
|
||||
|
||||
layout(binding = 0, std430) buffer S_1 {
|
||||
int a[];
|
||||
} G;
|
||||
void tint_symbol() {
|
||||
uint l1 = uint(G.a.length());
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
ByteAddressBuffer G : register(t0, space0);
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
uint tint_symbol_1 = 0u;
|
||||
G.GetDimensions(tint_symbol_1);
|
||||
const uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u);
|
||||
const uint l1 = tint_symbol_2;
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
};
|
||||
|
||||
struct S {
|
||||
int a[1];
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant tint_symbol_1* tint_symbol_3 [[buffer(30)]]) {
|
||||
uint const l1 = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 12
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpName %G "G"
|
||||
OpName %main "main"
|
||||
OpDecorate %S Block
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %_runtimearr_int ArrayStride 4
|
||||
OpDecorate %G NonWritable
|
||||
OpDecorate %G DescriptorSet 0
|
||||
OpDecorate %G Binding 0
|
||||
%int = OpTypeInt 32 1
|
||||
%_runtimearr_int = OpTypeRuntimeArray %int
|
||||
%S = OpTypeStruct %_runtimearr_int
|
||||
%_ptr_StorageBuffer_S = OpTypePointer StorageBuffer %S
|
||||
%G = OpVariable %_ptr_StorageBuffer_S StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%main = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%10 = OpArrayLength %uint %G 0
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,13 @@
|
||||
struct S {
|
||||
a : array<i32>;
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<storage, read> G : S;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let p = &(*(&(G)));
|
||||
let p2 = &(*(p));
|
||||
let p3 = &((*(p)).a);
|
||||
let l1 : u32 = arrayLength(&(*(p3)));
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
@group(0) @binding(0) var<storage, read> G : array<i32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let p = &*&G;
|
||||
let p2 = &*p;
|
||||
let p3 = &(*p);
|
||||
let l1 : u32 = arrayLength(&*p3);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#version 310 es
|
||||
|
||||
layout(binding = 0, std430) buffer G_block_1 {
|
||||
int inner[];
|
||||
} G;
|
||||
void tint_symbol() {
|
||||
uint l1 = uint(G.inner.length());
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
ByteAddressBuffer G : register(t0, space0);
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
uint tint_symbol_1 = 0u;
|
||||
G.GetDimensions(tint_symbol_1);
|
||||
const uint tint_symbol_2 = (tint_symbol_1 / 4u);
|
||||
const uint l1 = tint_symbol_2;
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant tint_symbol_1* tint_symbol_3 [[buffer(30)]]) {
|
||||
uint const l1 = ((*(tint_symbol_3)).buffer_size[0u][0u] / 4u);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 12
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %G_block "G_block"
|
||||
OpMemberName %G_block 0 "inner"
|
||||
OpName %G "G"
|
||||
OpName %main "main"
|
||||
OpDecorate %G_block Block
|
||||
OpMemberDecorate %G_block 0 Offset 0
|
||||
OpDecorate %_runtimearr_int ArrayStride 4
|
||||
OpDecorate %G NonWritable
|
||||
OpDecorate %G DescriptorSet 0
|
||||
OpDecorate %G Binding 0
|
||||
%int = OpTypeInt 32 1
|
||||
%_runtimearr_int = OpTypeRuntimeArray %int
|
||||
%G_block = OpTypeStruct %_runtimearr_int
|
||||
%_ptr_StorageBuffer_G_block = OpTypePointer StorageBuffer %G_block
|
||||
%G = OpVariable %_ptr_StorageBuffer_G_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%main = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%10 = OpArrayLength %uint %G 0
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,9 @@
|
||||
@group(0) @binding(0) var<storage, read> G : array<i32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let p = &(*(&(G)));
|
||||
let p2 = &(*(p));
|
||||
let p3 = &(*(p));
|
||||
let l1 : u32 = arrayLength(&(*(p3)));
|
||||
}
|
||||
8
test/tint/builtins/arrayLength/via_let_no_struct.wgsl
Normal file
8
test/tint/builtins/arrayLength/via_let_no_struct.wgsl
Normal file
@@ -0,0 +1,8 @@
|
||||
@group(0) @binding(0) var<storage, read> G : array<i32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let p = &G;
|
||||
let p2 = p;
|
||||
let l1 : u32 = arrayLength(p2);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#version 310 es
|
||||
|
||||
layout(binding = 0, std430) buffer G_block_1 {
|
||||
int inner[];
|
||||
} G;
|
||||
void tint_symbol() {
|
||||
uint l1 = uint(G.inner.length());
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
ByteAddressBuffer G : register(t0, space0);
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
uint tint_symbol_1 = 0u;
|
||||
G.GetDimensions(tint_symbol_1);
|
||||
const uint tint_symbol_2 = (tint_symbol_1 / 4u);
|
||||
const uint l1 = tint_symbol_2;
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant tint_symbol_1* tint_symbol_3 [[buffer(30)]]) {
|
||||
uint const l1 = ((*(tint_symbol_3)).buffer_size[0u][0u] / 4u);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 12
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %G_block "G_block"
|
||||
OpMemberName %G_block 0 "inner"
|
||||
OpName %G "G"
|
||||
OpName %main "main"
|
||||
OpDecorate %G_block Block
|
||||
OpMemberDecorate %G_block 0 Offset 0
|
||||
OpDecorate %_runtimearr_int ArrayStride 4
|
||||
OpDecorate %G NonWritable
|
||||
OpDecorate %G DescriptorSet 0
|
||||
OpDecorate %G Binding 0
|
||||
%int = OpTypeInt 32 1
|
||||
%_runtimearr_int = OpTypeRuntimeArray %int
|
||||
%G_block = OpTypeStruct %_runtimearr_int
|
||||
%_ptr_StorageBuffer_G_block = OpTypePointer StorageBuffer %G_block
|
||||
%G = OpVariable %_ptr_StorageBuffer_G_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%main = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
%10 = OpArrayLength %uint %G 0
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,8 @@
|
||||
@group(0) @binding(0) var<storage, read> G : array<i32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
let p = &(G);
|
||||
let p2 = p;
|
||||
let l1 : u32 = arrayLength(p2);
|
||||
}
|
||||
Reference in New Issue
Block a user