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:
Ryan Harrison
2022-02-21 15:19:07 +00:00
committed by Tint LUCI CQ
parent 38f1e9c75c
commit dbc13af287
12231 changed files with 4897 additions and 4871 deletions

View File

@@ -0,0 +1,22 @@
struct Uniforms {
i : u32;
};
struct InnerS {
v : i32;
};
struct OuterS {
a1 : array<InnerS, 8>;
};
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
var s1 : OuterS;
for (var i: i32 = 0; i < 4; i = i + 1) {
s1.a1[uniforms.i] = v;
}
}

View File

@@ -0,0 +1,33 @@
#version 310 es
struct Uniforms {
uint i;
};
struct InnerS {
int v;
};
struct OuterS {
InnerS a1[8];
};
layout(binding = 4) uniform Uniforms_1 {
uint i;
} uniforms;
void tint_symbol() {
InnerS v = InnerS(0);
OuterS s1 = OuterS(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0)));
{
for(int i = 0; (i < 4); i = (i + 1)) {
s1.a1[uniforms.i] = v;
}
}
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -0,0 +1,26 @@
struct InnerS {
int v;
};
struct OuterS {
InnerS a1[8];
};
cbuffer cbuffer_uniforms : register(b4, space1) {
uint4 uniforms[1];
};
[numthreads(1, 1, 1)]
void main() {
InnerS v = (InnerS)0;
OuterS s1 = (OuterS)0;
{
[loop] for(int i = 0; (i < 4); i = (i + 1)) {
{
InnerS tint_symbol_1[8] = s1.a1;
tint_symbol_1[uniforms[0].x] = v;
s1.a1 = tint_symbol_1;
}
}
}
return;
}

View File

@@ -0,0 +1,28 @@
#include <metal_stdlib>
using namespace metal;
struct Uniforms {
/* 0x0000 */ uint i;
};
struct InnerS {
int v;
};
struct tint_array_wrapper {
InnerS arr[8];
};
struct OuterS {
tint_array_wrapper a1;
};
kernel void tint_symbol(const constant Uniforms* tint_symbol_1 [[buffer(0)]]) {
InnerS v = {};
OuterS s1 = {};
for(int i = 0; (i < 4); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
s1.a1.arr[(*(tint_symbol_1)).i] = v;
}
return;
}

View File

@@ -0,0 +1,84 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 44
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpName %uniforms "uniforms"
OpName %main "main"
OpName %InnerS "InnerS"
OpMemberName %InnerS 0 "v"
OpName %v "v"
OpName %OuterS "OuterS"
OpMemberName %OuterS 0 "a1"
OpName %s1 "s1"
OpName %i "i"
OpDecorate %Uniforms Block
OpMemberDecorate %Uniforms 0 Offset 0
OpDecorate %uniforms NonWritable
OpDecorate %uniforms DescriptorSet 1
OpDecorate %uniforms Binding 4
OpMemberDecorate %InnerS 0 Offset 0
OpMemberDecorate %OuterS 0 Offset 0
OpDecorate %_arr_InnerS_uint_8 ArrayStride 4
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%void = OpTypeVoid
%5 = OpTypeFunction %void
%int = OpTypeInt 32 1
%InnerS = OpTypeStruct %int
%_ptr_Function_InnerS = OpTypePointer Function %InnerS
%13 = OpConstantNull %InnerS
%uint_8 = OpConstant %uint 8
%_arr_InnerS_uint_8 = OpTypeArray %InnerS %uint_8
%OuterS = OpTypeStruct %_arr_InnerS_uint_8
%_ptr_Function_OuterS = OpTypePointer Function %OuterS
%19 = OpConstantNull %OuterS
%int_0 = OpConstant %int 0
%_ptr_Function_int = OpTypePointer Function %int
%23 = OpConstantNull %int
%int_4 = OpConstant %int 4
%bool = OpTypeBool
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%int_1 = OpConstant %int 1
%main = OpFunction %void None %5
%8 = OpLabel
%v = OpVariable %_ptr_Function_InnerS Function %13
%s1 = OpVariable %_ptr_Function_OuterS Function %19
%i = OpVariable %_ptr_Function_int Function %23
OpStore %i %int_0
OpBranch %24
%24 = OpLabel
OpLoopMerge %25 %26 None
OpBranch %27
%27 = OpLabel
%29 = OpLoad %int %i
%31 = OpSLessThan %bool %29 %int_4
%28 = OpLogicalNot %bool %31
OpSelectionMerge %33 None
OpBranchConditional %28 %34 %33
%34 = OpLabel
OpBranch %25
%33 = OpLabel
%37 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%38 = OpLoad %uint %37
%39 = OpAccessChain %_ptr_Function_InnerS %s1 %uint_0 %38
%40 = OpLoad %InnerS %v
OpStore %39 %40
OpBranch %26
%26 = OpLabel
%41 = OpLoad %int %i
%43 = OpIAdd %int %41 %int_1
OpStore %i %43
OpBranch %24
%25 = OpLabel
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,22 @@
struct Uniforms {
i : u32;
}
struct InnerS {
v : i32;
}
struct OuterS {
a1 : array<InnerS, 8>;
}
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
var s1 : OuterS;
for(var i : i32 = 0; (i < 4); i = (i + 1)) {
s1.a1[uniforms.i] = v;
}
}

View File

@@ -0,0 +1,22 @@
struct Uniforms {
i : u32;
};
struct InnerS {
v : i32;
};
struct OuterS {
a1 : array<InnerS, 8>;
};
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
var s1 : OuterS;
for (var i: i32 = 0; i < 4; s1.a1[uniforms.i] = v) {
i = i + 1;
}
}

View File

@@ -0,0 +1,33 @@
#version 310 es
struct Uniforms {
uint i;
};
struct InnerS {
int v;
};
struct OuterS {
InnerS a1[8];
};
layout(binding = 4) uniform Uniforms_1 {
uint i;
} uniforms;
void tint_symbol() {
InnerS v = InnerS(0);
OuterS s1 = OuterS(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0)));
{
for(int i = 0; (i < 4); s1.a1[uniforms.i] = v) {
i = (i + 1);
}
}
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -0,0 +1,29 @@
struct InnerS {
int v;
};
struct OuterS {
InnerS a1[8];
};
cbuffer cbuffer_uniforms : register(b4, space1) {
uint4 uniforms[1];
};
[numthreads(1, 1, 1)]
void main() {
InnerS v = (InnerS)0;
OuterS s1 = (OuterS)0;
{
int i = 0;
[loop] while (true) {
if (!((i < 4))) { break; }
i = (i + 1);
{
InnerS tint_symbol_1[8] = s1.a1;
tint_symbol_1[uniforms[0].x] = v;
s1.a1 = tint_symbol_1;
}
}
}
return;
}

View File

@@ -0,0 +1,28 @@
#include <metal_stdlib>
using namespace metal;
struct Uniforms {
/* 0x0000 */ uint i;
};
struct InnerS {
int v;
};
struct tint_array_wrapper {
InnerS arr[8];
};
struct OuterS {
tint_array_wrapper a1;
};
kernel void tint_symbol(const constant Uniforms* tint_symbol_1 [[buffer(0)]]) {
InnerS v = {};
OuterS s1 = {};
for(int i = 0; (i < 4); s1.a1.arr[(*(tint_symbol_1)).i] = v) {
i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)));
}
return;
}

View File

@@ -0,0 +1,84 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 44
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpName %uniforms "uniforms"
OpName %main "main"
OpName %InnerS "InnerS"
OpMemberName %InnerS 0 "v"
OpName %v "v"
OpName %OuterS "OuterS"
OpMemberName %OuterS 0 "a1"
OpName %s1 "s1"
OpName %i "i"
OpDecorate %Uniforms Block
OpMemberDecorate %Uniforms 0 Offset 0
OpDecorate %uniforms NonWritable
OpDecorate %uniforms DescriptorSet 1
OpDecorate %uniforms Binding 4
OpMemberDecorate %InnerS 0 Offset 0
OpMemberDecorate %OuterS 0 Offset 0
OpDecorate %_arr_InnerS_uint_8 ArrayStride 4
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%void = OpTypeVoid
%5 = OpTypeFunction %void
%int = OpTypeInt 32 1
%InnerS = OpTypeStruct %int
%_ptr_Function_InnerS = OpTypePointer Function %InnerS
%13 = OpConstantNull %InnerS
%uint_8 = OpConstant %uint 8
%_arr_InnerS_uint_8 = OpTypeArray %InnerS %uint_8
%OuterS = OpTypeStruct %_arr_InnerS_uint_8
%_ptr_Function_OuterS = OpTypePointer Function %OuterS
%19 = OpConstantNull %OuterS
%int_0 = OpConstant %int 0
%_ptr_Function_int = OpTypePointer Function %int
%23 = OpConstantNull %int
%int_4 = OpConstant %int 4
%bool = OpTypeBool
%int_1 = OpConstant %int 1
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%main = OpFunction %void None %5
%8 = OpLabel
%v = OpVariable %_ptr_Function_InnerS Function %13
%s1 = OpVariable %_ptr_Function_OuterS Function %19
%i = OpVariable %_ptr_Function_int Function %23
OpStore %i %int_0
OpBranch %24
%24 = OpLabel
OpLoopMerge %25 %26 None
OpBranch %27
%27 = OpLabel
%29 = OpLoad %int %i
%31 = OpSLessThan %bool %29 %int_4
%28 = OpLogicalNot %bool %31
OpSelectionMerge %33 None
OpBranchConditional %28 %34 %33
%34 = OpLabel
OpBranch %25
%33 = OpLabel
%35 = OpLoad %int %i
%37 = OpIAdd %int %35 %int_1
OpStore %i %37
OpBranch %26
%26 = OpLabel
%40 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%41 = OpLoad %uint %40
%42 = OpAccessChain %_ptr_Function_InnerS %s1 %uint_0 %41
%43 = OpLoad %InnerS %v
OpStore %42 %43
OpBranch %24
%25 = OpLabel
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,22 @@
struct Uniforms {
i : u32;
}
struct InnerS {
v : i32;
}
struct OuterS {
a1 : array<InnerS, 8>;
}
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
var s1 : OuterS;
for(var i : i32 = 0; (i < 4); s1.a1[uniforms.i] = v) {
i = (i + 1);
}
}

View File

@@ -0,0 +1,22 @@
struct Uniforms {
i : u32;
};
struct InnerS {
v : i32;
};
struct OuterS {
a1 : array<InnerS, 8>;
};
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
var s1 : OuterS;
var i: i32 = 0;
for (s1.a1[uniforms.i] = v; i < 4; i = i + 1) {
}
}

View File

@@ -0,0 +1,33 @@
#version 310 es
struct Uniforms {
uint i;
};
struct InnerS {
int v;
};
struct OuterS {
InnerS a1[8];
};
layout(binding = 4) uniform Uniforms_1 {
uint i;
} uniforms;
void tint_symbol() {
InnerS v = InnerS(0);
OuterS s1 = OuterS(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0)));
int i = 0;
{
for(s1.a1[uniforms.i] = v; (i < 4); i = (i + 1)) {
}
}
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -0,0 +1,27 @@
struct InnerS {
int v;
};
struct OuterS {
InnerS a1[8];
};
cbuffer cbuffer_uniforms : register(b4, space1) {
uint4 uniforms[1];
};
[numthreads(1, 1, 1)]
void main() {
InnerS v = (InnerS)0;
OuterS s1 = (OuterS)0;
int i = 0;
{
{
InnerS tint_symbol_1[8] = s1.a1;
tint_symbol_1[uniforms[0].x] = v;
s1.a1 = tint_symbol_1;
}
[loop] for(; (i < 4); i = (i + 1)) {
}
}
return;
}

View File

@@ -0,0 +1,28 @@
#include <metal_stdlib>
using namespace metal;
struct Uniforms {
/* 0x0000 */ uint i;
};
struct InnerS {
int v;
};
struct tint_array_wrapper {
InnerS arr[8];
};
struct OuterS {
tint_array_wrapper a1;
};
kernel void tint_symbol(const constant Uniforms* tint_symbol_1 [[buffer(0)]]) {
InnerS v = {};
OuterS s1 = {};
int i = 0;
for(s1.a1.arr[(*(tint_symbol_1)).i] = v; (i < 4); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
}
return;
}

View File

@@ -0,0 +1,84 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 44
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpName %uniforms "uniforms"
OpName %main "main"
OpName %InnerS "InnerS"
OpMemberName %InnerS 0 "v"
OpName %v "v"
OpName %OuterS "OuterS"
OpMemberName %OuterS 0 "a1"
OpName %s1 "s1"
OpName %i "i"
OpDecorate %Uniforms Block
OpMemberDecorate %Uniforms 0 Offset 0
OpDecorate %uniforms NonWritable
OpDecorate %uniforms DescriptorSet 1
OpDecorate %uniforms Binding 4
OpMemberDecorate %InnerS 0 Offset 0
OpMemberDecorate %OuterS 0 Offset 0
OpDecorate %_arr_InnerS_uint_8 ArrayStride 4
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%void = OpTypeVoid
%5 = OpTypeFunction %void
%int = OpTypeInt 32 1
%InnerS = OpTypeStruct %int
%_ptr_Function_InnerS = OpTypePointer Function %InnerS
%13 = OpConstantNull %InnerS
%uint_8 = OpConstant %uint 8
%_arr_InnerS_uint_8 = OpTypeArray %InnerS %uint_8
%OuterS = OpTypeStruct %_arr_InnerS_uint_8
%_ptr_Function_OuterS = OpTypePointer Function %OuterS
%19 = OpConstantNull %OuterS
%int_0 = OpConstant %int 0
%_ptr_Function_int = OpTypePointer Function %int
%23 = OpConstantNull %int
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%int_4 = OpConstant %int 4
%bool = OpTypeBool
%int_1 = OpConstant %int 1
%main = OpFunction %void None %5
%8 = OpLabel
%v = OpVariable %_ptr_Function_InnerS Function %13
%s1 = OpVariable %_ptr_Function_OuterS Function %19
%i = OpVariable %_ptr_Function_int Function %23
OpStore %i %int_0
%26 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%27 = OpLoad %uint %26
%28 = OpAccessChain %_ptr_Function_InnerS %s1 %uint_0 %27
%29 = OpLoad %InnerS %v
OpStore %28 %29
OpBranch %30
%30 = OpLabel
OpLoopMerge %31 %32 None
OpBranch %33
%33 = OpLabel
%35 = OpLoad %int %i
%37 = OpSLessThan %bool %35 %int_4
%34 = OpLogicalNot %bool %37
OpSelectionMerge %39 None
OpBranchConditional %34 %40 %39
%40 = OpLabel
OpBranch %31
%39 = OpLabel
OpBranch %32
%32 = OpLabel
%41 = OpLoad %int %i
%43 = OpIAdd %int %41 %int_1
OpStore %i %43
OpBranch %30
%31 = OpLabel
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,22 @@
struct Uniforms {
i : u32;
}
struct InnerS {
v : i32;
}
struct OuterS {
a1 : array<InnerS, 8>;
}
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
var s1 : OuterS;
var i : i32 = 0;
for(s1.a1[uniforms.i] = v; (i < 4); i = (i + 1)) {
}
}

View File

@@ -0,0 +1,31 @@
struct Uniforms {
i : u32;
j : u32;
};
struct InnerS {
v : i32;
};
struct S1 {
a2 : array<InnerS, 8>;
};
struct OuterS {
a1 : array<S1, 8>;
};
var<private> nextIndex : u32;
fn getNextIndex() -> u32 {
nextIndex = nextIndex + 1u;
return nextIndex;
}
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
var s : OuterS;
s.a1[getNextIndex()].a2[uniforms.j] = v;
}

View File

@@ -0,0 +1,41 @@
#version 310 es
struct Uniforms {
uint i;
uint j;
};
struct InnerS {
int v;
};
struct S1 {
InnerS a2[8];
};
struct OuterS {
S1 a1[8];
};
uint nextIndex = 0u;
uint getNextIndex() {
nextIndex = (nextIndex + 1u);
return nextIndex;
}
layout(binding = 4) uniform Uniforms_1 {
uint i;
uint j;
} uniforms;
void tint_symbol() {
InnerS v = InnerS(0);
OuterS s = OuterS(S1[8](S1(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0))), S1(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0))), S1(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0))), S1(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0))), S1(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0))), S1(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0))), S1(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0))), S1(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0)))));
s.a1[getNextIndex()].a2[uniforms.j] = v;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -0,0 +1,35 @@
struct InnerS {
int v;
};
struct S1 {
InnerS a2[8];
};
struct OuterS {
S1 a1[8];
};
static uint nextIndex = 0u;
uint getNextIndex() {
nextIndex = (nextIndex + 1u);
return nextIndex;
}
cbuffer cbuffer_uniforms : register(b4, space1) {
uint4 uniforms[1];
};
[numthreads(1, 1, 1)]
void main() {
InnerS v = (InnerS)0;
OuterS s = (OuterS)0;
{
S1 tint_symbol_1[8] = s.a1;
const uint tint_symbol_2_save = getNextIndex();
InnerS tint_symbol_3[8] = tint_symbol_1[tint_symbol_2_save].a2;
tint_symbol_3[uniforms[0].y] = v;
tint_symbol_1[tint_symbol_2_save].a2 = tint_symbol_3;
s.a1 = tint_symbol_1;
}
return;
}

View File

@@ -0,0 +1,41 @@
#include <metal_stdlib>
using namespace metal;
struct Uniforms {
/* 0x0000 */ uint i;
/* 0x0004 */ uint j;
};
struct InnerS {
int v;
};
struct tint_array_wrapper {
InnerS arr[8];
};
struct S1 {
tint_array_wrapper a2;
};
struct tint_array_wrapper_1 {
S1 arr[8];
};
struct OuterS {
tint_array_wrapper_1 a1;
};
uint getNextIndex(thread uint* const tint_symbol_1) {
*(tint_symbol_1) = (*(tint_symbol_1) + 1u);
return *(tint_symbol_1);
}
kernel void tint_symbol(const constant Uniforms* tint_symbol_3 [[buffer(0)]]) {
thread uint tint_symbol_2 = 0u;
InnerS v = {};
OuterS s = {};
s.a1.arr[getNextIndex(&(tint_symbol_2))].a2.arr[(*(tint_symbol_3)).j] = v;
return;
}

View File

@@ -0,0 +1,79 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 39
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %nextIndex "nextIndex"
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpMemberName %Uniforms 1 "j"
OpName %uniforms "uniforms"
OpName %getNextIndex "getNextIndex"
OpName %main "main"
OpName %InnerS "InnerS"
OpMemberName %InnerS 0 "v"
OpName %v "v"
OpName %OuterS "OuterS"
OpMemberName %OuterS 0 "a1"
OpName %S1 "S1"
OpMemberName %S1 0 "a2"
OpName %s "s"
OpDecorate %Uniforms Block
OpMemberDecorate %Uniforms 0 Offset 0
OpMemberDecorate %Uniforms 1 Offset 4
OpDecorate %uniforms NonWritable
OpDecorate %uniforms DescriptorSet 1
OpDecorate %uniforms Binding 4
OpMemberDecorate %InnerS 0 Offset 0
OpMemberDecorate %OuterS 0 Offset 0
OpMemberDecorate %S1 0 Offset 0
OpDecorate %_arr_InnerS_uint_8 ArrayStride 4
OpDecorate %_arr_S1_uint_8 ArrayStride 32
%uint = OpTypeInt 32 0
%_ptr_Private_uint = OpTypePointer Private %uint
%4 = OpConstantNull %uint
%nextIndex = OpVariable %_ptr_Private_uint Private %4
%Uniforms = OpTypeStruct %uint %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%8 = OpTypeFunction %uint
%uint_1 = OpConstant %uint 1
%void = OpTypeVoid
%15 = OpTypeFunction %void
%int = OpTypeInt 32 1
%InnerS = OpTypeStruct %int
%_ptr_Function_InnerS = OpTypePointer Function %InnerS
%23 = OpConstantNull %InnerS
%uint_8 = OpConstant %uint 8
%_arr_InnerS_uint_8 = OpTypeArray %InnerS %uint_8
%S1 = OpTypeStruct %_arr_InnerS_uint_8
%_arr_S1_uint_8 = OpTypeArray %S1 %uint_8
%OuterS = OpTypeStruct %_arr_S1_uint_8
%_ptr_Function_OuterS = OpTypePointer Function %OuterS
%31 = OpConstantNull %OuterS
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%getNextIndex = OpFunction %uint None %8
%10 = OpLabel
%11 = OpLoad %uint %nextIndex
%13 = OpIAdd %uint %11 %uint_1
OpStore %nextIndex %13
%14 = OpLoad %uint %nextIndex
OpReturnValue %14
OpFunctionEnd
%main = OpFunction %void None %15
%18 = OpLabel
%v = OpVariable %_ptr_Function_InnerS Function %23
%s = OpVariable %_ptr_Function_OuterS Function %31
%33 = OpFunctionCall %uint %getNextIndex
%35 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
%36 = OpLoad %uint %35
%37 = OpAccessChain %_ptr_Function_InnerS %s %uint_0 %33 %uint_0 %36
%38 = OpLoad %InnerS %v
OpStore %37 %38
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,32 @@
struct Uniforms {
i : u32;
j : u32;
}
struct InnerS {
v : i32;
}
struct S1 {
a2 : array<InnerS, 8>;
}
struct OuterS {
a1 : array<S1, 8>;
}
var<private> nextIndex : u32;
fn getNextIndex() -> u32 {
nextIndex = (nextIndex + 1u);
return nextIndex;
}
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
var s : OuterS;
s.a1[getNextIndex()].a2[uniforms.j] = v;
}

View File

@@ -0,0 +1,21 @@
struct Uniforms {
i : u32;
};
struct InnerS {
v : i32;
};
struct OuterS {
a1 : array<InnerS, 8>;
};
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
var s1 : OuterS;
s1.a1[uniforms.i] = v;
//s1.a1[0] = v;
}

View File

@@ -0,0 +1,29 @@
#version 310 es
struct Uniforms {
uint i;
};
struct InnerS {
int v;
};
struct OuterS {
InnerS a1[8];
};
layout(binding = 4) uniform Uniforms_1 {
uint i;
} uniforms;
void tint_symbol() {
InnerS v = InnerS(0);
OuterS s1 = OuterS(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0)));
s1.a1[uniforms.i] = v;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -0,0 +1,22 @@
struct InnerS {
int v;
};
struct OuterS {
InnerS a1[8];
};
cbuffer cbuffer_uniforms : register(b4, space1) {
uint4 uniforms[1];
};
[numthreads(1, 1, 1)]
void main() {
InnerS v = (InnerS)0;
OuterS s1 = (OuterS)0;
{
InnerS tint_symbol_1[8] = s1.a1;
tint_symbol_1[uniforms[0].x] = v;
s1.a1 = tint_symbol_1;
}
return;
}

View File

@@ -0,0 +1,26 @@
#include <metal_stdlib>
using namespace metal;
struct Uniforms {
/* 0x0000 */ uint i;
};
struct InnerS {
int v;
};
struct tint_array_wrapper {
InnerS arr[8];
};
struct OuterS {
tint_array_wrapper a1;
};
kernel void tint_symbol(const constant Uniforms* tint_symbol_1 [[buffer(0)]]) {
InnerS v = {};
OuterS s1 = {};
s1.a1.arr[(*(tint_symbol_1)).i] = v;
return;
}

View File

@@ -0,0 +1,55 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 26
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpName %uniforms "uniforms"
OpName %main "main"
OpName %InnerS "InnerS"
OpMemberName %InnerS 0 "v"
OpName %v "v"
OpName %OuterS "OuterS"
OpMemberName %OuterS 0 "a1"
OpName %s1 "s1"
OpDecorate %Uniforms Block
OpMemberDecorate %Uniforms 0 Offset 0
OpDecorate %uniforms NonWritable
OpDecorate %uniforms DescriptorSet 1
OpDecorate %uniforms Binding 4
OpMemberDecorate %InnerS 0 Offset 0
OpMemberDecorate %OuterS 0 Offset 0
OpDecorate %_arr_InnerS_uint_8 ArrayStride 4
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%void = OpTypeVoid
%5 = OpTypeFunction %void
%int = OpTypeInt 32 1
%InnerS = OpTypeStruct %int
%_ptr_Function_InnerS = OpTypePointer Function %InnerS
%13 = OpConstantNull %InnerS
%uint_8 = OpConstant %uint 8
%_arr_InnerS_uint_8 = OpTypeArray %InnerS %uint_8
%OuterS = OpTypeStruct %_arr_InnerS_uint_8
%_ptr_Function_OuterS = OpTypePointer Function %OuterS
%19 = OpConstantNull %OuterS
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%main = OpFunction %void None %5
%8 = OpLabel
%v = OpVariable %_ptr_Function_InnerS Function %13
%s1 = OpVariable %_ptr_Function_OuterS Function %19
%22 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%23 = OpLoad %uint %22
%24 = OpAccessChain %_ptr_Function_InnerS %s1 %uint_0 %23
%25 = OpLoad %InnerS %v
OpStore %24 %25
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,20 @@
struct Uniforms {
i : u32;
}
struct InnerS {
v : i32;
}
struct OuterS {
a1 : array<InnerS, 8>;
}
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
var s1 : OuterS;
s1.a1[uniforms.i] = v;
}

View File

@@ -0,0 +1,21 @@
struct Uniforms {
i : u32;
j : u32;
};
struct InnerS {
v : i32;
};
struct OuterS {
a1 : array<array<InnerS, 8>, 8>;
};
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
var s1 : OuterS;
s1.a1[uniforms.i][uniforms.j] = v;
}

View File

@@ -0,0 +1,31 @@
#version 310 es
struct Uniforms {
uint i;
uint j;
};
struct InnerS {
int v;
};
struct OuterS {
InnerS a1[8][8];
};
layout(binding = 4) uniform Uniforms_1 {
uint i;
uint j;
} uniforms;
void tint_symbol() {
InnerS v = InnerS(0);
OuterS s1 = OuterS(InnerS[8][8](InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0)), InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0)), InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0)), InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0)), InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0)), InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0)), InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0)), InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0))));
s1.a1[uniforms.i][uniforms.j] = v;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -0,0 +1,22 @@
struct InnerS {
int v;
};
struct OuterS {
InnerS a1[8][8];
};
cbuffer cbuffer_uniforms : register(b4, space1) {
uint4 uniforms[1];
};
[numthreads(1, 1, 1)]
void main() {
InnerS v = (InnerS)0;
OuterS s1 = (OuterS)0;
{
InnerS tint_symbol_1[8][8] = s1.a1;
tint_symbol_1[uniforms[0].x][uniforms[0].y] = v;
s1.a1 = tint_symbol_1;
}
return;
}

View File

@@ -0,0 +1,31 @@
#include <metal_stdlib>
using namespace metal;
struct Uniforms {
/* 0x0000 */ uint i;
/* 0x0004 */ uint j;
};
struct InnerS {
int v;
};
struct tint_array_wrapper_1 {
InnerS arr[8];
};
struct tint_array_wrapper {
tint_array_wrapper_1 arr[8];
};
struct OuterS {
tint_array_wrapper a1;
};
kernel void tint_symbol(const constant Uniforms* tint_symbol_1 [[buffer(0)]]) {
InnerS v = {};
OuterS s1 = {};
s1.a1.arr[(*(tint_symbol_1)).i].arr[(*(tint_symbol_1)).j] = v;
return;
}

View File

@@ -0,0 +1,62 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 30
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpMemberName %Uniforms 1 "j"
OpName %uniforms "uniforms"
OpName %main "main"
OpName %InnerS "InnerS"
OpMemberName %InnerS 0 "v"
OpName %v "v"
OpName %OuterS "OuterS"
OpMemberName %OuterS 0 "a1"
OpName %s1 "s1"
OpDecorate %Uniforms Block
OpMemberDecorate %Uniforms 0 Offset 0
OpMemberDecorate %Uniforms 1 Offset 4
OpDecorate %uniforms NonWritable
OpDecorate %uniforms DescriptorSet 1
OpDecorate %uniforms Binding 4
OpMemberDecorate %InnerS 0 Offset 0
OpMemberDecorate %OuterS 0 Offset 0
OpDecorate %_arr_InnerS_uint_8 ArrayStride 4
OpDecorate %_arr__arr_InnerS_uint_8_uint_8 ArrayStride 32
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%void = OpTypeVoid
%5 = OpTypeFunction %void
%int = OpTypeInt 32 1
%InnerS = OpTypeStruct %int
%_ptr_Function_InnerS = OpTypePointer Function %InnerS
%13 = OpConstantNull %InnerS
%uint_8 = OpConstant %uint 8
%_arr_InnerS_uint_8 = OpTypeArray %InnerS %uint_8
%_arr__arr_InnerS_uint_8_uint_8 = OpTypeArray %_arr_InnerS_uint_8 %uint_8
%OuterS = OpTypeStruct %_arr__arr_InnerS_uint_8_uint_8
%_ptr_Function_OuterS = OpTypePointer Function %OuterS
%20 = OpConstantNull %OuterS
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%uint_1 = OpConstant %uint 1
%main = OpFunction %void None %5
%8 = OpLabel
%v = OpVariable %_ptr_Function_InnerS Function %13
%s1 = OpVariable %_ptr_Function_OuterS Function %20
%23 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%24 = OpLoad %uint %23
%26 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
%27 = OpLoad %uint %26
%28 = OpAccessChain %_ptr_Function_InnerS %s1 %uint_0 %24 %27
%29 = OpLoad %InnerS %v
OpStore %28 %29
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,21 @@
struct Uniforms {
i : u32;
j : u32;
}
struct InnerS {
v : i32;
}
struct OuterS {
a1 : array<array<InnerS, 8>, 8>;
}
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
var s1 : OuterS;
s1.a1[uniforms.i][uniforms.j] = v;
}

View File

@@ -0,0 +1,24 @@
struct Uniforms {
i : u32;
};
struct InnerS {
v : i32;
};
struct S1 {
s2 : InnerS;
};
struct OuterS {
a1 : array<S1, 8>;
};
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
var s1 : OuterS;
s1.a1[uniforms.i].s2 = v;
}

View File

@@ -0,0 +1,33 @@
#version 310 es
struct Uniforms {
uint i;
};
struct InnerS {
int v;
};
struct S1 {
InnerS s2;
};
struct OuterS {
S1 a1[8];
};
layout(binding = 4) uniform Uniforms_1 {
uint i;
} uniforms;
void tint_symbol() {
InnerS v = InnerS(0);
OuterS s1 = OuterS(S1[8](S1(InnerS(0)), S1(InnerS(0)), S1(InnerS(0)), S1(InnerS(0)), S1(InnerS(0)), S1(InnerS(0)), S1(InnerS(0)), S1(InnerS(0))));
s1.a1[uniforms.i].s2 = v;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -0,0 +1,25 @@
struct InnerS {
int v;
};
struct S1 {
InnerS s2;
};
struct OuterS {
S1 a1[8];
};
cbuffer cbuffer_uniforms : register(b4, space1) {
uint4 uniforms[1];
};
[numthreads(1, 1, 1)]
void main() {
InnerS v = (InnerS)0;
OuterS s1 = (OuterS)0;
{
S1 tint_symbol_1[8] = s1.a1;
tint_symbol_1[uniforms[0].x].s2 = v;
s1.a1 = tint_symbol_1;
}
return;
}

View File

@@ -0,0 +1,30 @@
#include <metal_stdlib>
using namespace metal;
struct Uniforms {
/* 0x0000 */ uint i;
};
struct InnerS {
int v;
};
struct S1 {
InnerS s2;
};
struct tint_array_wrapper {
S1 arr[8];
};
struct OuterS {
tint_array_wrapper a1;
};
kernel void tint_symbol(const constant Uniforms* tint_symbol_1 [[buffer(0)]]) {
InnerS v = {};
OuterS s1 = {};
s1.a1.arr[(*(tint_symbol_1)).i].s2 = v;
return;
}

View File

@@ -0,0 +1,59 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 27
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpName %uniforms "uniforms"
OpName %main "main"
OpName %InnerS "InnerS"
OpMemberName %InnerS 0 "v"
OpName %v "v"
OpName %OuterS "OuterS"
OpMemberName %OuterS 0 "a1"
OpName %S1 "S1"
OpMemberName %S1 0 "s2"
OpName %s1 "s1"
OpDecorate %Uniforms Block
OpMemberDecorate %Uniforms 0 Offset 0
OpDecorate %uniforms NonWritable
OpDecorate %uniforms DescriptorSet 1
OpDecorate %uniforms Binding 4
OpMemberDecorate %InnerS 0 Offset 0
OpMemberDecorate %OuterS 0 Offset 0
OpMemberDecorate %S1 0 Offset 0
OpDecorate %_arr_S1_uint_8 ArrayStride 4
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%void = OpTypeVoid
%5 = OpTypeFunction %void
%int = OpTypeInt 32 1
%InnerS = OpTypeStruct %int
%_ptr_Function_InnerS = OpTypePointer Function %InnerS
%13 = OpConstantNull %InnerS
%S1 = OpTypeStruct %InnerS
%uint_8 = OpConstant %uint 8
%_arr_S1_uint_8 = OpTypeArray %S1 %uint_8
%OuterS = OpTypeStruct %_arr_S1_uint_8
%_ptr_Function_OuterS = OpTypePointer Function %OuterS
%20 = OpConstantNull %OuterS
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%main = OpFunction %void None %5
%8 = OpLabel
%v = OpVariable %_ptr_Function_InnerS Function %13
%s1 = OpVariable %_ptr_Function_OuterS Function %20
%23 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%24 = OpLoad %uint %23
%25 = OpAccessChain %_ptr_Function_InnerS %s1 %uint_0 %24 %uint_0
%26 = OpLoad %InnerS %v
OpStore %25 %26
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,24 @@
struct Uniforms {
i : u32;
}
struct InnerS {
v : i32;
}
struct S1 {
s2 : InnerS;
}
struct OuterS {
a1 : array<S1, 8>;
}
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
var s1 : OuterS;
s1.a1[uniforms.i].s2 = v;
}

View File

@@ -0,0 +1,25 @@
struct Uniforms {
i : u32;
j : u32;
};
struct InnerS {
v : i32;
};
struct S1 {
a2 : array<InnerS, 8>;
};
struct OuterS {
a1 : array<S1, 8>;
};
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
var s : OuterS;
s.a1[uniforms.i].a2[uniforms.j] = v;
}

View File

@@ -0,0 +1,35 @@
#version 310 es
struct Uniforms {
uint i;
uint j;
};
struct InnerS {
int v;
};
struct S1 {
InnerS a2[8];
};
struct OuterS {
S1 a1[8];
};
layout(binding = 4) uniform Uniforms_1 {
uint i;
uint j;
} uniforms;
void tint_symbol() {
InnerS v = InnerS(0);
OuterS s = OuterS(S1[8](S1(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0))), S1(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0))), S1(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0))), S1(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0))), S1(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0))), S1(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0))), S1(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0))), S1(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0)))));
s.a1[uniforms.i].a2[uniforms.j] = v;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -0,0 +1,28 @@
struct InnerS {
int v;
};
struct S1 {
InnerS a2[8];
};
struct OuterS {
S1 a1[8];
};
cbuffer cbuffer_uniforms : register(b4, space1) {
uint4 uniforms[1];
};
[numthreads(1, 1, 1)]
void main() {
InnerS v = (InnerS)0;
OuterS s = (OuterS)0;
{
S1 tint_symbol_1[8] = s.a1;
const uint tint_symbol_2_save = uniforms[0].x;
InnerS tint_symbol_3[8] = tint_symbol_1[tint_symbol_2_save].a2;
tint_symbol_3[uniforms[0].y] = v;
tint_symbol_1[tint_symbol_2_save].a2 = tint_symbol_3;
s.a1 = tint_symbol_1;
}
return;
}

View File

@@ -0,0 +1,35 @@
#include <metal_stdlib>
using namespace metal;
struct Uniforms {
/* 0x0000 */ uint i;
/* 0x0004 */ uint j;
};
struct InnerS {
int v;
};
struct tint_array_wrapper {
InnerS arr[8];
};
struct S1 {
tint_array_wrapper a2;
};
struct tint_array_wrapper_1 {
S1 arr[8];
};
struct OuterS {
tint_array_wrapper_1 a1;
};
kernel void tint_symbol(const constant Uniforms* tint_symbol_1 [[buffer(0)]]) {
InnerS v = {};
OuterS s = {};
s.a1.arr[(*(tint_symbol_1)).i].a2.arr[(*(tint_symbol_1)).j] = v;
return;
}

View File

@@ -0,0 +1,66 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 31
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpMemberName %Uniforms 1 "j"
OpName %uniforms "uniforms"
OpName %main "main"
OpName %InnerS "InnerS"
OpMemberName %InnerS 0 "v"
OpName %v "v"
OpName %OuterS "OuterS"
OpMemberName %OuterS 0 "a1"
OpName %S1 "S1"
OpMemberName %S1 0 "a2"
OpName %s "s"
OpDecorate %Uniforms Block
OpMemberDecorate %Uniforms 0 Offset 0
OpMemberDecorate %Uniforms 1 Offset 4
OpDecorate %uniforms NonWritable
OpDecorate %uniforms DescriptorSet 1
OpDecorate %uniforms Binding 4
OpMemberDecorate %InnerS 0 Offset 0
OpMemberDecorate %OuterS 0 Offset 0
OpMemberDecorate %S1 0 Offset 0
OpDecorate %_arr_InnerS_uint_8 ArrayStride 4
OpDecorate %_arr_S1_uint_8 ArrayStride 32
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%void = OpTypeVoid
%5 = OpTypeFunction %void
%int = OpTypeInt 32 1
%InnerS = OpTypeStruct %int
%_ptr_Function_InnerS = OpTypePointer Function %InnerS
%13 = OpConstantNull %InnerS
%uint_8 = OpConstant %uint 8
%_arr_InnerS_uint_8 = OpTypeArray %InnerS %uint_8
%S1 = OpTypeStruct %_arr_InnerS_uint_8
%_arr_S1_uint_8 = OpTypeArray %S1 %uint_8
%OuterS = OpTypeStruct %_arr_S1_uint_8
%_ptr_Function_OuterS = OpTypePointer Function %OuterS
%21 = OpConstantNull %OuterS
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%uint_1 = OpConstant %uint 1
%main = OpFunction %void None %5
%8 = OpLabel
%v = OpVariable %_ptr_Function_InnerS Function %13
%s = OpVariable %_ptr_Function_OuterS Function %21
%24 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%25 = OpLoad %uint %24
%27 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
%28 = OpLoad %uint %27
%29 = OpAccessChain %_ptr_Function_InnerS %s %uint_0 %25 %uint_0 %28
%30 = OpLoad %InnerS %v
OpStore %29 %30
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,25 @@
struct Uniforms {
i : u32;
j : u32;
}
struct InnerS {
v : i32;
}
struct S1 {
a2 : array<InnerS, 8>;
}
struct OuterS {
a1 : array<S1, 8>;
}
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
var s : OuterS;
s.a1[uniforms.i].a2[uniforms.j] = v;
}

View File

@@ -0,0 +1,20 @@
struct Uniforms {
i : u32;
};
struct InnerS {
v : i32;
};
struct OuterS {
a1 : array<InnerS>;
};
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@binding(0) @group(0) var<storage, read_write> s1 : OuterS;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
s1.a1[uniforms.i] = v;
}

View File

@@ -0,0 +1,27 @@
#version 310 es
struct Uniforms {
uint i;
};
struct InnerS {
int v;
};
layout(binding = 4) uniform Uniforms_1 {
uint i;
} uniforms;
layout(binding = 0, std430) buffer OuterS_1 {
InnerS a1[];
} s1;
void tint_symbol() {
InnerS v = InnerS(0);
s1.a1[uniforms.i] = v;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -0,0 +1,19 @@
struct InnerS {
int v;
};
cbuffer cbuffer_uniforms : register(b4, space1) {
uint4 uniforms[1];
};
RWByteAddressBuffer s1 : register(u0, space0);
void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, InnerS value) {
buffer.Store((offset + 0u), asuint(value.v));
}
[numthreads(1, 1, 1)]
void main() {
InnerS v = (InnerS)0;
tint_symbol_1(s1, (4u * uniforms[0].x), v);
return;
}

View File

@@ -0,0 +1,21 @@
#include <metal_stdlib>
using namespace metal;
struct Uniforms {
/* 0x0000 */ uint i;
};
struct InnerS {
/* 0x0000 */ int v;
};
struct OuterS {
/* 0x0000 */ InnerS a1[1];
};
kernel void tint_symbol(device OuterS* tint_symbol_1 [[buffer(1)]], const constant Uniforms* tint_symbol_2 [[buffer(0)]]) {
InnerS v = {};
(*(tint_symbol_1)).a1[(*(tint_symbol_2)).i] = v;
return;
}

View File

@@ -0,0 +1,57 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 25
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpName %uniforms "uniforms"
OpName %OuterS "OuterS"
OpMemberName %OuterS 0 "a1"
OpName %InnerS "InnerS"
OpMemberName %InnerS 0 "v"
OpName %s1 "s1"
OpName %main "main"
OpName %v "v"
OpDecorate %Uniforms Block
OpMemberDecorate %Uniforms 0 Offset 0
OpDecorate %uniforms NonWritable
OpDecorate %uniforms DescriptorSet 1
OpDecorate %uniforms Binding 4
OpDecorate %OuterS Block
OpMemberDecorate %OuterS 0 Offset 0
OpMemberDecorate %InnerS 0 Offset 0
OpDecorate %_runtimearr_InnerS ArrayStride 4
OpDecorate %s1 Binding 0
OpDecorate %s1 DescriptorSet 0
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%int = OpTypeInt 32 1
%InnerS = OpTypeStruct %int
%_runtimearr_InnerS = OpTypeRuntimeArray %InnerS
%OuterS = OpTypeStruct %_runtimearr_InnerS
%_ptr_StorageBuffer_OuterS = OpTypePointer StorageBuffer %OuterS
%s1 = OpVariable %_ptr_StorageBuffer_OuterS StorageBuffer
%void = OpTypeVoid
%11 = OpTypeFunction %void
%_ptr_Function_InnerS = OpTypePointer Function %InnerS
%17 = OpConstantNull %InnerS
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%_ptr_StorageBuffer_InnerS = OpTypePointer StorageBuffer %InnerS
%main = OpFunction %void None %11
%14 = OpLabel
%v = OpVariable %_ptr_Function_InnerS Function %17
%20 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%21 = OpLoad %uint %20
%23 = OpAccessChain %_ptr_StorageBuffer_InnerS %s1 %uint_0 %21
%24 = OpLoad %InnerS %v
OpStore %23 %24
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,21 @@
struct Uniforms {
i : u32;
}
struct InnerS {
v : i32;
}
struct OuterS {
a1 : array<InnerS>;
}
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@binding(0) @group(0) var<storage, read_write> s1 : OuterS;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
s1.a1[uniforms.i] = v;
}

View File

@@ -0,0 +1,25 @@
struct Uniforms {
i : u32;
j : u32;
};
struct InnerS {
v : i32;
};
struct S1 {
a2 : array<InnerS, 8>;
};
struct OuterS {
a1 : array<S1>;
};
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@binding(0) @group(0) var<storage, read_write> s : OuterS;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
s.a1[uniforms.i].a2[uniforms.j] = v;
}

View File

@@ -0,0 +1,33 @@
#version 310 es
struct Uniforms {
uint i;
uint j;
};
struct InnerS {
int v;
};
struct S1 {
InnerS a2[8];
};
layout(binding = 4) uniform Uniforms_1 {
uint i;
uint j;
} uniforms;
layout(binding = 0, std430) buffer OuterS_1 {
S1 a1[];
} s;
void tint_symbol() {
InnerS v = InnerS(0);
s.a1[uniforms.i].a2[uniforms.j] = v;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -0,0 +1,19 @@
struct InnerS {
int v;
};
cbuffer cbuffer_uniforms : register(b4, space1) {
uint4 uniforms[1];
};
RWByteAddressBuffer s : register(u0, space0);
void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, InnerS value) {
buffer.Store((offset + 0u), asuint(value.v));
}
[numthreads(1, 1, 1)]
void main() {
InnerS v = (InnerS)0;
tint_symbol_1(s, ((32u * uniforms[0].x) + (4u * uniforms[0].y)), v);
return;
}

View File

@@ -0,0 +1,30 @@
#include <metal_stdlib>
using namespace metal;
struct Uniforms {
/* 0x0000 */ uint i;
/* 0x0004 */ uint j;
};
struct InnerS {
/* 0x0000 */ int v;
};
struct tint_array_wrapper {
/* 0x0000 */ InnerS arr[8];
};
struct S1 {
/* 0x0000 */ tint_array_wrapper a2;
};
struct OuterS {
/* 0x0000 */ S1 a1[1];
};
kernel void tint_symbol(device OuterS* tint_symbol_1 [[buffer(1)]], const constant Uniforms* tint_symbol_2 [[buffer(0)]]) {
InnerS v = {};
(*(tint_symbol_1)).a1[(*(tint_symbol_2)).i].a2.arr[(*(tint_symbol_2)).j] = v;
return;
}

View File

@@ -0,0 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 31
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpMemberName %Uniforms 1 "j"
OpName %uniforms "uniforms"
OpName %OuterS "OuterS"
OpMemberName %OuterS 0 "a1"
OpName %S1 "S1"
OpMemberName %S1 0 "a2"
OpName %InnerS "InnerS"
OpMemberName %InnerS 0 "v"
OpName %s "s"
OpName %main "main"
OpName %v "v"
OpDecorate %Uniforms Block
OpMemberDecorate %Uniforms 0 Offset 0
OpMemberDecorate %Uniforms 1 Offset 4
OpDecorate %uniforms NonWritable
OpDecorate %uniforms DescriptorSet 1
OpDecorate %uniforms Binding 4
OpDecorate %OuterS Block
OpMemberDecorate %OuterS 0 Offset 0
OpMemberDecorate %S1 0 Offset 0
OpMemberDecorate %InnerS 0 Offset 0
OpDecorate %_arr_InnerS_uint_8 ArrayStride 4
OpDecorate %_runtimearr_S1 ArrayStride 32
OpDecorate %s Binding 0
OpDecorate %s DescriptorSet 0
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%int = OpTypeInt 32 1
%InnerS = OpTypeStruct %int
%uint_8 = OpConstant %uint 8
%_arr_InnerS_uint_8 = OpTypeArray %InnerS %uint_8
%S1 = OpTypeStruct %_arr_InnerS_uint_8
%_runtimearr_S1 = OpTypeRuntimeArray %S1
%OuterS = OpTypeStruct %_runtimearr_S1
%_ptr_StorageBuffer_OuterS = OpTypePointer StorageBuffer %OuterS
%s = OpVariable %_ptr_StorageBuffer_OuterS StorageBuffer
%void = OpTypeVoid
%14 = OpTypeFunction %void
%_ptr_Function_InnerS = OpTypePointer Function %InnerS
%20 = OpConstantNull %InnerS
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%uint_1 = OpConstant %uint 1
%_ptr_StorageBuffer_InnerS = OpTypePointer StorageBuffer %InnerS
%main = OpFunction %void None %14
%17 = OpLabel
%v = OpVariable %_ptr_Function_InnerS Function %20
%23 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%24 = OpLoad %uint %23
%26 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
%27 = OpLoad %uint %26
%29 = OpAccessChain %_ptr_StorageBuffer_InnerS %s %uint_0 %24 %uint_0 %27
%30 = OpLoad %InnerS %v
OpStore %29 %30
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,26 @@
struct Uniforms {
i : u32;
j : u32;
}
struct InnerS {
v : i32;
}
struct S1 {
a2 : array<InnerS, 8>;
}
struct OuterS {
a1 : array<S1>;
}
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@binding(0) @group(0) var<storage, read_write> s : OuterS;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
s.a1[uniforms.i].a2[uniforms.j] = v;
}

View File

@@ -0,0 +1,16 @@
struct Uniforms {
i : u32;
};
struct OuterS {
m1 : mat2x4<f32>;
};
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var s1 : OuterS;
s1.m1[uniforms.i] = vec4<f32>(1.0);
s1.m1[uniforms.i][uniforms.i] = 1.0;
}

View File

@@ -0,0 +1,25 @@
#version 310 es
struct Uniforms {
uint i;
};
struct OuterS {
mat2x4 m1;
};
layout(binding = 4) uniform Uniforms_1 {
uint i;
} uniforms;
void tint_symbol() {
OuterS s1 = OuterS(mat2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f));
s1.m1[uniforms.i] = vec4(1.0f);
s1.m1[uniforms.i][uniforms.i] = 1.0f;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -0,0 +1,33 @@
void set_vector_float2x4(inout float2x4 mat, int col, float4 val) {
switch (col) {
case 0: mat[0] = val; break;
case 1: mat[1] = val; break;
}
}
void set_scalar_float2x4(inout float2x4 mat, int col, int row, float val) {
switch (col) {
case 0:
mat[0] = (row.xxxx == int4(0, 1, 2, 3)) ? val.xxxx : mat[0];
break;
case 1:
mat[1] = (row.xxxx == int4(0, 1, 2, 3)) ? val.xxxx : mat[1];
break;
}
}
struct OuterS {
float2x4 m1;
};
cbuffer cbuffer_uniforms : register(b4, space1) {
uint4 uniforms[1];
};
[numthreads(1, 1, 1)]
void main() {
OuterS s1 = (OuterS)0;
set_vector_float2x4(s1.m1, uniforms[0].x, float4((1.0f).xxxx));
set_scalar_float2x4(s1.m1, uniforms[0].x, uniforms[0].x, 1.0f);
return;
}

View File

@@ -0,0 +1,18 @@
#include <metal_stdlib>
using namespace metal;
struct Uniforms {
/* 0x0000 */ uint i;
};
struct OuterS {
float2x4 m1;
};
kernel void tint_symbol(const constant Uniforms* tint_symbol_1 [[buffer(0)]]) {
OuterS s1 = {};
s1.m1[(*(tint_symbol_1)).i] = float4(1.0f);
s1.m1[(*(tint_symbol_1)).i][(*(tint_symbol_1)).i] = 1.0f;
return;
}

View File

@@ -0,0 +1,57 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 30
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpName %uniforms "uniforms"
OpName %main "main"
OpName %OuterS "OuterS"
OpMemberName %OuterS 0 "m1"
OpName %s1 "s1"
OpDecorate %Uniforms Block
OpMemberDecorate %Uniforms 0 Offset 0
OpDecorate %uniforms NonWritable
OpDecorate %uniforms DescriptorSet 1
OpDecorate %uniforms Binding 4
OpMemberDecorate %OuterS 0 Offset 0
OpMemberDecorate %OuterS 0 ColMajor
OpMemberDecorate %OuterS 0 MatrixStride 16
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%void = OpTypeVoid
%5 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%mat2v4float = OpTypeMatrix %v4float 2
%OuterS = OpTypeStruct %mat2v4float
%_ptr_Function_OuterS = OpTypePointer Function %OuterS
%15 = OpConstantNull %OuterS
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%_ptr_Function_v4float = OpTypePointer Function %v4float
%float_1 = OpConstant %float 1
%23 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%_ptr_Function_float = OpTypePointer Function %float
%main = OpFunction %void None %5
%8 = OpLabel
%s1 = OpVariable %_ptr_Function_OuterS Function %15
%18 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%19 = OpLoad %uint %18
%21 = OpAccessChain %_ptr_Function_v4float %s1 %uint_0 %19
OpStore %21 %23
%24 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%25 = OpLoad %uint %24
%26 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%27 = OpLoad %uint %26
%29 = OpAccessChain %_ptr_Function_float %s1 %uint_0 %25 %27
OpStore %29 %float_1
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,16 @@
struct Uniforms {
i : u32;
}
struct OuterS {
m1 : mat2x4<f32>;
}
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var s1 : OuterS;
s1.m1[uniforms.i] = vec4<f32>(1.0);
s1.m1[uniforms.i][uniforms.i] = 1.0;
}

View File

@@ -0,0 +1,22 @@
struct Uniforms {
i : u32;
};
struct InnerS {
v : i32;
};
struct OuterS {
a1 : array<InnerS, 8>;
a2 : array<InnerS, 8>;
};
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
var s1 : OuterS;
s1.a1[uniforms.i] = v;
s1.a2[uniforms.i] = v;
}

View File

@@ -0,0 +1,31 @@
#version 310 es
struct Uniforms {
uint i;
};
struct InnerS {
int v;
};
struct OuterS {
InnerS a1[8];
InnerS a2[8];
};
layout(binding = 4) uniform Uniforms_1 {
uint i;
} uniforms;
void tint_symbol() {
InnerS v = InnerS(0);
OuterS s1 = OuterS(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0)), InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0)));
s1.a1[uniforms.i] = v;
s1.a2[uniforms.i] = v;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -0,0 +1,28 @@
struct InnerS {
int v;
};
struct OuterS {
InnerS a1[8];
InnerS a2[8];
};
cbuffer cbuffer_uniforms : register(b4, space1) {
uint4 uniforms[1];
};
[numthreads(1, 1, 1)]
void main() {
InnerS v = (InnerS)0;
OuterS s1 = (OuterS)0;
{
InnerS tint_symbol_1[8] = s1.a1;
tint_symbol_1[uniforms[0].x] = v;
s1.a1 = tint_symbol_1;
}
{
InnerS tint_symbol_3[8] = s1.a2;
tint_symbol_3[uniforms[0].x] = v;
s1.a2 = tint_symbol_3;
}
return;
}

View File

@@ -0,0 +1,28 @@
#include <metal_stdlib>
using namespace metal;
struct Uniforms {
/* 0x0000 */ uint i;
};
struct InnerS {
int v;
};
struct tint_array_wrapper {
InnerS arr[8];
};
struct OuterS {
tint_array_wrapper a1;
tint_array_wrapper a2;
};
kernel void tint_symbol(const constant Uniforms* tint_symbol_1 [[buffer(0)]]) {
InnerS v = {};
OuterS s1 = {};
s1.a1.arr[(*(tint_symbol_1)).i] = v;
s1.a2.arr[(*(tint_symbol_1)).i] = v;
return;
}

View File

@@ -0,0 +1,63 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 31
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpName %uniforms "uniforms"
OpName %main "main"
OpName %InnerS "InnerS"
OpMemberName %InnerS 0 "v"
OpName %v "v"
OpName %OuterS "OuterS"
OpMemberName %OuterS 0 "a1"
OpMemberName %OuterS 1 "a2"
OpName %s1 "s1"
OpDecorate %Uniforms Block
OpMemberDecorate %Uniforms 0 Offset 0
OpDecorate %uniforms NonWritable
OpDecorate %uniforms DescriptorSet 1
OpDecorate %uniforms Binding 4
OpMemberDecorate %InnerS 0 Offset 0
OpMemberDecorate %OuterS 0 Offset 0
OpDecorate %_arr_InnerS_uint_8 ArrayStride 4
OpMemberDecorate %OuterS 1 Offset 32
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%void = OpTypeVoid
%5 = OpTypeFunction %void
%int = OpTypeInt 32 1
%InnerS = OpTypeStruct %int
%_ptr_Function_InnerS = OpTypePointer Function %InnerS
%13 = OpConstantNull %InnerS
%uint_8 = OpConstant %uint 8
%_arr_InnerS_uint_8 = OpTypeArray %InnerS %uint_8
%OuterS = OpTypeStruct %_arr_InnerS_uint_8 %_arr_InnerS_uint_8
%_ptr_Function_OuterS = OpTypePointer Function %OuterS
%19 = OpConstantNull %OuterS
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%uint_1 = OpConstant %uint 1
%main = OpFunction %void None %5
%8 = OpLabel
%v = OpVariable %_ptr_Function_InnerS Function %13
%s1 = OpVariable %_ptr_Function_OuterS Function %19
%22 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%23 = OpLoad %uint %22
%24 = OpAccessChain %_ptr_Function_InnerS %s1 %uint_0 %23
%25 = OpLoad %InnerS %v
OpStore %24 %25
%27 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%28 = OpLoad %uint %27
%29 = OpAccessChain %_ptr_Function_InnerS %s1 %uint_1 %28
%30 = OpLoad %InnerS %v
OpStore %29 %30
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,22 @@
struct Uniforms {
i : u32;
}
struct InnerS {
v : i32;
}
struct OuterS {
a1 : array<InnerS, 8>;
a2 : array<InnerS, 8>;
}
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
var s1 : OuterS;
s1.a1[uniforms.i] = v;
s1.a2[uniforms.i] = v;
}

View File

@@ -0,0 +1,24 @@
struct Uniforms {
i : u32;
};
struct InnerS {
v : i32;
};
struct S1 {
a : array<InnerS, 8>;
};
struct OuterS {
s2 : S1;
};
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
var s1 : OuterS;
s1.s2.a[uniforms.i] = v;
}

View File

@@ -0,0 +1,33 @@
#version 310 es
struct Uniforms {
uint i;
};
struct InnerS {
int v;
};
struct S1 {
InnerS a[8];
};
struct OuterS {
S1 s2;
};
layout(binding = 4) uniform Uniforms_1 {
uint i;
} uniforms;
void tint_symbol() {
InnerS v = InnerS(0);
OuterS s1 = OuterS(S1(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0))));
s1.s2.a[uniforms.i] = v;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -0,0 +1,25 @@
struct InnerS {
int v;
};
struct S1 {
InnerS a[8];
};
struct OuterS {
S1 s2;
};
cbuffer cbuffer_uniforms : register(b4, space1) {
uint4 uniforms[1];
};
[numthreads(1, 1, 1)]
void main() {
InnerS v = (InnerS)0;
OuterS s1 = (OuterS)0;
{
InnerS tint_symbol_1[8] = s1.s2.a;
tint_symbol_1[uniforms[0].x] = v;
s1.s2.a = tint_symbol_1;
}
return;
}

View File

@@ -0,0 +1,30 @@
#include <metal_stdlib>
using namespace metal;
struct Uniforms {
/* 0x0000 */ uint i;
};
struct InnerS {
int v;
};
struct tint_array_wrapper {
InnerS arr[8];
};
struct S1 {
tint_array_wrapper a;
};
struct OuterS {
S1 s2;
};
kernel void tint_symbol(const constant Uniforms* tint_symbol_1 [[buffer(0)]]) {
InnerS v = {};
OuterS s1 = {};
s1.s2.a.arr[(*(tint_symbol_1)).i] = v;
return;
}

View File

@@ -0,0 +1,59 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 27
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpName %uniforms "uniforms"
OpName %main "main"
OpName %InnerS "InnerS"
OpMemberName %InnerS 0 "v"
OpName %v "v"
OpName %OuterS "OuterS"
OpMemberName %OuterS 0 "s2"
OpName %S1 "S1"
OpMemberName %S1 0 "a"
OpName %s1 "s1"
OpDecorate %Uniforms Block
OpMemberDecorate %Uniforms 0 Offset 0
OpDecorate %uniforms NonWritable
OpDecorate %uniforms DescriptorSet 1
OpDecorate %uniforms Binding 4
OpMemberDecorate %InnerS 0 Offset 0
OpMemberDecorate %OuterS 0 Offset 0
OpMemberDecorate %S1 0 Offset 0
OpDecorate %_arr_InnerS_uint_8 ArrayStride 4
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%void = OpTypeVoid
%5 = OpTypeFunction %void
%int = OpTypeInt 32 1
%InnerS = OpTypeStruct %int
%_ptr_Function_InnerS = OpTypePointer Function %InnerS
%13 = OpConstantNull %InnerS
%uint_8 = OpConstant %uint 8
%_arr_InnerS_uint_8 = OpTypeArray %InnerS %uint_8
%S1 = OpTypeStruct %_arr_InnerS_uint_8
%OuterS = OpTypeStruct %S1
%_ptr_Function_OuterS = OpTypePointer Function %OuterS
%20 = OpConstantNull %OuterS
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%main = OpFunction %void None %5
%8 = OpLabel
%v = OpVariable %_ptr_Function_InnerS Function %13
%s1 = OpVariable %_ptr_Function_OuterS Function %20
%23 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%24 = OpLoad %uint %23
%25 = OpAccessChain %_ptr_Function_InnerS %s1 %uint_0 %uint_0 %24
%26 = OpLoad %InnerS %v
OpStore %25 %26
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,24 @@
struct Uniforms {
i : u32;
}
struct InnerS {
v : i32;
}
struct S1 {
a : array<InnerS, 8>;
}
struct OuterS {
s2 : S1;
}
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
var s1 : OuterS;
s1.s2.a[uniforms.i] = v;
}

View File

@@ -0,0 +1,15 @@
struct Uniforms {
i : u32;
};
struct OuterS {
v1 : vec3<f32>;
};
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var s1 : OuterS;
s1.v1[uniforms.i] = 1.0;
}

View File

@@ -0,0 +1,24 @@
#version 310 es
struct Uniforms {
uint i;
};
struct OuterS {
vec3 v1;
};
layout(binding = 4) uniform Uniforms_1 {
uint i;
} uniforms;
void tint_symbol() {
OuterS s1 = OuterS(vec3(0.0f, 0.0f, 0.0f));
s1.v1[uniforms.i] = 1.0f;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -0,0 +1,18 @@
void set_float3(inout float3 vec, int idx, float val) {
vec = (idx.xxx == int3(0, 1, 2)) ? val.xxx : vec;
}
struct OuterS {
float3 v1;
};
cbuffer cbuffer_uniforms : register(b4, space1) {
uint4 uniforms[1];
};
[numthreads(1, 1, 1)]
void main() {
OuterS s1 = (OuterS)0;
set_float3(s1.v1, uniforms[0].x, 1.0f);
return;
}

View File

@@ -0,0 +1,17 @@
#include <metal_stdlib>
using namespace metal;
struct Uniforms {
/* 0x0000 */ uint i;
};
struct OuterS {
float3 v1;
};
kernel void tint_symbol(const constant Uniforms* tint_symbol_1 [[buffer(0)]]) {
OuterS s1 = {};
s1.v1[(*(tint_symbol_1)).i] = 1.0f;
return;
}

View File

@@ -0,0 +1,46 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 22
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpName %uniforms "uniforms"
OpName %main "main"
OpName %OuterS "OuterS"
OpMemberName %OuterS 0 "v1"
OpName %s1 "s1"
OpDecorate %Uniforms Block
OpMemberDecorate %Uniforms 0 Offset 0
OpDecorate %uniforms NonWritable
OpDecorate %uniforms DescriptorSet 1
OpDecorate %uniforms Binding 4
OpMemberDecorate %OuterS 0 Offset 0
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%void = OpTypeVoid
%5 = OpTypeFunction %void
%float = OpTypeFloat 32
%v3float = OpTypeVector %float 3
%OuterS = OpTypeStruct %v3float
%_ptr_Function_OuterS = OpTypePointer Function %OuterS
%14 = OpConstantNull %OuterS
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%_ptr_Function_float = OpTypePointer Function %float
%float_1 = OpConstant %float 1
%main = OpFunction %void None %5
%8 = OpLabel
%s1 = OpVariable %_ptr_Function_OuterS Function %14
%17 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%18 = OpLoad %uint %17
%20 = OpAccessChain %_ptr_Function_float %s1 %uint_0 %18
OpStore %20 %float_1
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,15 @@
struct Uniforms {
i : u32;
}
struct OuterS {
v1 : vec3<f32>;
}
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var s1 : OuterS;
s1.v1[uniforms.i] = 1.0;
}

View File

@@ -0,0 +1,21 @@
struct Uniforms {
i : u32;
};
struct OuterS {
a1 : array<u32, 8>;
};
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
fn f(i: u32) -> u32 {
return i + 1u;
}
@stage(compute) @workgroup_size(1)
fn main() {
var s1 : OuterS;
var v : vec3<f32>;
v[s1.a1[uniforms.i]] = 1.0;
v[f(s1.a1[uniforms.i])] = 1.0;
}

View File

@@ -0,0 +1,30 @@
#version 310 es
struct Uniforms {
uint i;
};
struct OuterS {
uint a1[8];
};
layout(binding = 4) uniform Uniforms_1 {
uint i;
} uniforms;
uint f(uint i) {
return (i + 1u);
}
void tint_symbol() {
OuterS s1 = OuterS(uint[8](0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u));
vec3 v = vec3(0.0f, 0.0f, 0.0f);
v[s1.a1[uniforms.i]] = 1.0f;
v[f(s1.a1[uniforms.i])] = 1.0f;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -0,0 +1,24 @@
void set_float3(inout float3 vec, int idx, float val) {
vec = (idx.xxx == int3(0, 1, 2)) ? val.xxx : vec;
}
struct OuterS {
uint a1[8];
};
cbuffer cbuffer_uniforms : register(b4, space1) {
uint4 uniforms[1];
};
uint f(uint i) {
return (i + 1u);
}
[numthreads(1, 1, 1)]
void main() {
OuterS s1 = (OuterS)0;
float3 v = float3(0.0f, 0.0f, 0.0f);
set_float3(v, s1.a1[uniforms[0].x], 1.0f);
set_float3(v, f(s1.a1[uniforms[0].x]), 1.0f);
return;
}

View File

@@ -0,0 +1,27 @@
#include <metal_stdlib>
using namespace metal;
struct Uniforms {
/* 0x0000 */ uint i;
};
struct tint_array_wrapper {
uint arr[8];
};
struct OuterS {
tint_array_wrapper a1;
};
uint f(uint i) {
return (i + 1u);
}
kernel void tint_symbol(const constant Uniforms* tint_symbol_1 [[buffer(0)]]) {
OuterS s1 = {};
float3 v = 0.0f;
v[s1.a1.arr[(*(tint_symbol_1)).i]] = 1.0f;
v[f(s1.a1.arr[(*(tint_symbol_1)).i])] = 1.0f;
return;
}

View File

@@ -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"
OpExecutionMode %main LocalSize 1 1 1
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpName %uniforms "uniforms"
OpName %f "f"
OpName %i "i"
OpName %main "main"
OpName %OuterS "OuterS"
OpMemberName %OuterS 0 "a1"
OpName %s1 "s1"
OpName %v "v"
OpDecorate %Uniforms Block
OpMemberDecorate %Uniforms 0 Offset 0
OpDecorate %uniforms NonWritable
OpDecorate %uniforms DescriptorSet 1
OpDecorate %uniforms Binding 4
OpMemberDecorate %OuterS 0 Offset 0
OpDecorate %_arr_uint_uint_8 ArrayStride 4
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%5 = OpTypeFunction %uint %uint
%uint_1 = OpConstant %uint 1
%void = OpTypeVoid
%11 = OpTypeFunction %void
%uint_8 = OpConstant %uint 8
%_arr_uint_uint_8 = OpTypeArray %uint %uint_8
%OuterS = OpTypeStruct %_arr_uint_uint_8
%_ptr_Function_OuterS = OpTypePointer Function %OuterS
%20 = OpConstantNull %OuterS
%float = OpTypeFloat 32
%v3float = OpTypeVector %float 3
%_ptr_Function_v3float = OpTypePointer Function %v3float
%25 = OpConstantNull %v3float
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%_ptr_Function_uint = OpTypePointer Function %uint
%_ptr_Function_float = OpTypePointer Function %float
%float_1 = OpConstant %float 1
%f = OpFunction %uint None %5
%i = OpFunctionParameter %uint
%8 = OpLabel
%10 = OpIAdd %uint %i %uint_1
OpReturnValue %10
OpFunctionEnd
%main = OpFunction %void None %11
%14 = OpLabel
%s1 = OpVariable %_ptr_Function_OuterS Function %20
%v = OpVariable %_ptr_Function_v3float Function %25
%28 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%29 = OpLoad %uint %28
%31 = OpAccessChain %_ptr_Function_uint %s1 %uint_0 %29
%32 = OpLoad %uint %31
%34 = OpAccessChain %_ptr_Function_float %v %32
OpStore %34 %float_1
%37 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%38 = OpLoad %uint %37
%39 = OpAccessChain %_ptr_Function_uint %s1 %uint_0 %38
%40 = OpLoad %uint %39
%36 = OpFunctionCall %uint %f %40
%41 = OpAccessChain %_ptr_Function_float %v %36
OpStore %41 %float_1
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,21 @@
struct Uniforms {
i : u32;
}
struct OuterS {
a1 : array<u32, 8>;
}
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
fn f(i : u32) -> u32 {
return (i + 1u);
}
@stage(compute) @workgroup_size(1)
fn main() {
var s1 : OuterS;
var v : vec3<f32>;
v[s1.a1[uniforms.i]] = 1.0;
v[f(s1.a1[uniforms.i])] = 1.0;
}

View File

@@ -0,0 +1,21 @@
struct Uniforms {
i : u32;
};
struct InnerS {
v : i32;
};
struct OuterS {
a1 : array<InnerS, 8>;
};
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
var s1 : OuterS;
let p = &(s1.a1[uniforms.i]);
*p = v;
}

View File

@@ -0,0 +1,30 @@
#version 310 es
struct Uniforms {
uint i;
};
struct InnerS {
int v;
};
struct OuterS {
InnerS a1[8];
};
layout(binding = 4) uniform Uniforms_1 {
uint i;
} uniforms;
void tint_symbol() {
InnerS v = InnerS(0);
OuterS s1 = OuterS(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0)));
uint p_save = uniforms.i;
s1.a1[p_save] = v;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -0,0 +1,23 @@
struct InnerS {
int v;
};
struct OuterS {
InnerS a1[8];
};
cbuffer cbuffer_uniforms : register(b4, space1) {
uint4 uniforms[1];
};
[numthreads(1, 1, 1)]
void main() {
InnerS v = (InnerS)0;
OuterS s1 = (OuterS)0;
const uint p_save = uniforms[0].x;
{
InnerS tint_symbol_1[8] = s1.a1;
tint_symbol_1[p_save] = v;
s1.a1 = tint_symbol_1;
}
return;
}

View File

@@ -0,0 +1,27 @@
#include <metal_stdlib>
using namespace metal;
struct Uniforms {
/* 0x0000 */ uint i;
};
struct InnerS {
int v;
};
struct tint_array_wrapper {
InnerS arr[8];
};
struct OuterS {
tint_array_wrapper a1;
};
kernel void tint_symbol(const constant Uniforms* tint_symbol_1 [[buffer(0)]]) {
InnerS v = {};
OuterS s1 = {};
uint const p_save = (*(tint_symbol_1)).i;
s1.a1.arr[p_save] = v;
return;
}

View File

@@ -0,0 +1,55 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 26
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %Uniforms "Uniforms"
OpMemberName %Uniforms 0 "i"
OpName %uniforms "uniforms"
OpName %main "main"
OpName %InnerS "InnerS"
OpMemberName %InnerS 0 "v"
OpName %v "v"
OpName %OuterS "OuterS"
OpMemberName %OuterS 0 "a1"
OpName %s1 "s1"
OpDecorate %Uniforms Block
OpMemberDecorate %Uniforms 0 Offset 0
OpDecorate %uniforms NonWritable
OpDecorate %uniforms DescriptorSet 1
OpDecorate %uniforms Binding 4
OpMemberDecorate %InnerS 0 Offset 0
OpMemberDecorate %OuterS 0 Offset 0
OpDecorate %_arr_InnerS_uint_8 ArrayStride 4
%uint = OpTypeInt 32 0
%Uniforms = OpTypeStruct %uint
%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
%void = OpTypeVoid
%5 = OpTypeFunction %void
%int = OpTypeInt 32 1
%InnerS = OpTypeStruct %int
%_ptr_Function_InnerS = OpTypePointer Function %InnerS
%13 = OpConstantNull %InnerS
%uint_8 = OpConstant %uint 8
%_arr_InnerS_uint_8 = OpTypeArray %InnerS %uint_8
%OuterS = OpTypeStruct %_arr_InnerS_uint_8
%_ptr_Function_OuterS = OpTypePointer Function %OuterS
%19 = OpConstantNull %OuterS
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%main = OpFunction %void None %5
%8 = OpLabel
%v = OpVariable %_ptr_Function_InnerS Function %13
%s1 = OpVariable %_ptr_Function_OuterS Function %19
%22 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%23 = OpLoad %uint %22
%24 = OpAccessChain %_ptr_Function_InnerS %s1 %uint_0 %23
%25 = OpLoad %InnerS %v
OpStore %24 %25
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,21 @@
struct Uniforms {
i : u32;
}
struct InnerS {
v : i32;
}
struct OuterS {
a1 : array<InnerS, 8>;
}
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
@stage(compute) @workgroup_size(1)
fn main() {
var v : InnerS;
var s1 : OuterS;
let p = &(s1.a1[uniforms.i]);
*(p) = v;
}

View File

@@ -0,0 +1,21 @@
struct Uniforms {
i : u32;
};
struct InnerS {
v : i32;
};
struct OuterS {
a1 : array<InnerS, 8>;
};
@group(1) @binding(4) var<uniform> uniforms : Uniforms;
fn f(p : ptr<function, OuterS>) {
var v : InnerS;
(*p).a1[uniforms.i] = v;
}
@stage(compute) @workgroup_size(1)
fn main() {
var s1 : OuterS;
f(&s1);
}

View File

@@ -0,0 +1,33 @@
#version 310 es
struct Uniforms {
uint i;
};
struct InnerS {
int v;
};
struct OuterS {
InnerS a1[8];
};
layout(binding = 4) uniform Uniforms_1 {
uint i;
} uniforms;
void f(inout OuterS p) {
InnerS v = InnerS(0);
p.a1[uniforms.i] = v;
}
void tint_symbol() {
OuterS s1 = OuterS(InnerS[8](InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0), InnerS(0)));
f(s1);
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -0,0 +1,26 @@
struct InnerS {
int v;
};
struct OuterS {
InnerS a1[8];
};
cbuffer cbuffer_uniforms : register(b4, space1) {
uint4 uniforms[1];
};
void f(inout OuterS p) {
InnerS v = (InnerS)0;
{
InnerS tint_symbol_1[8] = p.a1;
tint_symbol_1[uniforms[0].x] = v;
p.a1 = tint_symbol_1;
}
}
[numthreads(1, 1, 1)]
void main() {
OuterS s1 = (OuterS)0;
f(s1);
return;
}

View File

@@ -0,0 +1,30 @@
#include <metal_stdlib>
using namespace metal;
struct Uniforms {
/* 0x0000 */ uint i;
};
struct InnerS {
int v;
};
struct tint_array_wrapper {
InnerS arr[8];
};
struct OuterS {
tint_array_wrapper a1;
};
void f(thread OuterS* const p, const constant Uniforms* const tint_symbol_1) {
InnerS v = {};
(*(p)).a1.arr[(*(tint_symbol_1)).i] = v;
}
kernel void tint_symbol(const constant Uniforms* tint_symbol_2 [[buffer(0)]]) {
OuterS s1 = {};
f(&(s1), tint_symbol_2);
return;
}

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