test/tint: Add end-to-end tests for inferred arrays

Bug: tint:1628
Change-Id: Ic3019f5d1db4c7b28c80292075ec68d79f286697
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97664
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
This commit is contained in:
Ben Clayton 2022-08-02 16:08:45 +00:00 committed by Dawn LUCI CQ
parent fa1a5478d3
commit 27f0ea69ea
168 changed files with 2502 additions and 0 deletions

View File

@ -0,0 +1,5 @@
var<private> arr = array<f32, 2>(1, 2);
fn f() {
var v = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static float arr[2] = {1.0f, 2.0f};
void f() {
float v[2] = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static float arr[2] = {1.0f, 2.0f};
void f() {
float v[2] = arr;
}

View File

@ -0,0 +1,11 @@
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
float arr[2] = float[2](1.0f, 2.0f);
void f() {
float v[2] = arr;
}

View File

@ -0,0 +1,21 @@
#include <metal_stdlib>
using namespace metal;
template<typename T, size_t N>
struct tint_array {
const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
void f() {
thread tint_array<float, 2> tint_symbol = tint_array<float, 2>{1.0f, 2.0f};
tint_array<float, 2> v = tint_symbol;
}

View File

@ -0,0 +1,38 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 20
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %arr "arr"
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
OpDecorate %_arr_float_uint_2 ArrayStride 4
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%uint_2 = OpConstant %uint 2
%_arr_float_uint_2 = OpTypeArray %float %uint_2
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%7 = OpConstantComposite %_arr_float_uint_2 %float_1 %float_2
%_ptr_Private__arr_float_uint_2 = OpTypePointer Private %_arr_float_uint_2
%arr = OpVariable %_ptr_Private__arr_float_uint_2 Private %7
%void = OpTypeVoid
%10 = OpTypeFunction %void
%_ptr_Function__arr_float_uint_2 = OpTypePointer Function %_arr_float_uint_2
%19 = OpConstantNull %_arr_float_uint_2
%unused_entry_point = OpFunction %void None %10
%13 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %10
%15 = OpLabel
%v = OpVariable %_ptr_Function__arr_float_uint_2 Function %19
%16 = OpLoad %_arr_float_uint_2 %arr
OpStore %v %16
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,5 @@
var<private> arr = array<f32, 2>(1, 2);
fn f() {
var v = arr;
}

View File

@ -0,0 +1,6 @@
var<private> arr = array<array<f32, 2>, 2>(array<f32, 2>(1, 2),
array<f32, 2>(3, 4));
fn f() {
var v = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static float arr[2][2] = {{1.0f, 2.0f}, {3.0f, 4.0f}};
void f() {
float v[2][2] = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static float arr[2][2] = {{1.0f, 2.0f}, {3.0f, 4.0f}};
void f() {
float v[2][2] = arr;
}

View File

@ -0,0 +1,11 @@
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
float arr[2][2] = float[2][2](float[2](1.0f, 2.0f), float[2](3.0f, 4.0f));
void f() {
float v[2][2] = arr;
}

View File

@ -0,0 +1,21 @@
#include <metal_stdlib>
using namespace metal;
template<typename T, size_t N>
struct tint_array {
const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
void f() {
thread tint_array<tint_array<float, 2>, 2> tint_symbol = tint_array<tint_array<float, 2>, 2>{tint_array<float, 2>{1.0f, 2.0f}, tint_array<float, 2>{3.0f, 4.0f}};
tint_array<tint_array<float, 2>, 2> v = tint_symbol;
}

View File

@ -0,0 +1,44 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 25
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %arr "arr"
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
OpDecorate %_arr_float_uint_2 ArrayStride 4
OpDecorate %_arr__arr_float_uint_2_uint_2 ArrayStride 8
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%uint_2 = OpConstant %uint 2
%_arr_float_uint_2 = OpTypeArray %float %uint_2
%_arr__arr_float_uint_2_uint_2 = OpTypeArray %_arr_float_uint_2 %uint_2
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%8 = OpConstantComposite %_arr_float_uint_2 %float_1 %float_2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%11 = OpConstantComposite %_arr_float_uint_2 %float_3 %float_4
%12 = OpConstantComposite %_arr__arr_float_uint_2_uint_2 %8 %11
%_ptr_Private__arr__arr_float_uint_2_uint_2 = OpTypePointer Private %_arr__arr_float_uint_2_uint_2
%arr = OpVariable %_ptr_Private__arr__arr_float_uint_2_uint_2 Private %12
%void = OpTypeVoid
%15 = OpTypeFunction %void
%_ptr_Function__arr__arr_float_uint_2_uint_2 = OpTypePointer Function %_arr__arr_float_uint_2_uint_2
%24 = OpConstantNull %_arr__arr_float_uint_2_uint_2
%unused_entry_point = OpFunction %void None %15
%18 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %15
%20 = OpLabel
%v = OpVariable %_ptr_Function__arr__arr_float_uint_2_uint_2 Function %24
%21 = OpLoad %_arr__arr_float_uint_2_uint_2 %arr
OpStore %v %21
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,5 @@
var<private> arr = array<array<f32, 2>, 2>(array<f32, 2>(1, 2), array<f32, 2>(3, 4));
fn f() {
var v = arr;
}

View File

@ -0,0 +1,6 @@
var<private> arr = array<array<f32, 2>, 2>(array<f32, 2>(1f, 2f),
array<f32, 2>(3f, 4f));
fn f() {
var v = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static float arr[2][2] = {{1.0f, 2.0f}, {3.0f, 4.0f}};
void f() {
float v[2][2] = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static float arr[2][2] = {{1.0f, 2.0f}, {3.0f, 4.0f}};
void f() {
float v[2][2] = arr;
}

View File

@ -0,0 +1,11 @@
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
float arr[2][2] = float[2][2](float[2](1.0f, 2.0f), float[2](3.0f, 4.0f));
void f() {
float v[2][2] = arr;
}

View File

@ -0,0 +1,21 @@
#include <metal_stdlib>
using namespace metal;
template<typename T, size_t N>
struct tint_array {
const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
void f() {
thread tint_array<tint_array<float, 2>, 2> tint_symbol = tint_array<tint_array<float, 2>, 2>{tint_array<float, 2>{1.0f, 2.0f}, tint_array<float, 2>{3.0f, 4.0f}};
tint_array<tint_array<float, 2>, 2> v = tint_symbol;
}

View File

@ -0,0 +1,44 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 25
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %arr "arr"
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
OpDecorate %_arr_float_uint_2 ArrayStride 4
OpDecorate %_arr__arr_float_uint_2_uint_2 ArrayStride 8
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%uint_2 = OpConstant %uint 2
%_arr_float_uint_2 = OpTypeArray %float %uint_2
%_arr__arr_float_uint_2_uint_2 = OpTypeArray %_arr_float_uint_2 %uint_2
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%8 = OpConstantComposite %_arr_float_uint_2 %float_1 %float_2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%11 = OpConstantComposite %_arr_float_uint_2 %float_3 %float_4
%12 = OpConstantComposite %_arr__arr_float_uint_2_uint_2 %8 %11
%_ptr_Private__arr__arr_float_uint_2_uint_2 = OpTypePointer Private %_arr__arr_float_uint_2_uint_2
%arr = OpVariable %_ptr_Private__arr__arr_float_uint_2_uint_2 Private %12
%void = OpTypeVoid
%15 = OpTypeFunction %void
%_ptr_Function__arr__arr_float_uint_2_uint_2 = OpTypePointer Function %_arr__arr_float_uint_2_uint_2
%24 = OpConstantNull %_arr__arr_float_uint_2_uint_2
%unused_entry_point = OpFunction %void None %15
%18 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %15
%20 = OpLabel
%v = OpVariable %_ptr_Function__arr__arr_float_uint_2_uint_2 Function %24
%21 = OpLoad %_arr__arr_float_uint_2_uint_2 %arr
OpStore %v %21
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,5 @@
var<private> arr = array<array<f32, 2>, 2>(array<f32, 2>(1.0f, 2.0f), array<f32, 2>(3.0f, 4.0f));
fn f() {
var v = arr;
}

View File

@ -0,0 +1,5 @@
var<private> arr = array<f32, 2>(1f, 2f);
fn f() {
var v = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static float arr[2] = {1.0f, 2.0f};
void f() {
float v[2] = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static float arr[2] = {1.0f, 2.0f};
void f() {
float v[2] = arr;
}

View File

@ -0,0 +1,11 @@
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
float arr[2] = float[2](1.0f, 2.0f);
void f() {
float v[2] = arr;
}

View File

@ -0,0 +1,21 @@
#include <metal_stdlib>
using namespace metal;
template<typename T, size_t N>
struct tint_array {
const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
void f() {
thread tint_array<float, 2> tint_symbol = tint_array<float, 2>{1.0f, 2.0f};
tint_array<float, 2> v = tint_symbol;
}

View File

@ -0,0 +1,38 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 20
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %arr "arr"
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
OpDecorate %_arr_float_uint_2 ArrayStride 4
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%uint_2 = OpConstant %uint 2
%_arr_float_uint_2 = OpTypeArray %float %uint_2
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%7 = OpConstantComposite %_arr_float_uint_2 %float_1 %float_2
%_ptr_Private__arr_float_uint_2 = OpTypePointer Private %_arr_float_uint_2
%arr = OpVariable %_ptr_Private__arr_float_uint_2 Private %7
%void = OpTypeVoid
%10 = OpTypeFunction %void
%_ptr_Function__arr_float_uint_2 = OpTypePointer Function %_arr_float_uint_2
%19 = OpConstantNull %_arr_float_uint_2
%unused_entry_point = OpFunction %void None %10
%13 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %10
%15 = OpLabel
%v = OpVariable %_ptr_Function__arr_float_uint_2 Function %19
%16 = OpLoad %_arr_float_uint_2 %arr
OpStore %v %16
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,5 @@
var<private> arr = array<f32, 2>(1.0f, 2.0f);
fn f() {
var v = arr;
}

View File

@ -0,0 +1,5 @@
var<private> arr = array<i32, 2>(1i, 2i);
fn f() {
var v = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static int arr[2] = {1, 2};
void f() {
int v[2] = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static int arr[2] = {1, 2};
void f() {
int v[2] = arr;
}

View File

@ -0,0 +1,11 @@
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
int arr[2] = int[2](1, 2);
void f() {
int v[2] = arr;
}

View File

@ -0,0 +1,21 @@
#include <metal_stdlib>
using namespace metal;
template<typename T, size_t N>
struct tint_array {
const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
void f() {
thread tint_array<int, 2> tint_symbol = tint_array<int, 2>{1, 2};
tint_array<int, 2> v = tint_symbol;
}

View File

@ -0,0 +1,38 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 20
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %arr "arr"
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
OpDecorate %_arr_int_uint_2 ArrayStride 4
%int = OpTypeInt 32 1
%uint = OpTypeInt 32 0
%uint_2 = OpConstant %uint 2
%_arr_int_uint_2 = OpTypeArray %int %uint_2
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%7 = OpConstantComposite %_arr_int_uint_2 %int_1 %int_2
%_ptr_Private__arr_int_uint_2 = OpTypePointer Private %_arr_int_uint_2
%arr = OpVariable %_ptr_Private__arr_int_uint_2 Private %7
%void = OpTypeVoid
%10 = OpTypeFunction %void
%_ptr_Function__arr_int_uint_2 = OpTypePointer Function %_arr_int_uint_2
%19 = OpConstantNull %_arr_int_uint_2
%unused_entry_point = OpFunction %void None %10
%13 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %10
%15 = OpLabel
%v = OpVariable %_ptr_Function__arr_int_uint_2 Function %19
%16 = OpLoad %_arr_int_uint_2 %arr
OpStore %v %16
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,5 @@
var<private> arr = array<i32, 2>(1i, 2i);
fn f() {
var v = arr;
}

View File

@ -0,0 +1,6 @@
var<private> arr = array<mat2x2<f32>, 2>(mat2x2<f32>(1, 2, 3, 4),
mat2x2<f32>(5, 6, 7, 8));
fn f() {
var v = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static float2x2 arr[2] = {float2x2(float2(1.0f, 2.0f), float2(3.0f, 4.0f)), float2x2(float2(5.0f, 6.0f), float2(7.0f, 8.0f))};
void f() {
float2x2 v[2] = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static float2x2 arr[2] = {float2x2(float2(1.0f, 2.0f), float2(3.0f, 4.0f)), float2x2(float2(5.0f, 6.0f), float2(7.0f, 8.0f))};
void f() {
float2x2 v[2] = arr;
}

View File

@ -0,0 +1,11 @@
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
mat2 arr[2] = mat2[2](mat2(vec2(1.0f, 2.0f), vec2(3.0f, 4.0f)), mat2(vec2(5.0f, 6.0f), vec2(7.0f, 8.0f)));
void f() {
mat2 v[2] = arr;
}

View File

@ -0,0 +1,21 @@
#include <metal_stdlib>
using namespace metal;
template<typename T, size_t N>
struct tint_array {
const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
void f() {
thread tint_array<float2x2, 2> tint_symbol = tint_array<float2x2, 2>{float2x2(float2(1.0f, 2.0f), float2(3.0f, 4.0f)), float2x2(float2(5.0f, 6.0f), float2(7.0f, 8.0f))};
tint_array<float2x2, 2> v = tint_symbol;
}

View File

@ -0,0 +1,52 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %arr "arr"
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
OpDecorate %_arr_mat2v2float_uint_2 ArrayStride 16
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%mat2v2float = OpTypeMatrix %v2float 2
%uint = OpTypeInt 32 0
%uint_2 = OpConstant %uint 2
%_arr_mat2v2float_uint_2 = OpTypeArray %mat2v2float %uint_2
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%9 = OpConstantComposite %v2float %float_1 %float_2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%12 = OpConstantComposite %v2float %float_3 %float_4
%13 = OpConstantComposite %mat2v2float %9 %12
%float_5 = OpConstant %float 5
%float_6 = OpConstant %float 6
%16 = OpConstantComposite %v2float %float_5 %float_6
%float_7 = OpConstant %float 7
%float_8 = OpConstant %float 8
%19 = OpConstantComposite %v2float %float_7 %float_8
%20 = OpConstantComposite %mat2v2float %16 %19
%21 = OpConstantComposite %_arr_mat2v2float_uint_2 %13 %20
%_ptr_Private__arr_mat2v2float_uint_2 = OpTypePointer Private %_arr_mat2v2float_uint_2
%arr = OpVariable %_ptr_Private__arr_mat2v2float_uint_2 Private %21
%void = OpTypeVoid
%24 = OpTypeFunction %void
%_ptr_Function__arr_mat2v2float_uint_2 = OpTypePointer Function %_arr_mat2v2float_uint_2
%33 = OpConstantNull %_arr_mat2v2float_uint_2
%unused_entry_point = OpFunction %void None %24
%27 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %24
%29 = OpLabel
%v = OpVariable %_ptr_Function__arr_mat2v2float_uint_2 Function %33
%30 = OpLoad %_arr_mat2v2float_uint_2 %arr
OpStore %v %30
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,5 @@
var<private> arr = array<mat2x2<f32>, 2>(mat2x2<f32>(1, 2, 3, 4), mat2x2<f32>(5, 6, 7, 8));
fn f() {
var v = arr;
}

View File

@ -0,0 +1,6 @@
var<private> arr = array<mat2x2<f32>, 2>(mat2x2<f32>(1f, 2f, 3f, 4f),
mat2x2<f32>(5f, 6f, 7f, 8f));
fn f() {
var v = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static float2x2 arr[2] = {float2x2(float2(1.0f, 2.0f), float2(3.0f, 4.0f)), float2x2(float2(5.0f, 6.0f), float2(7.0f, 8.0f))};
void f() {
float2x2 v[2] = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static float2x2 arr[2] = {float2x2(float2(1.0f, 2.0f), float2(3.0f, 4.0f)), float2x2(float2(5.0f, 6.0f), float2(7.0f, 8.0f))};
void f() {
float2x2 v[2] = arr;
}

View File

@ -0,0 +1,11 @@
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
mat2 arr[2] = mat2[2](mat2(vec2(1.0f, 2.0f), vec2(3.0f, 4.0f)), mat2(vec2(5.0f, 6.0f), vec2(7.0f, 8.0f)));
void f() {
mat2 v[2] = arr;
}

View File

@ -0,0 +1,21 @@
#include <metal_stdlib>
using namespace metal;
template<typename T, size_t N>
struct tint_array {
const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
void f() {
thread tint_array<float2x2, 2> tint_symbol = tint_array<float2x2, 2>{float2x2(float2(1.0f, 2.0f), float2(3.0f, 4.0f)), float2x2(float2(5.0f, 6.0f), float2(7.0f, 8.0f))};
tint_array<float2x2, 2> v = tint_symbol;
}

View File

@ -0,0 +1,52 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %arr "arr"
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
OpDecorate %_arr_mat2v2float_uint_2 ArrayStride 16
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%mat2v2float = OpTypeMatrix %v2float 2
%uint = OpTypeInt 32 0
%uint_2 = OpConstant %uint 2
%_arr_mat2v2float_uint_2 = OpTypeArray %mat2v2float %uint_2
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%9 = OpConstantComposite %v2float %float_1 %float_2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%12 = OpConstantComposite %v2float %float_3 %float_4
%13 = OpConstantComposite %mat2v2float %9 %12
%float_5 = OpConstant %float 5
%float_6 = OpConstant %float 6
%16 = OpConstantComposite %v2float %float_5 %float_6
%float_7 = OpConstant %float 7
%float_8 = OpConstant %float 8
%19 = OpConstantComposite %v2float %float_7 %float_8
%20 = OpConstantComposite %mat2v2float %16 %19
%21 = OpConstantComposite %_arr_mat2v2float_uint_2 %13 %20
%_ptr_Private__arr_mat2v2float_uint_2 = OpTypePointer Private %_arr_mat2v2float_uint_2
%arr = OpVariable %_ptr_Private__arr_mat2v2float_uint_2 Private %21
%void = OpTypeVoid
%24 = OpTypeFunction %void
%_ptr_Function__arr_mat2v2float_uint_2 = OpTypePointer Function %_arr_mat2v2float_uint_2
%33 = OpConstantNull %_arr_mat2v2float_uint_2
%unused_entry_point = OpFunction %void None %24
%27 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %24
%29 = OpLabel
%v = OpVariable %_ptr_Function__arr_mat2v2float_uint_2 Function %33
%30 = OpLoad %_arr_mat2v2float_uint_2 %arr
OpStore %v %30
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,5 @@
var<private> arr = array<mat2x2<f32>, 2>(mat2x2<f32>(1.0f, 2.0f, 3.0f, 4.0f), mat2x2<f32>(5.0f, 6.0f, 7.0f, 8.0f));
fn f() {
var v = arr;
}

View File

@ -0,0 +1,5 @@
var<private> arr = array<u32, 2>(1u, 2u);
fn f() {
var v = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static uint arr[2] = {1u, 2u};
void f() {
uint v[2] = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static uint arr[2] = {1u, 2u};
void f() {
uint v[2] = arr;
}

View File

@ -0,0 +1,11 @@
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
uint arr[2] = uint[2](1u, 2u);
void f() {
uint v[2] = arr;
}

View File

@ -0,0 +1,21 @@
#include <metal_stdlib>
using namespace metal;
template<typename T, size_t N>
struct tint_array {
const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
void f() {
thread tint_array<uint, 2> tint_symbol = tint_array<uint, 2>{1u, 2u};
tint_array<uint, 2> v = tint_symbol;
}

View File

@ -0,0 +1,36 @@
; 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 %arr "arr"
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
OpDecorate %_arr_uint_uint_2 ArrayStride 4
%uint = OpTypeInt 32 0
%uint_2 = OpConstant %uint 2
%_arr_uint_uint_2 = OpTypeArray %uint %uint_2
%uint_1 = OpConstant %uint 1
%5 = OpConstantComposite %_arr_uint_uint_2 %uint_1 %uint_2
%_ptr_Private__arr_uint_uint_2 = OpTypePointer Private %_arr_uint_uint_2
%arr = OpVariable %_ptr_Private__arr_uint_uint_2 Private %5
%void = OpTypeVoid
%8 = OpTypeFunction %void
%_ptr_Function__arr_uint_uint_2 = OpTypePointer Function %_arr_uint_uint_2
%17 = OpConstantNull %_arr_uint_uint_2
%unused_entry_point = OpFunction %void None %8
%11 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %8
%13 = OpLabel
%v = OpVariable %_ptr_Function__arr_uint_uint_2 Function %17
%14 = OpLoad %_arr_uint_uint_2 %arr
OpStore %v %14
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,5 @@
var<private> arr = array<u32, 2>(1u, 2u);
fn f() {
var v = arr;
}

View File

@ -0,0 +1,5 @@
var<private> arr = array<vec2<f32>, 2>(vec2(1), vec2(2));
fn f() {
var v = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static float2 arr[2] = {(1.0f).xx, (2.0f).xx};
void f() {
float2 v[2] = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static float2 arr[2] = {(1.0f).xx, (2.0f).xx};
void f() {
float2 v[2] = arr;
}

View File

@ -0,0 +1,11 @@
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
vec2 arr[2] = vec2[2](vec2(1.0f), vec2(2.0f));
void f() {
vec2 v[2] = arr;
}

View File

@ -0,0 +1,21 @@
#include <metal_stdlib>
using namespace metal;
template<typename T, size_t N>
struct tint_array {
const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
void f() {
thread tint_array<float2, 2> tint_symbol = tint_array<float2, 2>{float2(1.0f), float2(2.0f)};
tint_array<float2, 2> v = tint_symbol;
}

View File

@ -0,0 +1,41 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 23
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %arr "arr"
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
OpDecorate %_arr_v2float_uint_2 ArrayStride 8
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%uint = OpTypeInt 32 0
%uint_2 = OpConstant %uint 2
%_arr_v2float_uint_2 = OpTypeArray %v2float %uint_2
%float_1 = OpConstant %float 1
%7 = OpConstantComposite %v2float %float_1 %float_1
%float_2 = OpConstant %float 2
%9 = OpConstantComposite %v2float %float_2 %float_2
%10 = OpConstantComposite %_arr_v2float_uint_2 %7 %9
%_ptr_Private__arr_v2float_uint_2 = OpTypePointer Private %_arr_v2float_uint_2
%arr = OpVariable %_ptr_Private__arr_v2float_uint_2 Private %10
%void = OpTypeVoid
%13 = OpTypeFunction %void
%_ptr_Function__arr_v2float_uint_2 = OpTypePointer Function %_arr_v2float_uint_2
%22 = OpConstantNull %_arr_v2float_uint_2
%unused_entry_point = OpFunction %void None %13
%16 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %13
%18 = OpLabel
%v = OpVariable %_ptr_Function__arr_v2float_uint_2 Function %22
%19 = OpLoad %_arr_v2float_uint_2 %arr
OpStore %v %19
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,5 @@
var<private> arr = array<vec2<f32>, 2>(vec2(1), vec2(2));
fn f() {
var v = arr;
}

View File

@ -0,0 +1,5 @@
var<private> arr = array<vec2<f32>, 2>(vec2<f32>(1f), vec2<f32>(2f));
fn f() {
var v = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static float2 arr[2] = {(1.0f).xx, (2.0f).xx};
void f() {
float2 v[2] = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static float2 arr[2] = {(1.0f).xx, (2.0f).xx};
void f() {
float2 v[2] = arr;
}

View File

@ -0,0 +1,11 @@
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
vec2 arr[2] = vec2[2](vec2(1.0f), vec2(2.0f));
void f() {
vec2 v[2] = arr;
}

View File

@ -0,0 +1,21 @@
#include <metal_stdlib>
using namespace metal;
template<typename T, size_t N>
struct tint_array {
const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
void f() {
thread tint_array<float2, 2> tint_symbol = tint_array<float2, 2>{float2(1.0f), float2(2.0f)};
tint_array<float2, 2> v = tint_symbol;
}

View File

@ -0,0 +1,41 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 23
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %arr "arr"
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
OpDecorate %_arr_v2float_uint_2 ArrayStride 8
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%uint = OpTypeInt 32 0
%uint_2 = OpConstant %uint 2
%_arr_v2float_uint_2 = OpTypeArray %v2float %uint_2
%float_1 = OpConstant %float 1
%7 = OpConstantComposite %v2float %float_1 %float_1
%float_2 = OpConstant %float 2
%9 = OpConstantComposite %v2float %float_2 %float_2
%10 = OpConstantComposite %_arr_v2float_uint_2 %7 %9
%_ptr_Private__arr_v2float_uint_2 = OpTypePointer Private %_arr_v2float_uint_2
%arr = OpVariable %_ptr_Private__arr_v2float_uint_2 Private %10
%void = OpTypeVoid
%13 = OpTypeFunction %void
%_ptr_Function__arr_v2float_uint_2 = OpTypePointer Function %_arr_v2float_uint_2
%22 = OpConstantNull %_arr_v2float_uint_2
%unused_entry_point = OpFunction %void None %13
%16 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %13
%18 = OpLabel
%v = OpVariable %_ptr_Function__arr_v2float_uint_2 Function %22
%19 = OpLoad %_arr_v2float_uint_2 %arr
OpStore %v %19
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,5 @@
var<private> arr = array<vec2<f32>, 2>(vec2<f32>(1.0f), vec2<f32>(2.0f));
fn f() {
var v = arr;
}

View File

@ -0,0 +1,5 @@
var<private> arr = array<vec2<i32>, 2>(vec2<i32>(1i), vec2<i32>(2i));
fn f() {
var v = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static int2 arr[2] = {(1).xx, (2).xx};
void f() {
int2 v[2] = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static int2 arr[2] = {(1).xx, (2).xx};
void f() {
int2 v[2] = arr;
}

View File

@ -0,0 +1,11 @@
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
ivec2 arr[2] = ivec2[2](ivec2(1), ivec2(2));
void f() {
ivec2 v[2] = arr;
}

View File

@ -0,0 +1,21 @@
#include <metal_stdlib>
using namespace metal;
template<typename T, size_t N>
struct tint_array {
const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
void f() {
thread tint_array<int2, 2> tint_symbol = tint_array<int2, 2>{int2(1), int2(2)};
tint_array<int2, 2> v = tint_symbol;
}

View File

@ -0,0 +1,41 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 23
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %arr "arr"
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
OpDecorate %_arr_v2int_uint_2 ArrayStride 8
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%uint = OpTypeInt 32 0
%uint_2 = OpConstant %uint 2
%_arr_v2int_uint_2 = OpTypeArray %v2int %uint_2
%int_1 = OpConstant %int 1
%7 = OpConstantComposite %v2int %int_1 %int_1
%int_2 = OpConstant %int 2
%9 = OpConstantComposite %v2int %int_2 %int_2
%10 = OpConstantComposite %_arr_v2int_uint_2 %7 %9
%_ptr_Private__arr_v2int_uint_2 = OpTypePointer Private %_arr_v2int_uint_2
%arr = OpVariable %_ptr_Private__arr_v2int_uint_2 Private %10
%void = OpTypeVoid
%13 = OpTypeFunction %void
%_ptr_Function__arr_v2int_uint_2 = OpTypePointer Function %_arr_v2int_uint_2
%22 = OpConstantNull %_arr_v2int_uint_2
%unused_entry_point = OpFunction %void None %13
%16 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %13
%18 = OpLabel
%v = OpVariable %_ptr_Function__arr_v2int_uint_2 Function %22
%19 = OpLoad %_arr_v2int_uint_2 %arr
OpStore %v %19
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,5 @@
var<private> arr = array<vec2<i32>, 2>(vec2<i32>(1i), vec2<i32>(2i));
fn f() {
var v = arr;
}

View File

@ -0,0 +1,5 @@
var<private> arr = array<vec2<u32>, 2>(vec2<u32>(1u), vec2<u32>(2u));
fn f() {
var v = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static uint2 arr[2] = {(1u).xx, (2u).xx};
void f() {
uint2 v[2] = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static uint2 arr[2] = {(1u).xx, (2u).xx};
void f() {
uint2 v[2] = arr;
}

View File

@ -0,0 +1,11 @@
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
uvec2 arr[2] = uvec2[2](uvec2(1u), uvec2(2u));
void f() {
uvec2 v[2] = arr;
}

View File

@ -0,0 +1,21 @@
#include <metal_stdlib>
using namespace metal;
template<typename T, size_t N>
struct tint_array {
const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
void f() {
thread tint_array<uint2, 2> tint_symbol = tint_array<uint2, 2>{uint2(1u), uint2(2u)};
tint_array<uint2, 2> v = tint_symbol;
}

View File

@ -0,0 +1,39 @@
; 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 %arr "arr"
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
OpDecorate %_arr_v2uint_uint_2 ArrayStride 8
%uint = OpTypeInt 32 0
%v2uint = OpTypeVector %uint 2
%uint_2 = OpConstant %uint 2
%_arr_v2uint_uint_2 = OpTypeArray %v2uint %uint_2
%uint_1 = OpConstant %uint 1
%6 = OpConstantComposite %v2uint %uint_1 %uint_1
%7 = OpConstantComposite %v2uint %uint_2 %uint_2
%8 = OpConstantComposite %_arr_v2uint_uint_2 %6 %7
%_ptr_Private__arr_v2uint_uint_2 = OpTypePointer Private %_arr_v2uint_uint_2
%arr = OpVariable %_ptr_Private__arr_v2uint_uint_2 Private %8
%void = OpTypeVoid
%11 = OpTypeFunction %void
%_ptr_Function__arr_v2uint_uint_2 = OpTypePointer Function %_arr_v2uint_uint_2
%20 = OpConstantNull %_arr_v2uint_uint_2
%unused_entry_point = OpFunction %void None %11
%14 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %11
%16 = OpLabel
%v = OpVariable %_ptr_Function__arr_v2uint_uint_2 Function %20
%17 = OpLoad %_arr_v2uint_uint_2 %arr
OpStore %v %17
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,5 @@
var<private> arr = array<vec2<u32>, 2>(vec2<u32>(1u), vec2<u32>(2u));
fn f() {
var v = arr;
}

View File

@ -0,0 +1,5 @@
var<private> arr = array(1, 2);
fn f() {
var v = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static int arr[2] = {1, 2};
void f() {
int v[2] = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static int arr[2] = {1, 2};
void f() {
int v[2] = arr;
}

View File

@ -0,0 +1,11 @@
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
int arr[2] = int[2](1, 2);
void f() {
int v[2] = arr;
}

View File

@ -0,0 +1,21 @@
#include <metal_stdlib>
using namespace metal;
template<typename T, size_t N>
struct tint_array {
const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
void f() {
thread tint_array<int, 2> tint_symbol = tint_array<int, 2>{1, 2};
tint_array<int, 2> v = tint_symbol;
}

View File

@ -0,0 +1,38 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 20
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %arr "arr"
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
OpDecorate %_arr_int_uint_2 ArrayStride 4
%int = OpTypeInt 32 1
%uint = OpTypeInt 32 0
%uint_2 = OpConstant %uint 2
%_arr_int_uint_2 = OpTypeArray %int %uint_2
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%7 = OpConstantComposite %_arr_int_uint_2 %int_1 %int_2
%_ptr_Private__arr_int_uint_2 = OpTypePointer Private %_arr_int_uint_2
%arr = OpVariable %_ptr_Private__arr_int_uint_2 Private %7
%void = OpTypeVoid
%10 = OpTypeFunction %void
%_ptr_Function__arr_int_uint_2 = OpTypePointer Function %_arr_int_uint_2
%19 = OpConstantNull %_arr_int_uint_2
%unused_entry_point = OpFunction %void None %10
%13 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %10
%15 = OpLabel
%v = OpVariable %_ptr_Function__arr_int_uint_2 Function %19
%16 = OpLoad %_arr_int_uint_2 %arr
OpStore %v %16
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,5 @@
var<private> arr = array(1, 2);
fn f() {
var v = arr;
}

View File

@ -0,0 +1,5 @@
var<private> arr = array(array(1, 2), array(3, 4));
fn f() {
var v = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static int arr[2][2] = {{1, 2}, {3, 4}};
void f() {
int v[2][2] = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static int arr[2][2] = {{1, 2}, {3, 4}};
void f() {
int v[2][2] = arr;
}

View File

@ -0,0 +1,11 @@
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
int arr[2][2] = int[2][2](int[2](1, 2), int[2](3, 4));
void f() {
int v[2][2] = arr;
}

View File

@ -0,0 +1,21 @@
#include <metal_stdlib>
using namespace metal;
template<typename T, size_t N>
struct tint_array {
const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
void f() {
thread tint_array<tint_array<int, 2>, 2> tint_symbol = tint_array<tint_array<int, 2>, 2>{tint_array<int, 2>{1, 2}, tint_array<int, 2>{3, 4}};
tint_array<tint_array<int, 2>, 2> v = tint_symbol;
}

View File

@ -0,0 +1,44 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 25
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %arr "arr"
OpName %unused_entry_point "unused_entry_point"
OpName %f "f"
OpName %v "v"
OpDecorate %_arr_int_uint_2 ArrayStride 4
OpDecorate %_arr__arr_int_uint_2_uint_2 ArrayStride 8
%int = OpTypeInt 32 1
%uint = OpTypeInt 32 0
%uint_2 = OpConstant %uint 2
%_arr_int_uint_2 = OpTypeArray %int %uint_2
%_arr__arr_int_uint_2_uint_2 = OpTypeArray %_arr_int_uint_2 %uint_2
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%8 = OpConstantComposite %_arr_int_uint_2 %int_1 %int_2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%11 = OpConstantComposite %_arr_int_uint_2 %int_3 %int_4
%12 = OpConstantComposite %_arr__arr_int_uint_2_uint_2 %8 %11
%_ptr_Private__arr__arr_int_uint_2_uint_2 = OpTypePointer Private %_arr__arr_int_uint_2_uint_2
%arr = OpVariable %_ptr_Private__arr__arr_int_uint_2_uint_2 Private %12
%void = OpTypeVoid
%15 = OpTypeFunction %void
%_ptr_Function__arr__arr_int_uint_2_uint_2 = OpTypePointer Function %_arr__arr_int_uint_2_uint_2
%24 = OpConstantNull %_arr__arr_int_uint_2_uint_2
%unused_entry_point = OpFunction %void None %15
%18 = OpLabel
OpReturn
OpFunctionEnd
%f = OpFunction %void None %15
%20 = OpLabel
%v = OpVariable %_ptr_Function__arr__arr_int_uint_2_uint_2 Function %24
%21 = OpLoad %_arr__arr_int_uint_2_uint_2 %arr
OpStore %v %21
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,5 @@
var<private> arr = array(array(1, 2), array(3, 4));
fn f() {
var v = arr;
}

View File

@ -0,0 +1,5 @@
var<private> arr = array(array(1f, 2f), array(3f, 4f));
fn f() {
var v = arr;
}

View File

@ -0,0 +1,10 @@
[numthreads(1, 1, 1)]
void unused_entry_point() {
return;
}
static float arr[2][2] = {{1.0f, 2.0f}, {3.0f, 4.0f}};
void f() {
float v[2][2] = arr;
}

Some files were not shown because too many files have changed in this diff Show More