mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-18 01:15:39 +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
5
test/tint/var/initialization/function/array.wgsl
Normal file
5
test/tint/var/initialization/function/array.wgsl
Normal file
@@ -0,0 +1,5 @@
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
var v : array<i32, 3>;
|
||||
_ = v;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#version 310 es
|
||||
|
||||
void tint_symbol() {
|
||||
int v[3] = int[3](0, 0, 0);
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
int v[3] = (int[3])0;
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
int arr[3];
|
||||
};
|
||||
|
||||
kernel void tint_symbol() {
|
||||
tint_array_wrapper v = {};
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
; 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 %main "main"
|
||||
OpName %v "v"
|
||||
OpDecorate %_arr_int_uint_3 ArrayStride 4
|
||||
%void = OpTypeVoid
|
||||
%1 = OpTypeFunction %void
|
||||
%int = OpTypeInt 32 1
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_3 = OpConstant %uint 3
|
||||
%_arr_int_uint_3 = OpTypeArray %int %uint_3
|
||||
%_ptr_Function__arr_int_uint_3 = OpTypePointer Function %_arr_int_uint_3
|
||||
%11 = OpConstantNull %_arr_int_uint_3
|
||||
%main = OpFunction %void None %1
|
||||
%4 = OpLabel
|
||||
%v = OpVariable %_ptr_Function__arr_int_uint_3 Function %11
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,5 @@
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
var v : array<i32, 3>;
|
||||
_ = v;
|
||||
}
|
||||
5
test/tint/var/initialization/function/matrix.wgsl
Normal file
5
test/tint/var/initialization/function/matrix.wgsl
Normal file
@@ -0,0 +1,5 @@
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
var v : mat2x3<f32>;
|
||||
_ = v;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#version 310 es
|
||||
|
||||
void tint_symbol() {
|
||||
mat2x3 v = mat2x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
float2x3 v = float2x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
kernel void tint_symbol() {
|
||||
float2x3 v = float2x3(0.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 11
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %main "main"
|
||||
OpName %v "v"
|
||||
%void = OpTypeVoid
|
||||
%1 = OpTypeFunction %void
|
||||
%float = OpTypeFloat 32
|
||||
%v3float = OpTypeVector %float 3
|
||||
%mat2v3float = OpTypeMatrix %v3float 2
|
||||
%_ptr_Function_mat2v3float = OpTypePointer Function %mat2v3float
|
||||
%10 = OpConstantNull %mat2v3float
|
||||
%main = OpFunction %void None %1
|
||||
%4 = OpLabel
|
||||
%v = OpVariable %_ptr_Function_mat2v3float Function %10
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,5 @@
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
var v : mat2x3<f32>;
|
||||
_ = v;
|
||||
}
|
||||
5
test/tint/var/initialization/function/scalar.wgsl
Normal file
5
test/tint/var/initialization/function/scalar.wgsl
Normal file
@@ -0,0 +1,5 @@
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
var v : i32;
|
||||
_ = v;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#version 310 es
|
||||
|
||||
void tint_symbol() {
|
||||
int v = 0;
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
int v = 0;
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
kernel void tint_symbol() {
|
||||
int v = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 9
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %main "main"
|
||||
OpName %v "v"
|
||||
%void = OpTypeVoid
|
||||
%1 = OpTypeFunction %void
|
||||
%int = OpTypeInt 32 1
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%8 = OpConstantNull %int
|
||||
%main = OpFunction %void None %1
|
||||
%4 = OpLabel
|
||||
%v = OpVariable %_ptr_Function_int Function %8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,5 @@
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
var v : i32;
|
||||
_ = v;
|
||||
}
|
||||
10
test/tint/var/initialization/function/struct.wgsl
Normal file
10
test/tint/var/initialization/function/struct.wgsl
Normal file
@@ -0,0 +1,10 @@
|
||||
struct S {
|
||||
a : i32;
|
||||
b : f32;
|
||||
};
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
var v : S;
|
||||
_ = v;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#version 310 es
|
||||
|
||||
struct S {
|
||||
int a;
|
||||
float b;
|
||||
};
|
||||
|
||||
void tint_symbol() {
|
||||
S v = S(0, 0.0f);
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
struct S {
|
||||
int a;
|
||||
float b;
|
||||
};
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
S v = (S)0;
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct S {
|
||||
int a;
|
||||
float b;
|
||||
};
|
||||
|
||||
kernel void tint_symbol() {
|
||||
S v = {};
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 11
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %main "main"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpMemberName %S 1 "b"
|
||||
OpName %v "v"
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpMemberDecorate %S 1 Offset 4
|
||||
%void = OpTypeVoid
|
||||
%1 = OpTypeFunction %void
|
||||
%int = OpTypeInt 32 1
|
||||
%float = OpTypeFloat 32
|
||||
%S = OpTypeStruct %int %float
|
||||
%_ptr_Function_S = OpTypePointer Function %S
|
||||
%10 = OpConstantNull %S
|
||||
%main = OpFunction %void None %1
|
||||
%4 = OpLabel
|
||||
%v = OpVariable %_ptr_Function_S Function %10
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,10 @@
|
||||
struct S {
|
||||
a : i32;
|
||||
b : f32;
|
||||
}
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
var v : S;
|
||||
_ = v;
|
||||
}
|
||||
5
test/tint/var/initialization/function/vector.wgsl
Normal file
5
test/tint/var/initialization/function/vector.wgsl
Normal file
@@ -0,0 +1,5 @@
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
var v : vec3<i32>;
|
||||
_ = v;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#version 310 es
|
||||
|
||||
void tint_symbol() {
|
||||
ivec3 v = ivec3(0, 0, 0);
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
int3 v = int3(0, 0, 0);
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
kernel void tint_symbol() {
|
||||
int3 v = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 10
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %main "main"
|
||||
OpName %v "v"
|
||||
%void = OpTypeVoid
|
||||
%1 = OpTypeFunction %void
|
||||
%int = OpTypeInt 32 1
|
||||
%v3int = OpTypeVector %int 3
|
||||
%_ptr_Function_v3int = OpTypePointer Function %v3int
|
||||
%9 = OpConstantNull %v3int
|
||||
%main = OpFunction %void None %1
|
||||
%4 = OpLabel
|
||||
%v = OpVariable %_ptr_Function_v3int Function %9
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,5 @@
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
var v : vec3<i32>;
|
||||
_ = v;
|
||||
}
|
||||
6
test/tint/var/initialization/private/array.wgsl
Normal file
6
test/tint/var/initialization/private/array.wgsl
Normal file
@@ -0,0 +1,6 @@
|
||||
var<private> v : array<i32, 3>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
_ = v;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#version 310 es
|
||||
|
||||
int v[3] = int[3](0, 0, 0);
|
||||
void tint_symbol() {
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
static int v[3] = (int[3])0;
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
return;
|
||||
}
|
||||
11
test/tint/var/initialization/private/array.wgsl.expected.msl
Normal file
11
test/tint/var/initialization/private/array.wgsl.expected.msl
Normal file
@@ -0,0 +1,11 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
int arr[3];
|
||||
};
|
||||
|
||||
kernel void tint_symbol() {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
; 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 %v "v"
|
||||
OpName %main "main"
|
||||
OpDecorate %_arr_int_uint_3 ArrayStride 4
|
||||
%int = OpTypeInt 32 1
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_3 = OpConstant %uint 3
|
||||
%_arr_int_uint_3 = OpTypeArray %int %uint_3
|
||||
%_ptr_Private__arr_int_uint_3 = OpTypePointer Private %_arr_int_uint_3
|
||||
%7 = OpConstantNull %_arr_int_uint_3
|
||||
%v = OpVariable %_ptr_Private__arr_int_uint_3 Private %7
|
||||
%void = OpTypeVoid
|
||||
%8 = OpTypeFunction %void
|
||||
%main = OpFunction %void None %8
|
||||
%11 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,6 @@
|
||||
var<private> v : array<i32, 3>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
_ = v;
|
||||
}
|
||||
6
test/tint/var/initialization/private/matrix.wgsl
Normal file
6
test/tint/var/initialization/private/matrix.wgsl
Normal file
@@ -0,0 +1,6 @@
|
||||
var<private> v : mat2x3<f32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
_ = v;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#version 310 es
|
||||
|
||||
mat2x3 v = mat2x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
void tint_symbol() {
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
static float2x3 v = float2x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
kernel void tint_symbol() {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 11
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %v "v"
|
||||
OpName %main "main"
|
||||
%float = OpTypeFloat 32
|
||||
%v3float = OpTypeVector %float 3
|
||||
%mat2v3float = OpTypeMatrix %v3float 2
|
||||
%_ptr_Private_mat2v3float = OpTypePointer Private %mat2v3float
|
||||
%6 = OpConstantNull %mat2v3float
|
||||
%v = OpVariable %_ptr_Private_mat2v3float Private %6
|
||||
%void = OpTypeVoid
|
||||
%7 = OpTypeFunction %void
|
||||
%main = OpFunction %void None %7
|
||||
%10 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,6 @@
|
||||
var<private> v : mat2x3<f32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
_ = v;
|
||||
}
|
||||
6
test/tint/var/initialization/private/scalar.wgsl
Normal file
6
test/tint/var/initialization/private/scalar.wgsl
Normal file
@@ -0,0 +1,6 @@
|
||||
var<private> v : i32;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
_ = v;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#version 310 es
|
||||
|
||||
int v = 0;
|
||||
void tint_symbol() {
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
static int v = 0;
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
kernel void tint_symbol() {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 9
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %v "v"
|
||||
OpName %main "main"
|
||||
%int = OpTypeInt 32 1
|
||||
%_ptr_Private_int = OpTypePointer Private %int
|
||||
%4 = OpConstantNull %int
|
||||
%v = OpVariable %_ptr_Private_int Private %4
|
||||
%void = OpTypeVoid
|
||||
%5 = OpTypeFunction %void
|
||||
%main = OpFunction %void None %5
|
||||
%8 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,6 @@
|
||||
var<private> v : i32;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
_ = v;
|
||||
}
|
||||
11
test/tint/var/initialization/private/struct.wgsl
Normal file
11
test/tint/var/initialization/private/struct.wgsl
Normal file
@@ -0,0 +1,11 @@
|
||||
struct S {
|
||||
a : i32;
|
||||
b : f32;
|
||||
};
|
||||
|
||||
var<private> v : S;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
_ = v;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#version 310 es
|
||||
|
||||
struct S {
|
||||
int a;
|
||||
float b;
|
||||
};
|
||||
|
||||
S v = S(0, 0.0f);
|
||||
void tint_symbol() {
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
struct S {
|
||||
int a;
|
||||
float b;
|
||||
};
|
||||
|
||||
static S v = (S)0;
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct S {
|
||||
int a;
|
||||
float b;
|
||||
};
|
||||
|
||||
kernel void tint_symbol() {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 11
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpMemberName %S 1 "b"
|
||||
OpName %v "v"
|
||||
OpName %main "main"
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpMemberDecorate %S 1 Offset 4
|
||||
%int = OpTypeInt 32 1
|
||||
%float = OpTypeFloat 32
|
||||
%S = OpTypeStruct %int %float
|
||||
%_ptr_Private_S = OpTypePointer Private %S
|
||||
%6 = OpConstantNull %S
|
||||
%v = OpVariable %_ptr_Private_S Private %6
|
||||
%void = OpTypeVoid
|
||||
%7 = OpTypeFunction %void
|
||||
%main = OpFunction %void None %7
|
||||
%10 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,11 @@
|
||||
struct S {
|
||||
a : i32;
|
||||
b : f32;
|
||||
}
|
||||
|
||||
var<private> v : S;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
_ = v;
|
||||
}
|
||||
6
test/tint/var/initialization/private/vector.wgsl
Normal file
6
test/tint/var/initialization/private/vector.wgsl
Normal file
@@ -0,0 +1,6 @@
|
||||
var<private> v : vec3<i32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
_ = v;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#version 310 es
|
||||
|
||||
ivec3 v = ivec3(0, 0, 0);
|
||||
void tint_symbol() {
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol();
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
static int3 v = int3(0, 0, 0);
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
kernel void tint_symbol() {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 10
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main"
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %v "v"
|
||||
OpName %main "main"
|
||||
%int = OpTypeInt 32 1
|
||||
%v3int = OpTypeVector %int 3
|
||||
%_ptr_Private_v3int = OpTypePointer Private %v3int
|
||||
%5 = OpConstantNull %v3int
|
||||
%v = OpVariable %_ptr_Private_v3int Private %5
|
||||
%void = OpTypeVoid
|
||||
%6 = OpTypeFunction %void
|
||||
%main = OpFunction %void None %6
|
||||
%9 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,6 @@
|
||||
var<private> v : vec3<i32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
_ = v;
|
||||
}
|
||||
6
test/tint/var/initialization/workgroup/array.wgsl
Normal file
6
test/tint/var/initialization/workgroup/array.wgsl
Normal file
@@ -0,0 +1,6 @@
|
||||
var<workgroup> v : array<i32, 3>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
_ = v;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#version 310 es
|
||||
|
||||
shared int v[3];
|
||||
void tint_symbol(uint local_invocation_index) {
|
||||
{
|
||||
for(uint idx = local_invocation_index; (idx < 3u); idx = (idx + 1u)) {
|
||||
uint i = idx;
|
||||
v[i] = 0;
|
||||
}
|
||||
}
|
||||
barrier();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol(gl_LocalInvocationIndex);
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
groupshared int v[3];
|
||||
|
||||
struct tint_symbol_1 {
|
||||
uint local_invocation_index : SV_GroupIndex;
|
||||
};
|
||||
|
||||
void main_inner(uint local_invocation_index) {
|
||||
{
|
||||
[loop] for(uint idx = local_invocation_index; (idx < 3u); idx = (idx + 1u)) {
|
||||
const uint i = idx;
|
||||
v[i] = 0;
|
||||
}
|
||||
}
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main(tint_symbol_1 tint_symbol) {
|
||||
main_inner(tint_symbol.local_invocation_index);
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
int arr[3];
|
||||
};
|
||||
|
||||
void tint_symbol_inner(uint local_invocation_index, threadgroup tint_array_wrapper* const tint_symbol_1) {
|
||||
for(uint idx = local_invocation_index; (idx < 3u); idx = (idx + 1u)) {
|
||||
uint const i = idx;
|
||||
(*(tint_symbol_1)).arr[i] = int();
|
||||
}
|
||||
threadgroup_barrier(mem_flags::mem_threadgroup);
|
||||
}
|
||||
|
||||
kernel void tint_symbol(uint local_invocation_index [[thread_index_in_threadgroup]]) {
|
||||
threadgroup tint_array_wrapper tint_symbol_2;
|
||||
tint_symbol_inner(local_invocation_index, &(tint_symbol_2));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 42
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main" %local_invocation_index_1
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %local_invocation_index_1 "local_invocation_index_1"
|
||||
OpName %v "v"
|
||||
OpName %main_inner "main_inner"
|
||||
OpName %local_invocation_index "local_invocation_index"
|
||||
OpName %idx "idx"
|
||||
OpName %main "main"
|
||||
OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
|
||||
OpDecorate %_arr_int_uint_3 ArrayStride 4
|
||||
%uint = OpTypeInt 32 0
|
||||
%_ptr_Input_uint = OpTypePointer Input %uint
|
||||
%local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
|
||||
%int = OpTypeInt 32 1
|
||||
%uint_3 = OpConstant %uint 3
|
||||
%_arr_int_uint_3 = OpTypeArray %int %uint_3
|
||||
%_ptr_Workgroup__arr_int_uint_3 = OpTypePointer Workgroup %_arr_int_uint_3
|
||||
%v = OpVariable %_ptr_Workgroup__arr_int_uint_3 Workgroup
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void %uint
|
||||
%_ptr_Function_uint = OpTypePointer Function %uint
|
||||
%16 = OpConstantNull %uint
|
||||
%bool = OpTypeBool
|
||||
%_ptr_Workgroup_int = OpTypePointer Workgroup %int
|
||||
%30 = OpConstantNull %int
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%uint_2 = OpConstant %uint 2
|
||||
%uint_264 = OpConstant %uint 264
|
||||
%37 = OpTypeFunction %void
|
||||
%main_inner = OpFunction %void None %9
|
||||
%local_invocation_index = OpFunctionParameter %uint
|
||||
%13 = OpLabel
|
||||
%idx = OpVariable %_ptr_Function_uint Function %16
|
||||
OpStore %idx %local_invocation_index
|
||||
OpBranch %17
|
||||
%17 = OpLabel
|
||||
OpLoopMerge %18 %19 None
|
||||
OpBranch %20
|
||||
%20 = OpLabel
|
||||
%22 = OpLoad %uint %idx
|
||||
%23 = OpULessThan %bool %22 %uint_3
|
||||
%21 = OpLogicalNot %bool %23
|
||||
OpSelectionMerge %25 None
|
||||
OpBranchConditional %21 %26 %25
|
||||
%26 = OpLabel
|
||||
OpBranch %18
|
||||
%25 = OpLabel
|
||||
%27 = OpLoad %uint %idx
|
||||
%29 = OpAccessChain %_ptr_Workgroup_int %v %27
|
||||
OpStore %29 %30
|
||||
OpBranch %19
|
||||
%19 = OpLabel
|
||||
%31 = OpLoad %uint %idx
|
||||
%33 = OpIAdd %uint %31 %uint_1
|
||||
OpStore %idx %33
|
||||
OpBranch %17
|
||||
%18 = OpLabel
|
||||
OpControlBarrier %uint_2 %uint_2 %uint_264
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %37
|
||||
%39 = OpLabel
|
||||
%41 = OpLoad %uint %local_invocation_index_1
|
||||
%40 = OpFunctionCall %void %main_inner %41
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,6 @@
|
||||
var<workgroup> v : array<i32, 3>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
_ = v;
|
||||
}
|
||||
6
test/tint/var/initialization/workgroup/matrix.wgsl
Normal file
6
test/tint/var/initialization/workgroup/matrix.wgsl
Normal file
@@ -0,0 +1,6 @@
|
||||
var<workgroup> v : mat2x3<f32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
_ = v;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#version 310 es
|
||||
|
||||
shared mat2x3 v;
|
||||
void tint_symbol(uint local_invocation_index) {
|
||||
{
|
||||
v = mat2x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
barrier();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol(gl_LocalInvocationIndex);
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
groupshared float2x3 v;
|
||||
|
||||
struct tint_symbol_1 {
|
||||
uint local_invocation_index : SV_GroupIndex;
|
||||
};
|
||||
|
||||
void main_inner(uint local_invocation_index) {
|
||||
{
|
||||
v = float2x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main(tint_symbol_1 tint_symbol) {
|
||||
main_inner(tint_symbol.local_invocation_index);
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol_4 {
|
||||
float2x3 v;
|
||||
};
|
||||
|
||||
void tint_symbol_inner(uint local_invocation_index, threadgroup float2x3* const tint_symbol_1) {
|
||||
{
|
||||
*(tint_symbol_1) = float2x3();
|
||||
}
|
||||
threadgroup_barrier(mem_flags::mem_threadgroup);
|
||||
}
|
||||
|
||||
kernel void tint_symbol(threadgroup tint_symbol_4* tint_symbol_3 [[threadgroup(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
|
||||
threadgroup float2x3* const tint_symbol_2 = &((*(tint_symbol_3)).v);
|
||||
tint_symbol_inner(local_invocation_index, tint_symbol_2);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 23
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main" %local_invocation_index_1
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %local_invocation_index_1 "local_invocation_index_1"
|
||||
OpName %v "v"
|
||||
OpName %main_inner "main_inner"
|
||||
OpName %local_invocation_index "local_invocation_index"
|
||||
OpName %main "main"
|
||||
OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
|
||||
%uint = OpTypeInt 32 0
|
||||
%_ptr_Input_uint = OpTypePointer Input %uint
|
||||
%local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
|
||||
%float = OpTypeFloat 32
|
||||
%v3float = OpTypeVector %float 3
|
||||
%mat2v3float = OpTypeMatrix %v3float 2
|
||||
%_ptr_Workgroup_mat2v3float = OpTypePointer Workgroup %mat2v3float
|
||||
%v = OpVariable %_ptr_Workgroup_mat2v3float Workgroup
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void %uint
|
||||
%14 = OpConstantNull %mat2v3float
|
||||
%uint_2 = OpConstant %uint 2
|
||||
%uint_264 = OpConstant %uint 264
|
||||
%18 = OpTypeFunction %void
|
||||
%main_inner = OpFunction %void None %9
|
||||
%local_invocation_index = OpFunctionParameter %uint
|
||||
%13 = OpLabel
|
||||
OpStore %v %14
|
||||
OpControlBarrier %uint_2 %uint_2 %uint_264
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %18
|
||||
%20 = OpLabel
|
||||
%22 = OpLoad %uint %local_invocation_index_1
|
||||
%21 = OpFunctionCall %void %main_inner %22
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,6 @@
|
||||
var<workgroup> v : mat2x3<f32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
_ = v;
|
||||
}
|
||||
6
test/tint/var/initialization/workgroup/scalar.wgsl
Normal file
6
test/tint/var/initialization/workgroup/scalar.wgsl
Normal file
@@ -0,0 +1,6 @@
|
||||
var<workgroup> v : i32;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
_ = v;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#version 310 es
|
||||
|
||||
shared int v;
|
||||
void tint_symbol(uint local_invocation_index) {
|
||||
{
|
||||
v = 0;
|
||||
}
|
||||
barrier();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol(gl_LocalInvocationIndex);
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
groupshared int v;
|
||||
|
||||
struct tint_symbol_1 {
|
||||
uint local_invocation_index : SV_GroupIndex;
|
||||
};
|
||||
|
||||
void main_inner(uint local_invocation_index) {
|
||||
{
|
||||
v = 0;
|
||||
}
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main(tint_symbol_1 tint_symbol) {
|
||||
main_inner(tint_symbol.local_invocation_index);
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void tint_symbol_inner(uint local_invocation_index, threadgroup int* const tint_symbol_1) {
|
||||
{
|
||||
*(tint_symbol_1) = int();
|
||||
}
|
||||
threadgroup_barrier(mem_flags::mem_threadgroup);
|
||||
}
|
||||
|
||||
kernel void tint_symbol(uint local_invocation_index [[thread_index_in_threadgroup]]) {
|
||||
threadgroup int tint_symbol_2;
|
||||
tint_symbol_inner(local_invocation_index, &(tint_symbol_2));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 21
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main" %local_invocation_index_1
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %local_invocation_index_1 "local_invocation_index_1"
|
||||
OpName %v "v"
|
||||
OpName %main_inner "main_inner"
|
||||
OpName %local_invocation_index "local_invocation_index"
|
||||
OpName %main "main"
|
||||
OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
|
||||
%uint = OpTypeInt 32 0
|
||||
%_ptr_Input_uint = OpTypePointer Input %uint
|
||||
%local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
|
||||
%int = OpTypeInt 32 1
|
||||
%_ptr_Workgroup_int = OpTypePointer Workgroup %int
|
||||
%v = OpVariable %_ptr_Workgroup_int Workgroup
|
||||
%void = OpTypeVoid
|
||||
%7 = OpTypeFunction %void %uint
|
||||
%12 = OpConstantNull %int
|
||||
%uint_2 = OpConstant %uint 2
|
||||
%uint_264 = OpConstant %uint 264
|
||||
%16 = OpTypeFunction %void
|
||||
%main_inner = OpFunction %void None %7
|
||||
%local_invocation_index = OpFunctionParameter %uint
|
||||
%11 = OpLabel
|
||||
OpStore %v %12
|
||||
OpControlBarrier %uint_2 %uint_2 %uint_264
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %16
|
||||
%18 = OpLabel
|
||||
%20 = OpLoad %uint %local_invocation_index_1
|
||||
%19 = OpFunctionCall %void %main_inner %20
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,6 @@
|
||||
var<workgroup> v : i32;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
_ = v;
|
||||
}
|
||||
11
test/tint/var/initialization/workgroup/struct.wgsl
Normal file
11
test/tint/var/initialization/workgroup/struct.wgsl
Normal file
@@ -0,0 +1,11 @@
|
||||
struct S {
|
||||
a : i32;
|
||||
b : f32;
|
||||
};
|
||||
|
||||
var<workgroup> v : S;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
_ = v;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#version 310 es
|
||||
|
||||
struct S {
|
||||
int a;
|
||||
float b;
|
||||
};
|
||||
|
||||
shared S v;
|
||||
void tint_symbol(uint local_invocation_index) {
|
||||
{
|
||||
S tint_symbol_1 = S(0, 0.0f);
|
||||
v = tint_symbol_1;
|
||||
}
|
||||
barrier();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol(gl_LocalInvocationIndex);
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
struct S {
|
||||
int a;
|
||||
float b;
|
||||
};
|
||||
|
||||
groupshared S v;
|
||||
|
||||
struct tint_symbol_1 {
|
||||
uint local_invocation_index : SV_GroupIndex;
|
||||
};
|
||||
|
||||
void main_inner(uint local_invocation_index) {
|
||||
{
|
||||
const S tint_symbol_2 = (S)0;
|
||||
v = tint_symbol_2;
|
||||
}
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main(tint_symbol_1 tint_symbol) {
|
||||
main_inner(tint_symbol.local_invocation_index);
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct S {
|
||||
int a;
|
||||
float b;
|
||||
};
|
||||
|
||||
void tint_symbol_inner(uint local_invocation_index, threadgroup S* const tint_symbol_2) {
|
||||
{
|
||||
S const tint_symbol_1 = {};
|
||||
*(tint_symbol_2) = tint_symbol_1;
|
||||
}
|
||||
threadgroup_barrier(mem_flags::mem_threadgroup);
|
||||
}
|
||||
|
||||
kernel void tint_symbol(uint local_invocation_index [[thread_index_in_threadgroup]]) {
|
||||
threadgroup S tint_symbol_3;
|
||||
tint_symbol_inner(local_invocation_index, &(tint_symbol_3));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 23
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main" %local_invocation_index_1
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %local_invocation_index_1 "local_invocation_index_1"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "a"
|
||||
OpMemberName %S 1 "b"
|
||||
OpName %v "v"
|
||||
OpName %main_inner "main_inner"
|
||||
OpName %local_invocation_index "local_invocation_index"
|
||||
OpName %main "main"
|
||||
OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpMemberDecorate %S 1 Offset 4
|
||||
%uint = OpTypeInt 32 0
|
||||
%_ptr_Input_uint = OpTypePointer Input %uint
|
||||
%local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
|
||||
%int = OpTypeInt 32 1
|
||||
%float = OpTypeFloat 32
|
||||
%S = OpTypeStruct %int %float
|
||||
%_ptr_Workgroup_S = OpTypePointer Workgroup %S
|
||||
%v = OpVariable %_ptr_Workgroup_S Workgroup
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void %uint
|
||||
%14 = OpConstantNull %S
|
||||
%uint_2 = OpConstant %uint 2
|
||||
%uint_264 = OpConstant %uint 264
|
||||
%18 = OpTypeFunction %void
|
||||
%main_inner = OpFunction %void None %9
|
||||
%local_invocation_index = OpFunctionParameter %uint
|
||||
%13 = OpLabel
|
||||
OpStore %v %14
|
||||
OpControlBarrier %uint_2 %uint_2 %uint_264
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %18
|
||||
%20 = OpLabel
|
||||
%22 = OpLoad %uint %local_invocation_index_1
|
||||
%21 = OpFunctionCall %void %main_inner %22
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,11 @@
|
||||
struct S {
|
||||
a : i32;
|
||||
b : f32;
|
||||
}
|
||||
|
||||
var<workgroup> v : S;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
_ = v;
|
||||
}
|
||||
6
test/tint/var/initialization/workgroup/vector.wgsl
Normal file
6
test/tint/var/initialization/workgroup/vector.wgsl
Normal file
@@ -0,0 +1,6 @@
|
||||
var<workgroup> v : vec3<i32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
_ = v;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#version 310 es
|
||||
|
||||
shared ivec3 v;
|
||||
void tint_symbol(uint local_invocation_index) {
|
||||
{
|
||||
v = ivec3(0, 0, 0);
|
||||
}
|
||||
barrier();
|
||||
}
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void main() {
|
||||
tint_symbol(gl_LocalInvocationIndex);
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
groupshared int3 v;
|
||||
|
||||
struct tint_symbol_1 {
|
||||
uint local_invocation_index : SV_GroupIndex;
|
||||
};
|
||||
|
||||
void main_inner(uint local_invocation_index) {
|
||||
{
|
||||
v = int3(0, 0, 0);
|
||||
}
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main(tint_symbol_1 tint_symbol) {
|
||||
main_inner(tint_symbol.local_invocation_index);
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
void tint_symbol_inner(uint local_invocation_index, threadgroup int3* const tint_symbol_1) {
|
||||
{
|
||||
*(tint_symbol_1) = int3();
|
||||
}
|
||||
threadgroup_barrier(mem_flags::mem_threadgroup);
|
||||
}
|
||||
|
||||
kernel void tint_symbol(uint local_invocation_index [[thread_index_in_threadgroup]]) {
|
||||
threadgroup int3 tint_symbol_2;
|
||||
tint_symbol_inner(local_invocation_index, &(tint_symbol_2));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 22
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main" %local_invocation_index_1
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %local_invocation_index_1 "local_invocation_index_1"
|
||||
OpName %v "v"
|
||||
OpName %main_inner "main_inner"
|
||||
OpName %local_invocation_index "local_invocation_index"
|
||||
OpName %main "main"
|
||||
OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
|
||||
%uint = OpTypeInt 32 0
|
||||
%_ptr_Input_uint = OpTypePointer Input %uint
|
||||
%local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
|
||||
%int = OpTypeInt 32 1
|
||||
%v3int = OpTypeVector %int 3
|
||||
%_ptr_Workgroup_v3int = OpTypePointer Workgroup %v3int
|
||||
%v = OpVariable %_ptr_Workgroup_v3int Workgroup
|
||||
%void = OpTypeVoid
|
||||
%8 = OpTypeFunction %void %uint
|
||||
%13 = OpConstantNull %v3int
|
||||
%uint_2 = OpConstant %uint 2
|
||||
%uint_264 = OpConstant %uint 264
|
||||
%17 = OpTypeFunction %void
|
||||
%main_inner = OpFunction %void None %8
|
||||
%local_invocation_index = OpFunctionParameter %uint
|
||||
%12 = OpLabel
|
||||
OpStore %v %13
|
||||
OpControlBarrier %uint_2 %uint_2 %uint_264
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %17
|
||||
%19 = OpLabel
|
||||
%21 = OpLoad %uint %local_invocation_index_1
|
||||
%20 = OpFunctionCall %void %main_inner %21
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,6 @@
|
||||
var<workgroup> v : vec3<i32>;
|
||||
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main() {
|
||||
_ = v;
|
||||
}
|
||||
Reference in New Issue
Block a user