mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 21:47:47 +00:00
tint/writer/msl: Generate an array<T,N> helper
And remove the WrapArraysInStructs transform. Wrapping arrays in structures becomes troublesome for `const` arrays, as currently WGSL does not allow `const` structures. MSL 2.0+ has a builtin array<> helper, but we're targetting MSL 1.2, so we have to emit our own. Fortunately, it can be done with a few lines of templated code. This produces significantly cleaner output. Change-Id: Ifc92ef21e09befa252a07c856c4b5afdc51cc2e4 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94540 Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ben Clayton <bclayton@chromium.org> Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
3c054304a8
commit
f47887d207
@@ -1,16 +1,25 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ int4 arr[4];
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
struct S {
|
||||
/* 0x0000 */ tint_array_wrapper arr;
|
||||
/* 0x0000 */ tint_array<int4, 4> arr;
|
||||
};
|
||||
|
||||
tint_array_wrapper ret_arr() {
|
||||
tint_array_wrapper const tint_symbol_1 = {.arr={}};
|
||||
tint_array<int4, 4> ret_arr() {
|
||||
tint_array<int4, 4> const tint_symbol_1 = tint_array<int4, 4>{};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
@@ -19,26 +28,14 @@ S ret_struct_arr() {
|
||||
return tint_symbol_2;
|
||||
}
|
||||
|
||||
struct tint_array_wrapper_3 {
|
||||
int arr[2];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_2 {
|
||||
tint_array_wrapper_3 arr[3];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_1 {
|
||||
tint_array_wrapper_2 arr[4];
|
||||
};
|
||||
|
||||
void foo(tint_array_wrapper src_param, thread tint_array_wrapper* const tint_symbol_4, threadgroup tint_array_wrapper* const tint_symbol_5, const constant S* const tint_symbol_6, device S* const tint_symbol_7) {
|
||||
tint_array_wrapper src_function = {};
|
||||
tint_array_wrapper dst = {};
|
||||
tint_array_wrapper const tint_symbol_3 = {.arr={int4(1), int4(2), int4(3), int4(3)}};
|
||||
void foo(tint_array<int4, 4> src_param, thread tint_array<int4, 4>* const tint_symbol_4, threadgroup tint_array<int4, 4>* const tint_symbol_5, const constant S* const tint_symbol_6, device S* const tint_symbol_7) {
|
||||
tint_array<int4, 4> src_function = {};
|
||||
tint_array<int4, 4> dst = {};
|
||||
tint_array<int4, 4> const tint_symbol_3 = tint_array<int4, 4>{int4(1), int4(2), int4(3), int4(3)};
|
||||
dst = tint_symbol_3;
|
||||
dst = src_param;
|
||||
dst = ret_arr();
|
||||
tint_array_wrapper const src_let = {.arr={}};
|
||||
tint_array<int4, 4> const src_let = tint_array<int4, 4>{};
|
||||
dst = src_let;
|
||||
dst = src_function;
|
||||
dst = *(tint_symbol_4);
|
||||
@@ -47,8 +44,8 @@ void foo(tint_array_wrapper src_param, thread tint_array_wrapper* const tint_sym
|
||||
dst = tint_symbol.arr;
|
||||
dst = (*(tint_symbol_6)).arr;
|
||||
dst = (*(tint_symbol_7)).arr;
|
||||
tint_array_wrapper_1 dst_nested = {};
|
||||
tint_array_wrapper_1 src_nested = {};
|
||||
tint_array<tint_array<tint_array<int, 2>, 3>, 4> dst_nested = {};
|
||||
tint_array<tint_array<tint_array<int, 2>, 3>, 4> src_nested = {};
|
||||
dst_nested = src_nested;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,28 +1,25 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ int4 arr[4];
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
struct S {
|
||||
/* 0x0000 */ tint_array_wrapper arr;
|
||||
/* 0x0000 */ tint_array<int4, 4> arr;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_3 {
|
||||
int arr[2];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_2 {
|
||||
tint_array_wrapper_3 arr[3];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_1 {
|
||||
tint_array_wrapper_2 arr[4];
|
||||
};
|
||||
|
||||
tint_array_wrapper ret_arr() {
|
||||
tint_array_wrapper const tint_symbol_1 = {.arr={}};
|
||||
tint_array<int4, 4> ret_arr() {
|
||||
tint_array<int4, 4> const tint_symbol_1 = tint_array<int4, 4>{};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
@@ -31,13 +28,13 @@ S ret_struct_arr() {
|
||||
return tint_symbol_2;
|
||||
}
|
||||
|
||||
void foo(tint_array_wrapper src_param, thread tint_array_wrapper* const tint_symbol_4, thread tint_array_wrapper* const tint_symbol_5, threadgroup tint_array_wrapper* const tint_symbol_6, const constant S* const tint_symbol_7, device S* const tint_symbol_8, thread tint_array_wrapper_1* const tint_symbol_9) {
|
||||
tint_array_wrapper src_function = {};
|
||||
tint_array_wrapper const tint_symbol_3 = {.arr={int4(1), int4(2), int4(3), int4(3)}};
|
||||
void foo(tint_array<int4, 4> src_param, thread tint_array<int4, 4>* const tint_symbol_4, thread tint_array<int4, 4>* const tint_symbol_5, threadgroup tint_array<int4, 4>* const tint_symbol_6, const constant S* const tint_symbol_7, device S* const tint_symbol_8, thread tint_array<tint_array<tint_array<int, 2>, 3>, 4>* const tint_symbol_9) {
|
||||
tint_array<int4, 4> src_function = {};
|
||||
tint_array<int4, 4> const tint_symbol_3 = tint_array<int4, 4>{int4(1), int4(2), int4(3), int4(3)};
|
||||
*(tint_symbol_4) = tint_symbol_3;
|
||||
*(tint_symbol_4) = src_param;
|
||||
*(tint_symbol_4) = ret_arr();
|
||||
tint_array_wrapper const src_let = {.arr={}};
|
||||
tint_array<int4, 4> const src_let = tint_array<int4, 4>{};
|
||||
*(tint_symbol_4) = src_let;
|
||||
*(tint_symbol_4) = src_function;
|
||||
*(tint_symbol_4) = *(tint_symbol_5);
|
||||
@@ -46,7 +43,7 @@ void foo(tint_array_wrapper src_param, thread tint_array_wrapper* const tint_sym
|
||||
*(tint_symbol_4) = tint_symbol.arr;
|
||||
*(tint_symbol_4) = (*(tint_symbol_7)).arr;
|
||||
*(tint_symbol_4) = (*(tint_symbol_8)).arr;
|
||||
tint_array_wrapper_1 src_nested = {};
|
||||
tint_array<tint_array<tint_array<int, 2>, 3>, 4> src_nested = {};
|
||||
*(tint_symbol_9) = src_nested;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,32 +1,29 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ int4 arr[4];
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
struct S {
|
||||
/* 0x0000 */ tint_array_wrapper arr;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_3 {
|
||||
/* 0x0000 */ int arr[2];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_2 {
|
||||
/* 0x0000 */ tint_array_wrapper_3 arr[3];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_1 {
|
||||
/* 0x0000 */ tint_array_wrapper_2 arr[4];
|
||||
/* 0x0000 */ tint_array<int4, 4> arr;
|
||||
};
|
||||
|
||||
struct S_nested {
|
||||
/* 0x0000 */ tint_array_wrapper_1 arr;
|
||||
/* 0x0000 */ tint_array<tint_array<tint_array<int, 2>, 3>, 4> arr;
|
||||
};
|
||||
|
||||
tint_array_wrapper ret_arr() {
|
||||
tint_array_wrapper const tint_symbol_2 = {.arr={}};
|
||||
tint_array<int4, 4> ret_arr() {
|
||||
tint_array<int4, 4> const tint_symbol_2 = tint_array<int4, 4>{};
|
||||
return tint_symbol_2;
|
||||
}
|
||||
|
||||
@@ -35,14 +32,14 @@ S ret_struct_arr() {
|
||||
return tint_symbol_3;
|
||||
}
|
||||
|
||||
void foo(tint_array_wrapper src_param, device S* const tint_symbol_5, thread tint_array_wrapper* const tint_symbol_6, threadgroup tint_array_wrapper* const tint_symbol_7, const constant S* const tint_symbol_8, device S* const tint_symbol_9, device S_nested* const tint_symbol_10) {
|
||||
tint_array_wrapper src_function = {};
|
||||
tint_array_wrapper const tint_symbol_4 = {.arr={int4(1), int4(2), int4(3), int4(3)}};
|
||||
void foo(tint_array<int4, 4> src_param, device S* const tint_symbol_5, thread tint_array<int4, 4>* const tint_symbol_6, threadgroup tint_array<int4, 4>* const tint_symbol_7, const constant S* const tint_symbol_8, device S* const tint_symbol_9, device S_nested* const tint_symbol_10) {
|
||||
tint_array<int4, 4> src_function = {};
|
||||
tint_array<int4, 4> const tint_symbol_4 = tint_array<int4, 4>{int4(1), int4(2), int4(3), int4(3)};
|
||||
(*(tint_symbol_5)).arr = tint_symbol_4;
|
||||
(*(tint_symbol_5)).arr = src_param;
|
||||
tint_array_wrapper const tint_symbol = ret_arr();
|
||||
tint_array<int4, 4> const tint_symbol = ret_arr();
|
||||
(*(tint_symbol_5)).arr = tint_symbol;
|
||||
tint_array_wrapper const src_let = {.arr={}};
|
||||
tint_array<int4, 4> const src_let = tint_array<int4, 4>{};
|
||||
(*(tint_symbol_5)).arr = src_let;
|
||||
(*(tint_symbol_5)).arr = src_function;
|
||||
(*(tint_symbol_5)).arr = *(tint_symbol_6);
|
||||
@@ -51,7 +48,7 @@ void foo(tint_array_wrapper src_param, device S* const tint_symbol_5, thread tin
|
||||
(*(tint_symbol_5)).arr = tint_symbol_1.arr;
|
||||
(*(tint_symbol_5)).arr = (*(tint_symbol_8)).arr;
|
||||
(*(tint_symbol_5)).arr = (*(tint_symbol_9)).arr;
|
||||
tint_array_wrapper_1 src_nested = {};
|
||||
tint_array<tint_array<tint_array<int, 2>, 3>, 4> src_nested = {};
|
||||
(*(tint_symbol_10)).arr = src_nested;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,27 +1,32 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
int arr[4];
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
struct S {
|
||||
tint_array_wrapper arr;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_1 {
|
||||
tint_array_wrapper arr[2];
|
||||
tint_array<int, 4> arr;
|
||||
};
|
||||
|
||||
void foo() {
|
||||
tint_array_wrapper const src = {.arr={}};
|
||||
tint_array_wrapper dst = {};
|
||||
tint_array<int, 4> const src = tint_array<int, 4>{};
|
||||
tint_array<int, 4> dst = {};
|
||||
S dst_struct = {};
|
||||
tint_array_wrapper_1 dst_array = {};
|
||||
tint_array<tint_array<int, 4>, 2> dst_array = {};
|
||||
dst_struct.arr = src;
|
||||
dst_array.arr[1] = src;
|
||||
dst_array[1] = src;
|
||||
dst = src;
|
||||
dst_struct.arr = src;
|
||||
dst_array.arr[0] = src;
|
||||
dst_array[0] = src;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,28 +1,25 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ int4 arr[4];
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
struct S {
|
||||
/* 0x0000 */ tint_array_wrapper arr;
|
||||
/* 0x0000 */ tint_array<int4, 4> arr;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_3 {
|
||||
int arr[2];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_2 {
|
||||
tint_array_wrapper_3 arr[3];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_1 {
|
||||
tint_array_wrapper_2 arr[4];
|
||||
};
|
||||
|
||||
tint_array_wrapper ret_arr() {
|
||||
tint_array_wrapper const tint_symbol_1 = {.arr={}};
|
||||
tint_array<int4, 4> ret_arr() {
|
||||
tint_array<int4, 4> const tint_symbol_1 = tint_array<int4, 4>{};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
@@ -31,13 +28,13 @@ S ret_struct_arr() {
|
||||
return tint_symbol_2;
|
||||
}
|
||||
|
||||
void foo(tint_array_wrapper src_param, threadgroup tint_array_wrapper* const tint_symbol_4, thread tint_array_wrapper* const tint_symbol_5, threadgroup tint_array_wrapper* const tint_symbol_6, const constant S* const tint_symbol_7, device S* const tint_symbol_8, threadgroup tint_array_wrapper_1* const tint_symbol_9) {
|
||||
tint_array_wrapper src_function = {};
|
||||
tint_array_wrapper const tint_symbol_3 = {.arr={int4(1), int4(2), int4(3), int4(3)}};
|
||||
void foo(tint_array<int4, 4> src_param, threadgroup tint_array<int4, 4>* const tint_symbol_4, thread tint_array<int4, 4>* const tint_symbol_5, threadgroup tint_array<int4, 4>* const tint_symbol_6, const constant S* const tint_symbol_7, device S* const tint_symbol_8, threadgroup tint_array<tint_array<tint_array<int, 2>, 3>, 4>* const tint_symbol_9) {
|
||||
tint_array<int4, 4> src_function = {};
|
||||
tint_array<int4, 4> const tint_symbol_3 = tint_array<int4, 4>{int4(1), int4(2), int4(3), int4(3)};
|
||||
*(tint_symbol_4) = tint_symbol_3;
|
||||
*(tint_symbol_4) = src_param;
|
||||
*(tint_symbol_4) = ret_arr();
|
||||
tint_array_wrapper const src_let = {.arr={}};
|
||||
tint_array<int4, 4> const src_let = tint_array<int4, 4>{};
|
||||
*(tint_symbol_4) = src_let;
|
||||
*(tint_symbol_4) = src_function;
|
||||
*(tint_symbol_4) = *(tint_symbol_5);
|
||||
@@ -46,7 +43,7 @@ void foo(tint_array_wrapper src_param, threadgroup tint_array_wrapper* const tin
|
||||
*(tint_symbol_4) = tint_symbol.arr;
|
||||
*(tint_symbol_4) = (*(tint_symbol_7)).arr;
|
||||
*(tint_symbol_4) = (*(tint_symbol_8)).arr;
|
||||
tint_array_wrapper_1 src_nested = {};
|
||||
tint_array<tint_array<tint_array<int, 2>, 3>, 4> src_nested = {};
|
||||
*(tint_symbol_9) = src_nested;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,34 +1,35 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
float arr[4];
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
float f1(tint_array_wrapper a) {
|
||||
return a.arr[3];
|
||||
float f1(tint_array<float, 4> a) {
|
||||
return a[3];
|
||||
}
|
||||
|
||||
struct tint_array_wrapper_1 {
|
||||
tint_array_wrapper arr[3];
|
||||
};
|
||||
|
||||
float f2(tint_array_wrapper_1 a) {
|
||||
return a.arr[2].arr[3];
|
||||
float f2(tint_array<tint_array<float, 4>, 3> a) {
|
||||
return a[2][3];
|
||||
}
|
||||
|
||||
struct tint_array_wrapper_2 {
|
||||
tint_array_wrapper_1 arr[2];
|
||||
};
|
||||
|
||||
float f3(tint_array_wrapper_2 a) {
|
||||
return a.arr[1].arr[2].arr[3];
|
||||
float f3(tint_array<tint_array<tint_array<float, 4>, 3>, 2> a) {
|
||||
return a[1][2][3];
|
||||
}
|
||||
|
||||
kernel void tint_symbol() {
|
||||
tint_array_wrapper const a1 = {.arr={}};
|
||||
tint_array_wrapper_1 const a2 = {.arr={}};
|
||||
tint_array_wrapper_2 const a3 = {.arr={}};
|
||||
tint_array<float, 4> const a1 = tint_array<float, 4>{};
|
||||
tint_array<tint_array<float, 4>, 3> const a2 = tint_array<tint_array<float, 4>, 3>{};
|
||||
tint_array<tint_array<tint_array<float, 4>, 3>, 2> const a3 = tint_array<tint_array<tint_array<float, 4>, 3>, 2>{};
|
||||
float const v1 = f1(a1);
|
||||
float const v2 = f2(a2);
|
||||
float const v3 = f3(a3);
|
||||
|
||||
@@ -1,42 +1,43 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
float arr[4];
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
tint_array_wrapper f1() {
|
||||
tint_array_wrapper const tint_symbol_6 = {.arr={}};
|
||||
tint_array<float, 4> f1() {
|
||||
tint_array<float, 4> const tint_symbol_6 = tint_array<float, 4>{};
|
||||
return tint_symbol_6;
|
||||
}
|
||||
|
||||
struct tint_array_wrapper_1 {
|
||||
tint_array_wrapper arr[3];
|
||||
};
|
||||
|
||||
tint_array_wrapper_1 f2() {
|
||||
tint_array_wrapper const tint_symbol_1 = f1();
|
||||
tint_array_wrapper const tint_symbol_2 = f1();
|
||||
tint_array_wrapper const tint_symbol_3 = f1();
|
||||
tint_array_wrapper_1 const tint_symbol_7 = {.arr={tint_symbol_1, tint_symbol_2, tint_symbol_3}};
|
||||
tint_array<tint_array<float, 4>, 3> f2() {
|
||||
tint_array<float, 4> const tint_symbol_1 = f1();
|
||||
tint_array<float, 4> const tint_symbol_2 = f1();
|
||||
tint_array<float, 4> const tint_symbol_3 = f1();
|
||||
tint_array<tint_array<float, 4>, 3> const tint_symbol_7 = tint_array<tint_array<float, 4>, 3>{tint_symbol_1, tint_symbol_2, tint_symbol_3};
|
||||
return tint_symbol_7;
|
||||
}
|
||||
|
||||
struct tint_array_wrapper_2 {
|
||||
tint_array_wrapper_1 arr[2];
|
||||
};
|
||||
|
||||
tint_array_wrapper_2 f3() {
|
||||
tint_array_wrapper_1 const tint_symbol_4 = f2();
|
||||
tint_array_wrapper_1 const tint_symbol_5 = f2();
|
||||
tint_array_wrapper_2 const tint_symbol_8 = {.arr={tint_symbol_4, tint_symbol_5}};
|
||||
tint_array<tint_array<tint_array<float, 4>, 3>, 2> f3() {
|
||||
tint_array<tint_array<float, 4>, 3> const tint_symbol_4 = f2();
|
||||
tint_array<tint_array<float, 4>, 3> const tint_symbol_5 = f2();
|
||||
tint_array<tint_array<tint_array<float, 4>, 3>, 2> const tint_symbol_8 = tint_array<tint_array<tint_array<float, 4>, 3>, 2>{tint_symbol_4, tint_symbol_5};
|
||||
return tint_symbol_8;
|
||||
}
|
||||
|
||||
kernel void tint_symbol() {
|
||||
tint_array_wrapper const a1 = f1();
|
||||
tint_array_wrapper_1 const a2 = f2();
|
||||
tint_array_wrapper_2 const a3 = f3();
|
||||
tint_array<float, 4> const a1 = f1();
|
||||
tint_array<tint_array<float, 4>, 3> const a2 = f2();
|
||||
tint_array<tint_array<tint_array<float, 4>, 3>, 2> const a3 = f3();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,28 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
constant int slen = 4;
|
||||
|
||||
constant uint ulen = 4u;
|
||||
|
||||
struct tint_array_wrapper {
|
||||
float arr[4];
|
||||
};
|
||||
|
||||
fragment void tint_symbol() {
|
||||
tint_array_wrapper signed_literal = {};
|
||||
tint_array_wrapper unsigned_literal = {};
|
||||
tint_array_wrapper signed_constant = {};
|
||||
tint_array_wrapper unsigned_constant = {};
|
||||
tint_array<float, 4> signed_literal = {};
|
||||
tint_array<float, 4> unsigned_literal = {};
|
||||
tint_array<float, 4> signed_constant = {};
|
||||
tint_array<float, 4> unsigned_constant = {};
|
||||
signed_literal = unsigned_constant;
|
||||
signed_constant = unsigned_literal;
|
||||
return;
|
||||
|
||||
@@ -1,40 +1,41 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct strided_arr {
|
||||
/* 0x0000 */ float el;
|
||||
/* 0x0004 */ int8_t tint_pad[4];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ strided_arr arr[2];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_1 {
|
||||
/* 0x0000 */ tint_array_wrapper arr[3];
|
||||
/* 0x0004 */ tint_array<int8_t, 4> tint_pad;
|
||||
};
|
||||
|
||||
struct strided_arr_1 {
|
||||
/* 0x0000 */ tint_array_wrapper_1 el;
|
||||
/* 0x0030 */ int8_t tint_pad_1[80];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_2 {
|
||||
/* 0x0000 */ strided_arr_1 arr[4];
|
||||
/* 0x0000 */ tint_array<tint_array<strided_arr, 2>, 3> el;
|
||||
/* 0x0030 */ tint_array<int8_t, 80> tint_pad_1;
|
||||
};
|
||||
|
||||
struct S {
|
||||
/* 0x0000 */ tint_array_wrapper_2 a;
|
||||
/* 0x0000 */ tint_array<strided_arr_1, 4> a;
|
||||
};
|
||||
|
||||
void f_1(device S* const tint_symbol_1) {
|
||||
tint_array_wrapper_2 const x_19 = (*(tint_symbol_1)).a;
|
||||
tint_array_wrapper_1 const x_24 = (*(tint_symbol_1)).a.arr[3].el;
|
||||
tint_array_wrapper const x_28 = (*(tint_symbol_1)).a.arr[3].el.arr[2];
|
||||
float const x_32 = (*(tint_symbol_1)).a.arr[3].el.arr[2].arr[1].el;
|
||||
tint_array_wrapper_2 const tint_symbol = {.arr={}};
|
||||
tint_array<strided_arr_1, 4> const x_19 = (*(tint_symbol_1)).a;
|
||||
tint_array<tint_array<strided_arr, 2>, 3> const x_24 = (*(tint_symbol_1)).a[3].el;
|
||||
tint_array<strided_arr, 2> const x_28 = (*(tint_symbol_1)).a[3].el[2];
|
||||
float const x_32 = (*(tint_symbol_1)).a[3].el[2][1].el;
|
||||
tint_array<strided_arr_1, 4> const tint_symbol = tint_array<strided_arr_1, 4>{};
|
||||
(*(tint_symbol_1)).a = tint_symbol;
|
||||
(*(tint_symbol_1)).a.arr[3].el.arr[2].arr[1].el = 5.0f;
|
||||
(*(tint_symbol_1)).a[3].el[2][1].el = 5.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,56 +1,53 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
int arr[4];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_2 {
|
||||
tint_array_wrapper arr[3];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_1 {
|
||||
tint_array_wrapper_2 arr[2];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_3 {
|
||||
tint_array_wrapper arr[2];
|
||||
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];
|
||||
};
|
||||
|
||||
kernel void tint_symbol() {
|
||||
int const x = 42;
|
||||
tint_array_wrapper const empty = {.arr={}};
|
||||
tint_array_wrapper const nonempty = {.arr={1, 2, 3, 4}};
|
||||
tint_array_wrapper const nonempty_with_expr = {.arr={1, 42, as_type<int>((as_type<uint>(42) + as_type<uint>(1))), nonempty.arr[3]}};
|
||||
tint_array_wrapper_1 const nested_empty = {.arr={}};
|
||||
tint_array_wrapper const tint_symbol_1 = {.arr={1, 2, 3, 4}};
|
||||
tint_array_wrapper const tint_symbol_2 = {.arr={5, 6, 7, 8}};
|
||||
tint_array_wrapper const tint_symbol_3 = {.arr={9, 10, 11, 12}};
|
||||
tint_array_wrapper_2 const tint_symbol_4 = {.arr={tint_symbol_1, tint_symbol_2, tint_symbol_3}};
|
||||
tint_array_wrapper const tint_symbol_5 = {.arr={13, 14, 15, 16}};
|
||||
tint_array_wrapper const tint_symbol_6 = {.arr={17, 18, 19, 20}};
|
||||
tint_array_wrapper const tint_symbol_7 = {.arr={21, 22, 23, 24}};
|
||||
tint_array_wrapper_2 const tint_symbol_8 = {.arr={tint_symbol_5, tint_symbol_6, tint_symbol_7}};
|
||||
tint_array_wrapper_1 const nested_nonempty = {.arr={tint_symbol_4, tint_symbol_8}};
|
||||
tint_array_wrapper const tint_symbol_9 = {.arr={1, 2, 42, as_type<int>((as_type<uint>(42) + as_type<uint>(1)))}};
|
||||
tint_array_wrapper const tint_symbol_10 = {.arr={5, 6, nonempty.arr[2], as_type<int>((as_type<uint>(nonempty.arr[3]) + as_type<uint>(1)))}};
|
||||
tint_array_wrapper_2 const tint_symbol_11 = {.arr={tint_symbol_9, tint_symbol_10, nonempty}};
|
||||
tint_array_wrapper_1 const nested_nonempty_with_expr = {.arr={tint_symbol_11, nested_nonempty.arr[1]}};
|
||||
tint_array_wrapper const tint_symbol_12 = {.arr={}};
|
||||
int const subexpr_empty = tint_symbol_12.arr[1];
|
||||
tint_array_wrapper const tint_symbol_13 = {.arr={1, 2, 3, 4}};
|
||||
int const subexpr_nonempty = tint_symbol_13.arr[2];
|
||||
tint_array_wrapper const tint_symbol_14 = {.arr={1, 42, as_type<int>((as_type<uint>(42) + as_type<uint>(1))), nonempty.arr[3]}};
|
||||
int const subexpr_nonempty_with_expr = tint_symbol_14.arr[2];
|
||||
tint_array_wrapper_3 const tint_symbol_15 = {.arr={}};
|
||||
tint_array_wrapper const subexpr_nested_empty = tint_symbol_15.arr[1];
|
||||
tint_array_wrapper const tint_symbol_16 = {.arr={1, 2, 3, 4}};
|
||||
tint_array_wrapper const tint_symbol_17 = {.arr={5, 6, 7, 8}};
|
||||
tint_array_wrapper_3 const tint_symbol_18 = {.arr={tint_symbol_16, tint_symbol_17}};
|
||||
tint_array_wrapper const subexpr_nested_nonempty = tint_symbol_18.arr[1];
|
||||
tint_array_wrapper const tint_symbol_19 = {.arr={1, 42, as_type<int>((as_type<uint>(42) + as_type<uint>(1))), nonempty.arr[3]}};
|
||||
tint_array_wrapper_3 const tint_symbol_20 = {.arr={tint_symbol_19, nested_nonempty.arr[1].arr[2]}};
|
||||
tint_array_wrapper const subexpr_nested_nonempty_with_expr = tint_symbol_20.arr[1];
|
||||
tint_array<int, 4> const empty = tint_array<int, 4>{};
|
||||
tint_array<int, 4> const nonempty = tint_array<int, 4>{1, 2, 3, 4};
|
||||
tint_array<int, 4> const nonempty_with_expr = tint_array<int, 4>{1, 42, as_type<int>((as_type<uint>(42) + as_type<uint>(1))), 4};
|
||||
tint_array<tint_array<tint_array<int, 4>, 3>, 2> const nested_empty = tint_array<tint_array<tint_array<int, 4>, 3>, 2>{};
|
||||
tint_array<int, 4> const tint_symbol_1 = tint_array<int, 4>{1, 2, 3, 4};
|
||||
tint_array<int, 4> const tint_symbol_2 = tint_array<int, 4>{5, 6, 7, 8};
|
||||
tint_array<int, 4> const tint_symbol_3 = tint_array<int, 4>{9, 10, 11, 12};
|
||||
tint_array<tint_array<int, 4>, 3> const tint_symbol_4 = tint_array<tint_array<int, 4>, 3>{tint_symbol_1, tint_symbol_2, tint_symbol_3};
|
||||
tint_array<int, 4> const tint_symbol_5 = tint_array<int, 4>{13, 14, 15, 16};
|
||||
tint_array<int, 4> const tint_symbol_6 = tint_array<int, 4>{17, 18, 19, 20};
|
||||
tint_array<int, 4> const tint_symbol_7 = tint_array<int, 4>{21, 22, 23, 24};
|
||||
tint_array<tint_array<int, 4>, 3> const tint_symbol_8 = tint_array<tint_array<int, 4>, 3>{tint_symbol_5, tint_symbol_6, tint_symbol_7};
|
||||
tint_array<tint_array<tint_array<int, 4>, 3>, 2> const nested_nonempty = tint_array<tint_array<tint_array<int, 4>, 3>, 2>{tint_symbol_4, tint_symbol_8};
|
||||
tint_array<int, 4> const tint_symbol_9 = tint_array<int, 4>{1, 2, 42, as_type<int>((as_type<uint>(42) + as_type<uint>(1)))};
|
||||
tint_array<int, 4> const tint_symbol_10 = tint_array<int, 4>{5, 6, 3, as_type<int>((as_type<uint>(4) + as_type<uint>(1)))};
|
||||
tint_array<tint_array<int, 4>, 3> const tint_symbol_11 = tint_array<tint_array<int, 4>, 3>{tint_symbol_9, tint_symbol_10, nonempty};
|
||||
tint_array<tint_array<tint_array<int, 4>, 3>, 2> const nested_nonempty_with_expr = tint_array<tint_array<tint_array<int, 4>, 3>, 2>{tint_symbol_11, nested_nonempty[1]};
|
||||
tint_array<int, 4> const tint_symbol_12 = tint_array<int, 4>{};
|
||||
int const subexpr_empty = 0;
|
||||
tint_array<int, 4> const tint_symbol_13 = tint_array<int, 4>{1, 2, 3, 4};
|
||||
int const subexpr_nonempty = 3;
|
||||
tint_array<int, 4> const tint_symbol_14 = tint_array<int, 4>{1, 42, as_type<int>((as_type<uint>(42) + as_type<uint>(1))), 4};
|
||||
int const subexpr_nonempty_with_expr = tint_symbol_14[2];
|
||||
tint_array<tint_array<int, 4>, 2> const tint_symbol_15 = tint_array<tint_array<int, 4>, 2>{};
|
||||
tint_array<int, 4> const subexpr_nested_empty = tint_symbol_15[1];
|
||||
tint_array<int, 4> const tint_symbol_16 = tint_array<int, 4>{1, 2, 3, 4};
|
||||
tint_array<int, 4> const tint_symbol_17 = tint_array<int, 4>{5, 6, 7, 8};
|
||||
tint_array<tint_array<int, 4>, 2> const tint_symbol_18 = tint_array<tint_array<int, 4>, 2>{tint_symbol_16, tint_symbol_17};
|
||||
tint_array<int, 4> const subexpr_nested_nonempty = tint_symbol_18[1];
|
||||
tint_array<int, 4> const tint_symbol_19 = tint_array<int, 4>{1, 42, as_type<int>((as_type<uint>(42) + as_type<uint>(1))), 4};
|
||||
tint_array<tint_array<int, 4>, 2> const tint_symbol_20 = tint_array<tint_array<int, 4>, 2>{tint_symbol_19, nested_nonempty[1][2]};
|
||||
tint_array<int, 4> const subexpr_nested_nonempty_with_expr = tint_symbol_20[1];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,8 +12,16 @@ inline vec<T, N> operator*(packed_vec<T, M> lhs, matrix<T, N, M> rhs) {
|
||||
return vec<T, M>(lhs) * rhs;
|
||||
}
|
||||
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ int4 arr[4];
|
||||
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];
|
||||
};
|
||||
|
||||
struct Inner {
|
||||
@@ -25,12 +33,12 @@ struct Inner {
|
||||
/* 0x002c */ float f;
|
||||
/* 0x0030 */ float2x3 g;
|
||||
/* 0x0050 */ float3x2 h;
|
||||
/* 0x0068 */ int8_t tint_pad[8];
|
||||
/* 0x0070 */ tint_array_wrapper i;
|
||||
/* 0x0068 */ tint_array<int8_t, 8> tint_pad;
|
||||
/* 0x0070 */ tint_array<int4, 4> i;
|
||||
};
|
||||
|
||||
struct S {
|
||||
/* 0x0000 */ Inner arr[1];
|
||||
/* 0x0000 */ tint_array<Inner, 1> arr;
|
||||
};
|
||||
|
||||
void tint_symbol_inner(uint idx, const device S* const tint_symbol_1) {
|
||||
@@ -42,7 +50,7 @@ void tint_symbol_inner(uint idx, const device S* const tint_symbol_1) {
|
||||
float const f = (*(tint_symbol_1)).arr[idx].f;
|
||||
float2x3 const g = (*(tint_symbol_1)).arr[idx].g;
|
||||
float3x2 const h = (*(tint_symbol_1)).arr[idx].h;
|
||||
tint_array_wrapper const i = (*(tint_symbol_1)).arr[idx].i;
|
||||
tint_array<int4, 4> const i = (*(tint_symbol_1)).arr[idx].i;
|
||||
}
|
||||
|
||||
kernel void tint_symbol(const device S* tint_symbol_2 [[buffer(0)]], uint idx [[thread_index_in_threadgroup]]) {
|
||||
|
||||
@@ -12,8 +12,16 @@ inline vec<T, N> operator*(packed_vec<T, M> lhs, matrix<T, N, M> rhs) {
|
||||
return vec<T, M>(lhs) * rhs;
|
||||
}
|
||||
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ int4 arr[4];
|
||||
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];
|
||||
};
|
||||
|
||||
struct Inner {
|
||||
@@ -25,12 +33,12 @@ struct Inner {
|
||||
/* 0x002c */ float f;
|
||||
/* 0x0030 */ float2x3 g;
|
||||
/* 0x0050 */ float3x2 h;
|
||||
/* 0x0068 */ int8_t tint_pad[8];
|
||||
/* 0x0070 */ tint_array_wrapper i;
|
||||
/* 0x0068 */ tint_array<int8_t, 8> tint_pad;
|
||||
/* 0x0070 */ tint_array<int4, 4> i;
|
||||
};
|
||||
|
||||
struct S {
|
||||
/* 0x0000 */ Inner arr[1];
|
||||
/* 0x0000 */ tint_array<Inner, 1> arr;
|
||||
};
|
||||
|
||||
void tint_symbol_inner(uint idx, device S* const tint_symbol_2) {
|
||||
@@ -42,7 +50,7 @@ void tint_symbol_inner(uint idx, device S* const tint_symbol_2) {
|
||||
(*(tint_symbol_2)).arr[idx].f = 0.0f;
|
||||
(*(tint_symbol_2)).arr[idx].g = float2x3(float3(0.0f), float3(0.0f));
|
||||
(*(tint_symbol_2)).arr[idx].h = float3x2(float2(0.0f), float2(0.0f), float2(0.0f));
|
||||
tint_array_wrapper const tint_symbol_1 = {.arr={}};
|
||||
tint_array<int4, 4> const tint_symbol_1 = tint_array<int4, 4>{};
|
||||
(*(tint_symbol_2)).arr[idx].i = tint_symbol_1;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,12 +12,20 @@ inline vec<T, N> operator*(packed_vec<T, M> lhs, matrix<T, N, M> rhs) {
|
||||
return vec<T, M>(lhs) * rhs;
|
||||
}
|
||||
|
||||
struct Inner {
|
||||
/* 0x0000 */ int x;
|
||||
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];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ Inner arr[4];
|
||||
struct Inner {
|
||||
/* 0x0000 */ int x;
|
||||
};
|
||||
|
||||
struct S {
|
||||
@@ -30,8 +38,8 @@ struct S {
|
||||
/* 0x0030 */ float2x3 g;
|
||||
/* 0x0050 */ float3x2 h;
|
||||
/* 0x0068 */ Inner i;
|
||||
/* 0x006c */ tint_array_wrapper j;
|
||||
/* 0x007c */ int8_t tint_pad[4];
|
||||
/* 0x006c */ tint_array<Inner, 4> j;
|
||||
/* 0x007c */ tint_array<int8_t, 4> tint_pad;
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const device S* tint_symbol_1 [[buffer(0)]]) {
|
||||
@@ -44,7 +52,7 @@ kernel void tint_symbol(const device S* tint_symbol_1 [[buffer(0)]]) {
|
||||
float2x3 const g = (*(tint_symbol_1)).g;
|
||||
float3x2 const h = (*(tint_symbol_1)).h;
|
||||
Inner const i = (*(tint_symbol_1)).i;
|
||||
tint_array_wrapper const j = (*(tint_symbol_1)).j;
|
||||
tint_array<Inner, 4> const j = (*(tint_symbol_1)).j;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,12 +12,20 @@ inline vec<T, N> operator*(packed_vec<T, M> lhs, matrix<T, N, M> rhs) {
|
||||
return vec<T, M>(lhs) * rhs;
|
||||
}
|
||||
|
||||
struct Inner {
|
||||
/* 0x0000 */ int x;
|
||||
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];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ Inner arr[4];
|
||||
struct Inner {
|
||||
/* 0x0000 */ int x;
|
||||
};
|
||||
|
||||
struct S {
|
||||
@@ -30,8 +38,8 @@ struct S {
|
||||
/* 0x0030 */ float2x3 g;
|
||||
/* 0x0050 */ float3x2 h;
|
||||
/* 0x0068 */ Inner i;
|
||||
/* 0x006c */ tint_array_wrapper j;
|
||||
/* 0x007c */ int8_t tint_pad[4];
|
||||
/* 0x006c */ tint_array<Inner, 4> j;
|
||||
/* 0x007c */ tint_array<int8_t, 4> tint_pad;
|
||||
};
|
||||
|
||||
kernel void tint_symbol(device S* tint_symbol_3 [[buffer(0)]]) {
|
||||
@@ -45,7 +53,7 @@ kernel void tint_symbol(device S* tint_symbol_3 [[buffer(0)]]) {
|
||||
(*(tint_symbol_3)).h = float3x2(float2(0.0f), float2(0.0f), float2(0.0f));
|
||||
Inner const tint_symbol_1 = {};
|
||||
(*(tint_symbol_3)).i = tint_symbol_1;
|
||||
tint_array_wrapper const tint_symbol_2 = {.arr={}};
|
||||
tint_array<Inner, 4> const tint_symbol_2 = tint_array<Inner, 4>{};
|
||||
(*(tint_symbol_3)).j = tint_symbol_2;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ float arr[4];
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
kernel void tint_symbol(device tint_array_wrapper* tint_symbol_1 [[buffer(0)]], const device tint_array_wrapper* tint_symbol_2 [[buffer(1)]]) {
|
||||
kernel void tint_symbol(device tint_array<float, 4>* tint_symbol_1 [[buffer(0)]], const device tint_array<float, 4>* tint_symbol_2 [[buffer(1)]]) {
|
||||
*(tint_symbol_1) = *(tint_symbol_2);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,16 +1,29 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct S {
|
||||
/* 0x0000 */ float f;
|
||||
};
|
||||
|
||||
struct tint_symbol_2 {
|
||||
/* 0x0000 */ S arr[1];
|
||||
/* 0x0000 */ tint_array<S, 1> arr;
|
||||
};
|
||||
|
||||
struct tint_symbol_4 {
|
||||
/* 0x0000 */ S arr[1];
|
||||
/* 0x0000 */ tint_array<S, 1> arr;
|
||||
};
|
||||
|
||||
kernel void tint_symbol(device tint_symbol_2* tint_symbol_1 [[buffer(0)]], const device tint_symbol_4* tint_symbol_3 [[buffer(1)]]) {
|
||||
|
||||
@@ -12,8 +12,16 @@ inline vec<T, N> operator*(packed_vec<T, M> lhs, matrix<T, N, M> rhs) {
|
||||
return vec<T, M>(lhs) * rhs;
|
||||
}
|
||||
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ int4 arr[4];
|
||||
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];
|
||||
};
|
||||
|
||||
struct Inner {
|
||||
@@ -27,30 +35,26 @@ struct Inner {
|
||||
/* 0x0038 */ int2 h;
|
||||
/* 0x0040 */ float2x3 i;
|
||||
/* 0x0060 */ float3x2 j;
|
||||
/* 0x0078 */ int8_t tint_pad[8];
|
||||
/* 0x0080 */ tint_array_wrapper k;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_1 {
|
||||
/* 0x0000 */ Inner arr[8];
|
||||
/* 0x0078 */ tint_array<int8_t, 8> tint_pad;
|
||||
/* 0x0080 */ tint_array<int4, 4> k;
|
||||
};
|
||||
|
||||
struct S {
|
||||
/* 0x0000 */ tint_array_wrapper_1 arr;
|
||||
/* 0x0000 */ tint_array<Inner, 8> arr;
|
||||
};
|
||||
|
||||
void tint_symbol_inner(uint idx, const constant S* const tint_symbol_1) {
|
||||
int3 const a = (*(tint_symbol_1)).arr.arr[idx].a;
|
||||
int const b = (*(tint_symbol_1)).arr.arr[idx].b;
|
||||
uint3 const c = (*(tint_symbol_1)).arr.arr[idx].c;
|
||||
uint const d = (*(tint_symbol_1)).arr.arr[idx].d;
|
||||
float3 const e = (*(tint_symbol_1)).arr.arr[idx].e;
|
||||
float const f = (*(tint_symbol_1)).arr.arr[idx].f;
|
||||
int2 const g = (*(tint_symbol_1)).arr.arr[idx].g;
|
||||
int2 const h = (*(tint_symbol_1)).arr.arr[idx].h;
|
||||
float2x3 const i = (*(tint_symbol_1)).arr.arr[idx].i;
|
||||
float3x2 const j = (*(tint_symbol_1)).arr.arr[idx].j;
|
||||
tint_array_wrapper const k = (*(tint_symbol_1)).arr.arr[idx].k;
|
||||
int3 const a = (*(tint_symbol_1)).arr[idx].a;
|
||||
int const b = (*(tint_symbol_1)).arr[idx].b;
|
||||
uint3 const c = (*(tint_symbol_1)).arr[idx].c;
|
||||
uint const d = (*(tint_symbol_1)).arr[idx].d;
|
||||
float3 const e = (*(tint_symbol_1)).arr[idx].e;
|
||||
float const f = (*(tint_symbol_1)).arr[idx].f;
|
||||
int2 const g = (*(tint_symbol_1)).arr[idx].g;
|
||||
int2 const h = (*(tint_symbol_1)).arr[idx].h;
|
||||
float2x3 const i = (*(tint_symbol_1)).arr[idx].i;
|
||||
float3x2 const j = (*(tint_symbol_1)).arr[idx].j;
|
||||
tint_array<int4, 4> const k = (*(tint_symbol_1)).arr[idx].k;
|
||||
}
|
||||
|
||||
kernel void tint_symbol(const constant S* tint_symbol_2 [[buffer(0)]], uint idx [[thread_index_in_threadgroup]]) {
|
||||
|
||||
@@ -2,6 +2,18 @@
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
template<typename T, int N, int M>
|
||||
inline vec<T, M> operator*(matrix<T, N, M> lhs, packed_vec<T, N> rhs) {
|
||||
return lhs * vec<T, N>(rhs);
|
||||
@@ -14,11 +26,7 @@ inline vec<T, N> operator*(packed_vec<T, M> lhs, matrix<T, N, M> rhs) {
|
||||
|
||||
struct Inner {
|
||||
/* 0x0000 */ int x;
|
||||
/* 0x0004 */ int8_t tint_pad[12];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ Inner arr[4];
|
||||
/* 0x0004 */ tint_array<int8_t, 12> tint_pad;
|
||||
};
|
||||
|
||||
struct S {
|
||||
@@ -32,9 +40,9 @@ struct S {
|
||||
/* 0x0038 */ int2 h;
|
||||
/* 0x0040 */ float2x3 i;
|
||||
/* 0x0060 */ float3x2 j;
|
||||
/* 0x0078 */ int8_t tint_pad_1[8];
|
||||
/* 0x0078 */ tint_array<int8_t, 8> tint_pad_1;
|
||||
/* 0x0080 */ Inner k;
|
||||
/* 0x0090 */ tint_array_wrapper l;
|
||||
/* 0x0090 */ tint_array<Inner, 4> l;
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant S* tint_symbol_1 [[buffer(0)]]) {
|
||||
@@ -49,7 +57,7 @@ kernel void tint_symbol(const constant S* tint_symbol_1 [[buffer(0)]]) {
|
||||
float2x3 const i = (*(tint_symbol_1)).i;
|
||||
float3x2 const j = (*(tint_symbol_1)).j;
|
||||
Inner const k = (*(tint_symbol_1)).k;
|
||||
tint_array_wrapper const l = (*(tint_symbol_1)).l;
|
||||
tint_array<Inner, 4> const l = (*(tint_symbol_1)).l;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ float4 arr[4];
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant tint_array_wrapper* tint_symbol_1 [[buffer(0)]]) {
|
||||
tint_array_wrapper const x = *(tint_symbol_1);
|
||||
kernel void tint_symbol(const constant tint_array<float4, 4>* tint_symbol_1 [[buffer(0)]]) {
|
||||
tint_array<float4, 4> const x = *(tint_symbol_1);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,18 @@ inline vec<T, N> operator*(packed_vec<T, M> lhs, matrix<T, N, M> rhs) {
|
||||
return vec<T, M>(lhs) * rhs;
|
||||
}
|
||||
|
||||
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 marg8uintin() {
|
||||
}
|
||||
|
||||
@@ -21,9 +33,9 @@ struct Uniforms {
|
||||
/* 0x0008 */ uint puuuuuuuuuuuuuuuuad1;
|
||||
/* 0x000c */ uint pad2;
|
||||
/* 0x0010 */ packed_float3 bbMin;
|
||||
/* 0x001c */ int8_t tint_pad[4];
|
||||
/* 0x001c */ tint_array<int8_t, 4> tint_pad;
|
||||
/* 0x0020 */ packed_float3 bbMax;
|
||||
/* 0x002c */ int8_t tint_pad_1[4];
|
||||
/* 0x002c */ tint_array<int8_t, 4> tint_pad_1;
|
||||
};
|
||||
|
||||
struct Dbg {
|
||||
@@ -42,23 +54,23 @@ struct Dbg {
|
||||
};
|
||||
|
||||
struct F32s {
|
||||
/* 0x0000 */ float values[1];
|
||||
/* 0x0000 */ tint_array<float, 1> values;
|
||||
};
|
||||
|
||||
struct U32s {
|
||||
/* 0x0000 */ uint values[1];
|
||||
/* 0x0000 */ tint_array<uint, 1> values;
|
||||
};
|
||||
|
||||
struct I32s {
|
||||
int values[1];
|
||||
tint_array<int, 1> values;
|
||||
};
|
||||
|
||||
struct AU32s {
|
||||
/* 0x0000 */ atomic_uint values[1];
|
||||
/* 0x0000 */ tint_array<atomic_uint, 1> values;
|
||||
};
|
||||
|
||||
struct AI32s {
|
||||
/* 0x0000 */ atomic_int values[1];
|
||||
/* 0x0000 */ tint_array<atomic_int, 1> values;
|
||||
};
|
||||
|
||||
float3 toVoxelPos(float3 position, const constant Uniforms* const tint_symbol) {
|
||||
|
||||
@@ -1,8 +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];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
/* 0x0000 */ tint_array<uint4, 1> buffer_size;
|
||||
};
|
||||
|
||||
struct S {
|
||||
|
||||
@@ -13,6 +13,19 @@ bug/dawn/947.wgsl:55:33 note: reading from user-defined input 'texcoord' may res
|
||||
#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];
|
||||
};
|
||||
|
||||
struct Uniforms {
|
||||
/* 0x0000 */ float2 u_scale;
|
||||
/* 0x0008 */ float2 u_offset;
|
||||
@@ -28,19 +41,15 @@ struct tint_symbol {
|
||||
float4 position [[position]];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
float2 arr[3];
|
||||
};
|
||||
|
||||
VertexOutputs vs_main_inner(uint VertexIndex, const constant Uniforms* const tint_symbol_5) {
|
||||
tint_array_wrapper texcoord = {.arr={float2(-0.5f, 0.0f), float2(1.5f, 0.0f), float2(0.5f, 2.0f)}};
|
||||
tint_array<float2, 3> texcoord = tint_array<float2, 3>{float2(-0.5f, 0.0f), float2(1.5f, 0.0f), float2(0.5f, 2.0f)};
|
||||
VertexOutputs output = {};
|
||||
output.position = float4(((texcoord.arr[VertexIndex] * 2.0f) - float2(1.0f)), 0.0f, 1.0f);
|
||||
output.position = float4(((texcoord[VertexIndex] * 2.0f) - float2(1.0f)), 0.0f, 1.0f);
|
||||
bool flipY = ((*(tint_symbol_5)).u_scale[1] < 0.0f);
|
||||
if (flipY) {
|
||||
output.texcoords = ((((texcoord.arr[VertexIndex] * (*(tint_symbol_5)).u_scale) + (*(tint_symbol_5)).u_offset) * float2(1.0f, -1.0f)) + float2(0.0f, 1.0f));
|
||||
output.texcoords = ((((texcoord[VertexIndex] * (*(tint_symbol_5)).u_scale) + (*(tint_symbol_5)).u_offset) * float2(1.0f, -1.0f)) + float2(0.0f, 1.0f));
|
||||
} else {
|
||||
output.texcoords = ((((texcoord.arr[VertexIndex] * float2(1.0f, -1.0f)) + float2(0.0f, 1.0f)) * (*(tint_symbol_5)).u_scale) + (*(tint_symbol_5)).u_offset);
|
||||
output.texcoords = ((((texcoord[VertexIndex] * float2(1.0f, -1.0f)) + float2(0.0f, 1.0f)) * (*(tint_symbol_5)).u_scale) + (*(tint_symbol_5)).u_offset);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct UBO {
|
||||
/* 0x0000 */ int dynamic_idx;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
int arr[64];
|
||||
};
|
||||
|
||||
struct S {
|
||||
tint_array_wrapper data;
|
||||
tint_array<int, 64> data;
|
||||
};
|
||||
|
||||
struct Result {
|
||||
@@ -19,7 +28,7 @@ struct Result {
|
||||
|
||||
kernel void f(device Result* tint_symbol [[buffer(1)]], const constant UBO* tint_symbol_1 [[buffer(0)]]) {
|
||||
S s = {};
|
||||
(*(tint_symbol)).out = s.data.arr[(*(tint_symbol_1)).dynamic_idx];
|
||||
(*(tint_symbol)).out = s.data[(*(tint_symbol_1)).dynamic_idx];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct UBO {
|
||||
/* 0x0000 */ int dynamic_idx;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
int arr[64];
|
||||
};
|
||||
|
||||
struct S {
|
||||
tint_array_wrapper data;
|
||||
tint_array<int, 64> data;
|
||||
};
|
||||
|
||||
struct Result {
|
||||
@@ -19,7 +28,7 @@ struct Result {
|
||||
|
||||
kernel void f(device Result* tint_symbol [[buffer(1)]], const constant UBO* tint_symbol_2 [[buffer(0)]]) {
|
||||
thread S tint_symbol_1 = {};
|
||||
(*(tint_symbol)).out = tint_symbol_1.data.arr[(*(tint_symbol_2)).dynamic_idx];
|
||||
(*(tint_symbol)).out = tint_symbol_1.data[(*(tint_symbol_2)).dynamic_idx];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct UBO {
|
||||
/* 0x0000 */ int dynamic_idx;
|
||||
};
|
||||
@@ -9,16 +22,12 @@ struct Result {
|
||||
/* 0x0000 */ int out;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ int arr[4];
|
||||
};
|
||||
|
||||
struct SSBO {
|
||||
/* 0x0000 */ tint_array_wrapper data;
|
||||
/* 0x0000 */ tint_array<int, 4> data;
|
||||
};
|
||||
|
||||
kernel void f(device Result* tint_symbol [[buffer(1)]], device SSBO* tint_symbol_1 [[buffer(2)]], const constant UBO* tint_symbol_2 [[buffer(0)]]) {
|
||||
(*(tint_symbol)).out = (*(tint_symbol_1)).data.arr[(*(tint_symbol_2)).dynamic_idx];
|
||||
(*(tint_symbol)).out = (*(tint_symbol_1)).data[(*(tint_symbol_2)).dynamic_idx];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,23 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ int4 arr[4];
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
struct UBO {
|
||||
/* 0x0000 */ tint_array_wrapper data;
|
||||
/* 0x0000 */ tint_array<int4, 4> data;
|
||||
/* 0x0040 */ int dynamic_idx;
|
||||
/* 0x0044 */ int8_t tint_pad[12];
|
||||
/* 0x0044 */ tint_array<int8_t, 12> tint_pad;
|
||||
};
|
||||
|
||||
struct Result {
|
||||
@@ -16,7 +25,7 @@ struct Result {
|
||||
};
|
||||
|
||||
kernel void f(device Result* tint_symbol [[buffer(1)]], const constant UBO* tint_symbol_1 [[buffer(0)]]) {
|
||||
(*(tint_symbol)).out = (*(tint_symbol_1)).data.arr[(*(tint_symbol_1)).dynamic_idx][0];
|
||||
(*(tint_symbol)).out = (*(tint_symbol_1)).data[(*(tint_symbol_1)).dynamic_idx][0];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct UBO {
|
||||
/* 0x0000 */ int dynamic_idx;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
int arr[64];
|
||||
};
|
||||
|
||||
struct S {
|
||||
tint_array_wrapper data;
|
||||
tint_array<int, 64> data;
|
||||
};
|
||||
|
||||
struct Result {
|
||||
@@ -20,10 +29,10 @@ struct Result {
|
||||
void f_inner(uint local_invocation_index, threadgroup S* const tint_symbol, device Result* const tint_symbol_1, const constant UBO* const tint_symbol_2) {
|
||||
for(uint idx = local_invocation_index; (idx < 64u); idx = (idx + 1u)) {
|
||||
uint const i = idx;
|
||||
(*(tint_symbol)).data.arr[i] = 0;
|
||||
(*(tint_symbol)).data[i] = 0;
|
||||
}
|
||||
threadgroup_barrier(mem_flags::mem_threadgroup);
|
||||
(*(tint_symbol_1)).out = (*(tint_symbol)).data.arr[(*(tint_symbol_2)).dynamic_idx];
|
||||
(*(tint_symbol_1)).out = (*(tint_symbol)).data[(*(tint_symbol_2)).dynamic_idx];
|
||||
}
|
||||
|
||||
kernel void f(device Result* tint_symbol_4 [[buffer(1)]], const constant UBO* tint_symbol_5 [[buffer(0)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct UBO {
|
||||
/* 0x0000 */ int dynamic_idx;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
int arr[64];
|
||||
};
|
||||
|
||||
struct S {
|
||||
tint_array_wrapper data;
|
||||
tint_array<int, 64> data;
|
||||
};
|
||||
|
||||
struct Result {
|
||||
@@ -19,8 +28,8 @@ struct Result {
|
||||
|
||||
kernel void f(const constant UBO* tint_symbol [[buffer(0)]], device Result* tint_symbol_1 [[buffer(1)]]) {
|
||||
S s = {};
|
||||
s.data.arr[(*(tint_symbol)).dynamic_idx] = 1;
|
||||
(*(tint_symbol_1)).out = s.data.arr[3];
|
||||
s.data[(*(tint_symbol)).dynamic_idx] = 1;
|
||||
(*(tint_symbol_1)).out = s.data[3];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct UBO {
|
||||
/* 0x0000 */ int dynamic_idx;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
int arr[64];
|
||||
};
|
||||
|
||||
struct S {
|
||||
tint_array_wrapper data;
|
||||
tint_array<int, 64> data;
|
||||
};
|
||||
|
||||
struct Result {
|
||||
@@ -18,13 +27,13 @@ struct Result {
|
||||
};
|
||||
|
||||
void x(thread S* const p, const constant UBO* const tint_symbol) {
|
||||
(*(p)).data.arr[(*(tint_symbol)).dynamic_idx] = 1;
|
||||
(*(p)).data[(*(tint_symbol)).dynamic_idx] = 1;
|
||||
}
|
||||
|
||||
kernel void f(const constant UBO* tint_symbol_1 [[buffer(0)]], device Result* tint_symbol_2 [[buffer(1)]]) {
|
||||
S s = {};
|
||||
x(&(s), tint_symbol_1);
|
||||
(*(tint_symbol_2)).out = s.data.arr[3];
|
||||
(*(tint_symbol_2)).out = s.data[3];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct UBO {
|
||||
/* 0x0000 */ int dynamic_idx;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
int arr[64];
|
||||
};
|
||||
|
||||
struct S {
|
||||
tint_array_wrapper data;
|
||||
tint_array<int, 64> data;
|
||||
};
|
||||
|
||||
struct Result {
|
||||
@@ -19,8 +28,8 @@ struct Result {
|
||||
|
||||
kernel void f(const constant UBO* tint_symbol_1 [[buffer(0)]], device Result* tint_symbol_2 [[buffer(1)]]) {
|
||||
thread S tint_symbol = {};
|
||||
tint_symbol.data.arr[(*(tint_symbol_1)).dynamic_idx] = 1;
|
||||
(*(tint_symbol_2)).out = tint_symbol.data.arr[3];
|
||||
tint_symbol.data[(*(tint_symbol_1)).dynamic_idx] = 1;
|
||||
(*(tint_symbol_2)).out = tint_symbol.data[3];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct UBO {
|
||||
/* 0x0000 */ int dynamic_idx;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
int arr[64];
|
||||
};
|
||||
|
||||
struct S {
|
||||
tint_array_wrapper data;
|
||||
tint_array<int, 64> data;
|
||||
};
|
||||
|
||||
struct Result {
|
||||
@@ -18,13 +27,13 @@ struct Result {
|
||||
};
|
||||
|
||||
void x(thread S* const p, const constant UBO* const tint_symbol) {
|
||||
(*(p)).data.arr[(*(tint_symbol)).dynamic_idx] = 1;
|
||||
(*(p)).data[(*(tint_symbol)).dynamic_idx] = 1;
|
||||
}
|
||||
|
||||
kernel void f(const constant UBO* tint_symbol_2 [[buffer(0)]], device Result* tint_symbol_3 [[buffer(1)]]) {
|
||||
thread S tint_symbol_1 = {};
|
||||
x(&(tint_symbol_1), tint_symbol_2);
|
||||
(*(tint_symbol_3)).out = tint_symbol_1.data.arr[3];
|
||||
(*(tint_symbol_3)).out = tint_symbol_1.data[3];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct UBO {
|
||||
/* 0x0000 */ int dynamic_idx;
|
||||
};
|
||||
@@ -9,17 +22,13 @@ struct Result {
|
||||
/* 0x0000 */ int out;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ int arr[4];
|
||||
};
|
||||
|
||||
struct SSBO {
|
||||
/* 0x0000 */ tint_array_wrapper data;
|
||||
/* 0x0000 */ tint_array<int, 4> data;
|
||||
};
|
||||
|
||||
kernel void f(device SSBO* tint_symbol [[buffer(1)]], const constant UBO* tint_symbol_1 [[buffer(0)]], device Result* tint_symbol_2 [[buffer(2)]]) {
|
||||
(*(tint_symbol)).data.arr[(*(tint_symbol_1)).dynamic_idx] = 1;
|
||||
(*(tint_symbol_2)).out = (*(tint_symbol)).data.arr[3];
|
||||
(*(tint_symbol)).data[(*(tint_symbol_1)).dynamic_idx] = 1;
|
||||
(*(tint_symbol_2)).out = (*(tint_symbol)).data[3];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct UBO {
|
||||
/* 0x0000 */ int dynamic_idx;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
int arr[64];
|
||||
};
|
||||
|
||||
struct S {
|
||||
tint_array_wrapper data;
|
||||
tint_array<int, 64> data;
|
||||
};
|
||||
|
||||
struct Result {
|
||||
@@ -20,11 +29,11 @@ struct Result {
|
||||
void f_inner(uint local_invocation_index, threadgroup S* const tint_symbol, const constant UBO* const tint_symbol_1, device Result* const tint_symbol_2) {
|
||||
for(uint idx = local_invocation_index; (idx < 64u); idx = (idx + 1u)) {
|
||||
uint const i = idx;
|
||||
(*(tint_symbol)).data.arr[i] = 0;
|
||||
(*(tint_symbol)).data[i] = 0;
|
||||
}
|
||||
threadgroup_barrier(mem_flags::mem_threadgroup);
|
||||
(*(tint_symbol)).data.arr[(*(tint_symbol_1)).dynamic_idx] = 1;
|
||||
(*(tint_symbol_2)).out = (*(tint_symbol)).data.arr[3];
|
||||
(*(tint_symbol)).data[(*(tint_symbol_1)).dynamic_idx] = 1;
|
||||
(*(tint_symbol_2)).out = (*(tint_symbol)).data[3];
|
||||
}
|
||||
|
||||
kernel void f(const constant UBO* tint_symbol_4 [[buffer(0)]], device Result* tint_symbol_5 [[buffer(1)]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
|
||||
|
||||
@@ -2,6 +2,18 @@
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
template<typename T, int N, int M>
|
||||
inline vec<T, M> operator*(matrix<T, N, M> lhs, packed_vec<T, N> rhs) {
|
||||
return lhs * vec<T, N>(rhs);
|
||||
@@ -16,26 +28,22 @@ struct Simulation {
|
||||
/* 0x0000 */ uint i;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ float3 arr[8];
|
||||
};
|
||||
|
||||
struct Particle {
|
||||
/* 0x0000 */ tint_array_wrapper position;
|
||||
/* 0x0000 */ tint_array<float3, 8> position;
|
||||
/* 0x0080 */ float lifetime;
|
||||
/* 0x0084 */ int8_t tint_pad[12];
|
||||
/* 0x0084 */ tint_array<int8_t, 12> tint_pad;
|
||||
/* 0x0090 */ float4 color;
|
||||
/* 0x00a0 */ packed_float3 velocity;
|
||||
/* 0x00ac */ int8_t tint_pad_1[4];
|
||||
/* 0x00ac */ tint_array<int8_t, 4> tint_pad_1;
|
||||
};
|
||||
|
||||
struct Particles {
|
||||
/* 0x0000 */ Particle p[1];
|
||||
/* 0x0000 */ tint_array<Particle, 1> p;
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const device Particles* tint_symbol_1 [[buffer(1)]], const constant Simulation* tint_symbol_2 [[buffer(0)]]) {
|
||||
Particle particle = (*(tint_symbol_1)).p[0];
|
||||
particle.position.arr[(*(tint_symbol_2)).i] = particle.position.arr[(*(tint_symbol_2)).i];
|
||||
particle.position[(*(tint_symbol_2)).i] = particle.position[(*(tint_symbol_2)).i];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct PointLight {
|
||||
float4 position;
|
||||
};
|
||||
|
||||
struct PointLights {
|
||||
PointLight values[1];
|
||||
tint_array<PointLight, 1> values;
|
||||
};
|
||||
|
||||
struct Uniforms {
|
||||
@@ -14,7 +27,7 @@ struct Uniforms {
|
||||
/* 0x0040 */ float4x4 proj;
|
||||
/* 0x0080 */ uint numPointLights;
|
||||
/* 0x0084 */ uint color_source;
|
||||
/* 0x0088 */ int8_t tint_pad[8];
|
||||
/* 0x0088 */ tint_array<int8_t, 8> tint_pad;
|
||||
/* 0x0090 */ float4 color;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,25 +1,30 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ float4x4 arr[2];
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
struct strided_arr {
|
||||
/* 0x0000 */ float el;
|
||||
/* 0x0004 */ int8_t tint_pad[12];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_1 {
|
||||
/* 0x0000 */ strided_arr arr[4];
|
||||
/* 0x0004 */ tint_array<int8_t, 12> tint_pad;
|
||||
};
|
||||
|
||||
struct LeftOver {
|
||||
/* 0x0000 */ float4x4 worldViewProjection;
|
||||
/* 0x0040 */ float time;
|
||||
/* 0x0044 */ int8_t tint_pad_1[12];
|
||||
/* 0x0050 */ tint_array_wrapper test2;
|
||||
/* 0x00d0 */ tint_array_wrapper_1 test;
|
||||
/* 0x0044 */ tint_array<int8_t, 12> tint_pad_1;
|
||||
/* 0x0050 */ tint_array<float4x4, 2> test2;
|
||||
/* 0x00d0 */ tint_array<strided_arr, 4> test;
|
||||
};
|
||||
|
||||
void main_1(thread float3* const tint_symbol_5, const constant LeftOver* const tint_symbol_6, thread float4* const tint_symbol_7, thread float2* const tint_symbol_8, thread float2* const tint_symbol_9) {
|
||||
@@ -30,7 +35,7 @@ void main_1(thread float3* const tint_symbol_5, const constant LeftOver* const t
|
||||
float4 const x_21 = q;
|
||||
p = float3(x_21[0], x_21[1], x_21[2]);
|
||||
float const x_27 = p[0];
|
||||
float const x_41 = (*(tint_symbol_6)).test.arr[0].el;
|
||||
float const x_41 = (*(tint_symbol_6)).test[0].el;
|
||||
float const x_45 = (*(tint_symbol_5))[1];
|
||||
float const x_49 = (*(tint_symbol_6)).time;
|
||||
p[0] = (x_27 + sin(((x_41 * x_45) + x_49)));
|
||||
|
||||
@@ -12,15 +12,27 @@ inline vec<T, N> operator*(packed_vec<T, M> lhs, matrix<T, N, M> rhs) {
|
||||
return vec<T, M>(lhs) * rhs;
|
||||
}
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
struct Uniforms {
|
||||
/* 0x0000 */ uint numTriangles;
|
||||
/* 0x0004 */ uint gridSize;
|
||||
/* 0x0008 */ uint pad1;
|
||||
/* 0x000c */ uint pad2;
|
||||
/* 0x0010 */ packed_float3 bbMin;
|
||||
/* 0x001c */ int8_t tint_pad[4];
|
||||
/* 0x001c */ tint_array<int8_t, 4> tint_pad;
|
||||
/* 0x0020 */ packed_float3 bbMax;
|
||||
/* 0x002c */ int8_t tint_pad_1[4];
|
||||
/* 0x002c */ tint_array<int8_t, 4> tint_pad_1;
|
||||
};
|
||||
|
||||
struct Dbg {
|
||||
@@ -39,23 +51,23 @@ struct Dbg {
|
||||
};
|
||||
|
||||
struct F32s {
|
||||
/* 0x0000 */ float values[1];
|
||||
/* 0x0000 */ tint_array<float, 1> values;
|
||||
};
|
||||
|
||||
struct U32s {
|
||||
/* 0x0000 */ uint values[1];
|
||||
/* 0x0000 */ tint_array<uint, 1> values;
|
||||
};
|
||||
|
||||
struct I32s {
|
||||
int values[1];
|
||||
tint_array<int, 1> values;
|
||||
};
|
||||
|
||||
struct AU32s {
|
||||
/* 0x0000 */ atomic_uint values[1];
|
||||
/* 0x0000 */ tint_array<atomic_uint, 1> values;
|
||||
};
|
||||
|
||||
struct AI32s {
|
||||
/* 0x0000 */ atomic_int values[1];
|
||||
/* 0x0000 */ tint_array<atomic_int, 1> values;
|
||||
};
|
||||
|
||||
float3 toVoxelPos(float3 position, const constant Uniforms* const tint_symbol_1) {
|
||||
|
||||
@@ -12,6 +12,18 @@ inline vec<T, N> operator*(packed_vec<T, M> lhs, matrix<T, N, M> rhs) {
|
||||
return vec<T, M>(lhs) * rhs;
|
||||
}
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
struct LightData {
|
||||
/* 0x0000 */ float4 position;
|
||||
/* 0x0010 */ packed_float3 color;
|
||||
@@ -19,24 +31,16 @@ struct LightData {
|
||||
};
|
||||
|
||||
struct LightsBuffer {
|
||||
/* 0x0000 */ LightData lights[1];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ uint arr[64];
|
||||
/* 0x0000 */ tint_array<LightData, 1> lights;
|
||||
};
|
||||
|
||||
struct TileLightIdData {
|
||||
/* 0x0000 */ atomic_uint count;
|
||||
/* 0x0004 */ tint_array_wrapper lightId;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_1 {
|
||||
/* 0x0000 */ TileLightIdData arr[4];
|
||||
/* 0x0004 */ tint_array<uint, 64> lightId;
|
||||
};
|
||||
|
||||
struct Tiles {
|
||||
/* 0x0000 */ tint_array_wrapper_1 data;
|
||||
/* 0x0000 */ tint_array<TileLightIdData, 4> data;
|
||||
};
|
||||
|
||||
struct Config {
|
||||
@@ -56,10 +60,6 @@ struct Uniforms {
|
||||
/* 0x00a0 */ float4 fullScreenSize;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_2 {
|
||||
float4 arr[6];
|
||||
};
|
||||
|
||||
void tint_symbol_inner(uint3 GlobalInvocationID, const constant Config* const tint_symbol_1, device LightsBuffer* const tint_symbol_2, const constant Uniforms* const tint_symbol_3, device Tiles* const tint_symbol_4) {
|
||||
uint index = GlobalInvocationID[0];
|
||||
if ((index >= (*(tint_symbol_1)).numLights)) {
|
||||
@@ -78,9 +78,9 @@ void tint_symbol_inner(uint3 GlobalInvocationID, const constant Config* const ti
|
||||
float lightRadius = (*(tint_symbol_2)).lights[index].radius;
|
||||
float4 boxMin = (lightPos - float4(float3(lightRadius), 0.0f));
|
||||
float4 boxMax = (lightPos + float4(float3(lightRadius), 0.0f));
|
||||
tint_array_wrapper_2 frustumPlanes = {};
|
||||
frustumPlanes.arr[4] = float4(0.0f, 0.0f, -1.0f, viewNear);
|
||||
frustumPlanes.arr[5] = float4(0.0f, 0.0f, 1.0f, -(viewFar));
|
||||
tint_array<float4, 6> frustumPlanes = {};
|
||||
frustumPlanes[4] = float4(0.0f, 0.0f, -1.0f, viewNear);
|
||||
frustumPlanes[5] = float4(0.0f, 0.0f, 1.0f, -(viewFar));
|
||||
int const TILE_SIZE = 16;
|
||||
int const TILE_COUNT_X = 2;
|
||||
int const TILE_COUNT_Y = 2;
|
||||
@@ -91,41 +91,41 @@ void tint_symbol_inner(uint3 GlobalInvocationID, const constant Config* const ti
|
||||
float2 ceilCoord = (((2.0f * float2(as_type<int2>((as_type<uint2>(tilePixel0Idx) + as_type<uint2>(int2(16)))))) / float4((*(tint_symbol_3)).fullScreenSize).xy) - float2(1.0f));
|
||||
float2 viewFloorCoord = float2((((-(viewNear) * floorCoord[0]) - (M[2][0] * viewNear)) / M[0][0]), (((-(viewNear) * floorCoord[1]) - (M[2][1] * viewNear)) / M[1][1]));
|
||||
float2 viewCeilCoord = float2((((-(viewNear) * ceilCoord[0]) - (M[2][0] * viewNear)) / M[0][0]), (((-(viewNear) * ceilCoord[1]) - (M[2][1] * viewNear)) / M[1][1]));
|
||||
frustumPlanes.arr[0] = float4(1.0f, 0.0f, (-(viewFloorCoord[0]) / viewNear), 0.0f);
|
||||
frustumPlanes.arr[1] = float4(-1.0f, 0.0f, (viewCeilCoord[0] / viewNear), 0.0f);
|
||||
frustumPlanes.arr[2] = float4(0.0f, 1.0f, (-(viewFloorCoord[1]) / viewNear), 0.0f);
|
||||
frustumPlanes.arr[3] = float4(0.0f, -1.0f, (viewCeilCoord[1] / viewNear), 0.0f);
|
||||
frustumPlanes[0] = float4(1.0f, 0.0f, (-(viewFloorCoord[0]) / viewNear), 0.0f);
|
||||
frustumPlanes[1] = float4(-1.0f, 0.0f, (viewCeilCoord[0] / viewNear), 0.0f);
|
||||
frustumPlanes[2] = float4(0.0f, 1.0f, (-(viewFloorCoord[1]) / viewNear), 0.0f);
|
||||
frustumPlanes[3] = float4(0.0f, -1.0f, (viewCeilCoord[1] / viewNear), 0.0f);
|
||||
float dp = 0.0f;
|
||||
for(uint i = 0u; (i < 6u); i = (i + 1u)) {
|
||||
float4 p = 0.0f;
|
||||
if ((frustumPlanes.arr[i][0] > 0.0f)) {
|
||||
if ((frustumPlanes[i][0] > 0.0f)) {
|
||||
p[0] = boxMax[0];
|
||||
} else {
|
||||
p[0] = boxMin[0];
|
||||
}
|
||||
if ((frustumPlanes.arr[i][1] > 0.0f)) {
|
||||
if ((frustumPlanes[i][1] > 0.0f)) {
|
||||
p[1] = boxMax[1];
|
||||
} else {
|
||||
p[1] = boxMin[1];
|
||||
}
|
||||
if ((frustumPlanes.arr[i][2] > 0.0f)) {
|
||||
if ((frustumPlanes[i][2] > 0.0f)) {
|
||||
p[2] = boxMax[2];
|
||||
} else {
|
||||
p[2] = boxMin[2];
|
||||
}
|
||||
p[3] = 1.0f;
|
||||
dp = (dp + fmin(0.0f, dot(p, frustumPlanes.arr[i])));
|
||||
dp = (dp + fmin(0.0f, dot(p, frustumPlanes[i])));
|
||||
}
|
||||
if ((dp >= 0.0f)) {
|
||||
uint tileId = uint(as_type<int>((as_type<uint>(x_1) + as_type<uint>(as_type<int>((as_type<uint>(y_1) * as_type<uint>(2)))))));
|
||||
if (((tileId < 0u) || (tileId >= (*(tint_symbol_1)).numTiles))) {
|
||||
continue;
|
||||
}
|
||||
uint offset = atomic_fetch_add_explicit(&((*(tint_symbol_4)).data.arr[tileId].count), 1u, memory_order_relaxed);
|
||||
uint offset = atomic_fetch_add_explicit(&((*(tint_symbol_4)).data[tileId].count), 1u, memory_order_relaxed);
|
||||
if ((offset >= (*(tint_symbol_1)).numTileLightSlot)) {
|
||||
continue;
|
||||
}
|
||||
(*(tint_symbol_4)).data.arr[tileId].lightId.arr[offset] = GlobalInvocationID[0];
|
||||
(*(tint_symbol_4)).data[tileId].lightId[offset] = GlobalInvocationID[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,29 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
int foo() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
struct tint_array_wrapper {
|
||||
float arr[4];
|
||||
};
|
||||
|
||||
fragment void tint_symbol() {
|
||||
tint_array_wrapper arr = {.arr={}};
|
||||
tint_array<float, 4> arr = tint_array<float, 4>{};
|
||||
int const tint_symbol_1 = foo();
|
||||
int const a_save = tint_symbol_1;
|
||||
for(; ; ) {
|
||||
float const x = arr.arr[a_save];
|
||||
float const x = arr[a_save];
|
||||
break;
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -1,11 +1,24 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol_3 {
|
||||
/* 0x0000 */ int arr[1];
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
int foo(const device int (*const tint_symbol_1)[1]) {
|
||||
struct tint_symbol_3 {
|
||||
/* 0x0000 */ tint_array<int, 1> arr;
|
||||
};
|
||||
|
||||
int foo(const device tint_array<int, 1>* const tint_symbol_1) {
|
||||
return (*(tint_symbol_1))[0];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,23 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct UniformBuffer {
|
||||
/* 0x0000 */ int8_t tint_pad[16];
|
||||
/* 0x0000 */ tint_array<int8_t, 16> tint_pad;
|
||||
/* 0x0010 */ float unknownInput_S1_c0;
|
||||
/* 0x0014 */ int8_t tint_pad_1[12];
|
||||
/* 0x0014 */ tint_array<int8_t, 12> tint_pad_1;
|
||||
/* 0x0020 */ float4 ucolorRed_S1_c0;
|
||||
/* 0x0030 */ float4 ucolorGreen_S1_c0;
|
||||
/* 0x0040 */ float3x3 umatrix_S1;
|
||||
|
||||
@@ -1,13 +1,22 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ uint arr[50];
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
struct Buf {
|
||||
/* 0x0000 */ uint count;
|
||||
/* 0x0004 */ tint_array_wrapper data;
|
||||
/* 0x0004 */ tint_array<uint, 50> data;
|
||||
};
|
||||
|
||||
kernel void tint_symbol(device Buf* tint_symbol_1 [[buffer(0)]]) {
|
||||
@@ -19,14 +28,14 @@ kernel void tint_symbol(device Buf* tint_symbol_1 [[buffer(0)]]) {
|
||||
uint const p_save = i;
|
||||
if (((i % 2u) == 0u)) {
|
||||
{
|
||||
(*(tint_symbol_1)).data.arr[p_save] = ((*(tint_symbol_1)).data.arr[p_save] * 2u);
|
||||
(*(tint_symbol_1)).data[p_save] = ((*(tint_symbol_1)).data[p_save] * 2u);
|
||||
i = (i + 1u);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
(*(tint_symbol_1)).data.arr[p_save] = 0u;
|
||||
(*(tint_symbol_1)).data[p_save] = 0u;
|
||||
{
|
||||
(*(tint_symbol_1)).data.arr[p_save] = ((*(tint_symbol_1)).data.arr[p_save] * 2u);
|
||||
(*(tint_symbol_1)).data[p_save] = ((*(tint_symbol_1)).data[p_save] * 2u);
|
||||
i = (i + 1u);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct Light {
|
||||
float3 position;
|
||||
float3 colour;
|
||||
};
|
||||
|
||||
struct Lights {
|
||||
Light light[1];
|
||||
tint_array<Light, 1> light;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct vertexUniformBuffer1 {
|
||||
/* 0x0000 */ float2x2 transform1;
|
||||
};
|
||||
@@ -13,18 +26,14 @@ struct tint_symbol_1 {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
float2 arr[3];
|
||||
};
|
||||
|
||||
float4 tint_symbol_inner(uint gl_VertexIndex, const constant vertexUniformBuffer1* const tint_symbol_3, const constant vertexUniformBuffer2* const tint_symbol_4) {
|
||||
tint_array_wrapper indexable = {};
|
||||
tint_array<float2, 3> indexable = {};
|
||||
float2x2 const x_23 = (*(tint_symbol_3)).transform1;
|
||||
float2x2 const x_28 = (*(tint_symbol_4)).transform2;
|
||||
uint const x_46 = gl_VertexIndex;
|
||||
tint_array_wrapper const tint_symbol_2 = {.arr={float2(-1.0f, 1.0f), float2(1.0f), float2(-1.0f)}};
|
||||
tint_array<float2, 3> const tint_symbol_2 = tint_array<float2, 3>{float2(-1.0f, 1.0f), float2(1.0f), float2(-1.0f)};
|
||||
indexable = tint_symbol_2;
|
||||
float2 const x_51 = indexable.arr[x_46];
|
||||
float2 const x_51 = indexable[x_46];
|
||||
float2 const x_52 = (float2x2((x_23[0u] + x_28[0u]), (x_23[1u] + x_28[1u])) * x_51);
|
||||
return float4(x_52[0], x_52[1], 0.0f, 1.0f);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct Uniforms {
|
||||
/* 0x0000 */ uint dstTextureFlipY;
|
||||
/* 0x0004 */ uint isFloat16;
|
||||
@@ -9,7 +22,7 @@ struct Uniforms {
|
||||
};
|
||||
|
||||
struct OutputBuf {
|
||||
/* 0x0000 */ uint result[1];
|
||||
/* 0x0000 */ tint_array<uint, 1> result;
|
||||
};
|
||||
|
||||
uint ConvertToFp16FloatValue(float fp32) {
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct Uniforms {
|
||||
/* 0x0000 */ uint2 aShape;
|
||||
/* 0x0008 */ uint2 bShape;
|
||||
@@ -8,7 +21,7 @@ struct Uniforms {
|
||||
};
|
||||
|
||||
struct Matrix {
|
||||
/* 0x0000 */ uint numbers[1];
|
||||
/* 0x0000 */ tint_array<uint, 1> numbers;
|
||||
};
|
||||
|
||||
void tint_symbol_inner(uint3 global_id, const constant Uniforms* const tint_symbol_1, const device Matrix* const tint_symbol_2, const device Matrix* const tint_symbol_3, device Matrix* const tint_symbol_4) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,12 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct Constants {
|
||||
int level;
|
||||
};
|
||||
|
||||
struct Result {
|
||||
/* 0x0000 */ float values[1];
|
||||
/* 0x0000 */ tint_array<float, 1> values;
|
||||
};
|
||||
|
||||
void tint_symbol_inner(uint3 GlobalInvocationID, texture2d_array<float, access::sample> tint_symbol_1, device Result* const tint_symbol_2) {
|
||||
|
||||
@@ -1,13 +1,22 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
int arr[2];
|
||||
|
||||
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 foo() {
|
||||
tint_array_wrapper tint_symbol = {};
|
||||
tint_array_wrapper implict = {};
|
||||
tint_array<int, 2> tint_symbol = {};
|
||||
tint_array<int, 2> implict = {};
|
||||
implict = tint_symbol;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct Output {
|
||||
float4 Position;
|
||||
float4 color;
|
||||
@@ -11,21 +24,13 @@ struct tint_symbol_1 {
|
||||
float4 Position [[position]];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
float2 arr[4];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_1 {
|
||||
float4 arr[4];
|
||||
};
|
||||
|
||||
Output tint_symbol_inner(uint VertexIndex, uint InstanceIndex) {
|
||||
tint_array_wrapper const zv = {.arr={float2(0.200000003f), float2(0.300000012f), float2(-0.100000001f), float2(1.100000024f)}};
|
||||
float const z = zv.arr[InstanceIndex][0];
|
||||
tint_array<float2, 4> const zv = tint_array<float2, 4>{float2(0.200000003f), float2(0.300000012f), float2(-0.100000001f), float2(1.100000024f)};
|
||||
float const z = zv[InstanceIndex][0];
|
||||
Output output = {};
|
||||
output.Position = float4(0.5f, 0.5f, z, 1.0f);
|
||||
tint_array_wrapper_1 const colors = {.arr={float4(1.0f, 0.0f, 0.0f, 1.0f), float4(0.0f, 1.0f, 0.0f, 1.0f), float4(0.0f, 0.0f, 1.0f, 1.0f), float4(1.0f)}};
|
||||
output.color = colors.arr[InstanceIndex];
|
||||
tint_array<float4, 4> const colors = tint_array<float4, 4>{float4(1.0f, 0.0f, 0.0f, 1.0f), float4(0.0f, 1.0f, 0.0f, 1.0f), float4(0.0f, 0.0f, 1.0f, 1.0f), float4(1.0f)};
|
||||
output.color = colors[InstanceIndex];
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +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];
|
||||
};
|
||||
|
||||
struct Result {
|
||||
/* 0x0000 */ float values[1];
|
||||
/* 0x0000 */ tint_array<float, 1> values;
|
||||
};
|
||||
|
||||
constant uint width = 128u;
|
||||
|
||||
@@ -1,15 +1,24 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ int arr[6];
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
struct sspp962805860buildInformationS {
|
||||
/* 0x0000 */ float4 footprint;
|
||||
/* 0x0010 */ float4 offset;
|
||||
/* 0x0020 */ int essence;
|
||||
/* 0x0024 */ tint_array_wrapper orientation;
|
||||
/* 0x0024 */ tint_array<int, 6> orientation;
|
||||
};
|
||||
|
||||
struct x_B4_BuildInformation {
|
||||
@@ -17,14 +26,14 @@ struct x_B4_BuildInformation {
|
||||
};
|
||||
|
||||
void main_1(const device x_B4_BuildInformation* const tint_symbol_1) {
|
||||
tint_array_wrapper orientation = {};
|
||||
tint_array_wrapper const x_23 = (*(tint_symbol_1)).passthru.orientation;
|
||||
orientation.arr[0] = x_23.arr[0u];
|
||||
orientation.arr[1] = x_23.arr[1u];
|
||||
orientation.arr[2] = x_23.arr[2u];
|
||||
orientation.arr[3] = x_23.arr[3u];
|
||||
orientation.arr[4] = x_23.arr[4u];
|
||||
orientation.arr[5] = x_23.arr[5u];
|
||||
tint_array<int, 6> orientation = {};
|
||||
tint_array<int, 6> const x_23 = (*(tint_symbol_1)).passthru.orientation;
|
||||
orientation[0] = x_23[0u];
|
||||
orientation[1] = x_23[1u];
|
||||
orientation[2] = x_23[2u];
|
||||
orientation[3] = x_23[3u];
|
||||
orientation[4] = x_23[4u];
|
||||
orientation[5] = x_23[5u];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct Uniforms {
|
||||
/* 0x0000 */ uint dstTextureFlipY;
|
||||
/* 0x0004 */ uint channelCount;
|
||||
@@ -10,7 +23,7 @@ struct Uniforms {
|
||||
};
|
||||
|
||||
struct OutputBuf {
|
||||
/* 0x0000 */ uint result[1];
|
||||
/* 0x0000 */ tint_array<uint, 1> result;
|
||||
};
|
||||
|
||||
bool aboutEqual(float value, float expect) {
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct Uniforms {
|
||||
/* 0x0000 */ uint dimAOuter;
|
||||
/* 0x0004 */ uint dimInner;
|
||||
@@ -8,7 +21,7 @@ struct Uniforms {
|
||||
};
|
||||
|
||||
struct Matrix {
|
||||
/* 0x0000 */ float numbers[1];
|
||||
/* 0x0000 */ tint_array<float, 1> numbers;
|
||||
};
|
||||
|
||||
float mm_readA(uint row, uint col, const constant Uniforms* const tint_symbol_3, const device Matrix* const tint_symbol_4) {
|
||||
@@ -44,28 +57,12 @@ constant uint TileBOuter = 64u;
|
||||
|
||||
constant uint TileInner = 64u;
|
||||
|
||||
struct tint_array_wrapper_1 {
|
||||
float arr[64];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
tint_array_wrapper_1 arr[64];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_2 {
|
||||
float arr[16];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_3 {
|
||||
float arr[4];
|
||||
};
|
||||
|
||||
void tint_symbol_inner(uint3 local_id, uint3 global_id, uint local_invocation_index, threadgroup tint_array_wrapper* const tint_symbol_9, threadgroup tint_array_wrapper* const tint_symbol_10, const constant Uniforms* const tint_symbol_11, const device Matrix* const tint_symbol_12, const device Matrix* const tint_symbol_13, device Matrix* const tint_symbol_14) {
|
||||
void tint_symbol_inner(uint3 local_id, uint3 global_id, uint local_invocation_index, threadgroup tint_array<tint_array<float, 64>, 64>* const tint_symbol_9, threadgroup tint_array<tint_array<float, 64>, 64>* const tint_symbol_10, const constant Uniforms* const tint_symbol_11, const device Matrix* const tint_symbol_12, const device Matrix* const tint_symbol_13, device Matrix* const tint_symbol_14) {
|
||||
for(uint idx = local_invocation_index; (idx < 4096u); idx = (idx + 256u)) {
|
||||
uint const i = (idx / 64u);
|
||||
uint const i_1 = (idx % 64u);
|
||||
(*(tint_symbol_9)).arr[i].arr[i_1] = 0.0f;
|
||||
(*(tint_symbol_10)).arr[i].arr[i_1] = 0.0f;
|
||||
(*(tint_symbol_9))[i][i_1] = 0.0f;
|
||||
(*(tint_symbol_10))[i][i_1] = 0.0f;
|
||||
}
|
||||
threadgroup_barrier(mem_flags::mem_threadgroup);
|
||||
uint const tileRow = (local_id[1] * 4u);
|
||||
@@ -73,11 +70,11 @@ void tint_symbol_inner(uint3 local_id, uint3 global_id, uint local_invocation_in
|
||||
uint const globalRow = (global_id[1] * 4u);
|
||||
uint const globalCol = (global_id[0] * 4u);
|
||||
uint const numTiles = ((((*(tint_symbol_11)).dimInner - 1u) / 64u) + 1u);
|
||||
tint_array_wrapper_2 acc = {};
|
||||
tint_array<float, 16> acc = {};
|
||||
float ACached = 0.0f;
|
||||
tint_array_wrapper_3 BCached = {};
|
||||
tint_array<float, 4> BCached = {};
|
||||
for(uint index = 0u; (index < (4u * 4u)); index = (index + 1u)) {
|
||||
acc.arr[index] = 0.0f;
|
||||
acc[index] = 0.0f;
|
||||
}
|
||||
uint const ColPerThreadA = (64u / 16u);
|
||||
uint const tileColA = (local_id[0] * ColPerThreadA);
|
||||
@@ -89,7 +86,7 @@ void tint_symbol_inner(uint3 local_id, uint3 global_id, uint local_invocation_in
|
||||
uint const inputRow = (tileRow + innerRow);
|
||||
uint const inputCol = (tileColA + innerCol);
|
||||
float const tint_symbol_1 = mm_readA((globalRow + innerRow), ((t * 64u) + inputCol), tint_symbol_11, tint_symbol_12);
|
||||
(*(tint_symbol_9)).arr[inputRow].arr[inputCol] = tint_symbol_1;
|
||||
(*(tint_symbol_9))[inputRow][inputCol] = tint_symbol_1;
|
||||
}
|
||||
}
|
||||
for(uint innerRow = 0u; (innerRow < RowPerThreadB); innerRow = (innerRow + 1u)) {
|
||||
@@ -97,19 +94,19 @@ void tint_symbol_inner(uint3 local_id, uint3 global_id, uint local_invocation_in
|
||||
uint const inputRow = (tileRowB + innerRow);
|
||||
uint const inputCol = (tileCol + innerCol);
|
||||
float const tint_symbol_2 = mm_readB(((t * 64u) + inputRow), (globalCol + innerCol), tint_symbol_11, tint_symbol_13);
|
||||
(*(tint_symbol_10)).arr[innerCol].arr[inputCol] = tint_symbol_2;
|
||||
(*(tint_symbol_10))[innerCol][inputCol] = tint_symbol_2;
|
||||
}
|
||||
}
|
||||
threadgroup_barrier(mem_flags::mem_threadgroup);
|
||||
for(uint k = 0u; (k < 64u); k = (k + 1u)) {
|
||||
for(uint inner = 0u; (inner < 4u); inner = (inner + 1u)) {
|
||||
BCached.arr[inner] = (*(tint_symbol_10)).arr[k].arr[(tileCol + inner)];
|
||||
BCached[inner] = (*(tint_symbol_10))[k][(tileCol + inner)];
|
||||
}
|
||||
for(uint innerRow = 0u; (innerRow < 4u); innerRow = (innerRow + 1u)) {
|
||||
ACached = (*(tint_symbol_9)).arr[(tileRow + innerRow)].arr[k];
|
||||
ACached = (*(tint_symbol_9))[(tileRow + innerRow)][k];
|
||||
for(uint innerCol = 0u; (innerCol < 4u); innerCol = (innerCol + 1u)) {
|
||||
uint const index = ((innerRow * 4u) + innerCol);
|
||||
acc.arr[index] = (acc.arr[index] + (ACached * BCached.arr[innerCol]));
|
||||
acc[index] = (acc[index] + (ACached * BCached[innerCol]));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -118,14 +115,14 @@ void tint_symbol_inner(uint3 local_id, uint3 global_id, uint local_invocation_in
|
||||
for(uint innerRow = 0u; (innerRow < 4u); innerRow = (innerRow + 1u)) {
|
||||
for(uint innerCol = 0u; (innerCol < 4u); innerCol = (innerCol + 1u)) {
|
||||
uint const index = ((innerRow * 4u) + innerCol);
|
||||
mm_write((globalRow + innerRow), (globalCol + innerCol), acc.arr[index], tint_symbol_11, tint_symbol_14);
|
||||
mm_write((globalRow + innerRow), (globalCol + innerCol), acc[index], tint_symbol_11, tint_symbol_14);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
kernel void tint_symbol(const constant Uniforms* tint_symbol_17 [[buffer(0)]], const device Matrix* tint_symbol_18 [[buffer(2)]], const device Matrix* tint_symbol_19 [[buffer(3)]], device Matrix* tint_symbol_20 [[buffer(1)]], uint3 local_id [[thread_position_in_threadgroup]], uint3 global_id [[thread_position_in_grid]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
|
||||
threadgroup tint_array_wrapper tint_symbol_15;
|
||||
threadgroup tint_array_wrapper tint_symbol_16;
|
||||
threadgroup tint_array<tint_array<float, 64>, 64> tint_symbol_15;
|
||||
threadgroup tint_array<tint_array<float, 64>, 64> tint_symbol_16;
|
||||
tint_symbol_inner(local_id, global_id, local_invocation_index, &(tint_symbol_15), &(tint_symbol_16), tint_symbol_17, tint_symbol_18, tint_symbol_19, tint_symbol_20);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct Mat4x4_ {
|
||||
/* 0x0000 */ float4 mx;
|
||||
/* 0x0010 */ float4 my;
|
||||
@@ -23,21 +36,13 @@ struct ub_SceneParams {
|
||||
/* 0x0000 */ Mat4x4_ u_Projection;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ Mat4x2_ arr[1];
|
||||
};
|
||||
|
||||
struct ub_MaterialParams {
|
||||
/* 0x0000 */ tint_array_wrapper u_TexMtx;
|
||||
/* 0x0000 */ tint_array<Mat4x2_, 1> u_TexMtx;
|
||||
/* 0x0020 */ float4 u_Misc0_;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_1 {
|
||||
/* 0x0000 */ Mat4x3_ arr[32];
|
||||
};
|
||||
|
||||
struct ub_PacketParams {
|
||||
/* 0x0000 */ tint_array_wrapper_1 u_PosMtx;
|
||||
/* 0x0000 */ tint_array<Mat4x3_, 32> u_PosMtx;
|
||||
};
|
||||
|
||||
struct VertexOutput {
|
||||
@@ -222,7 +227,7 @@ void main1(thread float* const tint_symbol_5, const constant ub_PacketParams* co
|
||||
Mat4x3_ t_PosMtx = {};
|
||||
float2 t_TexSpaceCoord = 0.0f;
|
||||
float const x_e15 = *(tint_symbol_5);
|
||||
Mat4x3_ const x_e18 = (*(tint_symbol_6)).u_PosMtx.arr[int(x_e15)];
|
||||
Mat4x3_ const x_e18 = (*(tint_symbol_6)).u_PosMtx[int(x_e15)];
|
||||
t_PosMtx = x_e18;
|
||||
Mat4x3_ const x_e23 = t_PosMtx;
|
||||
Mat4x4_ const x_e24 = x_Mat4x4_1(x_e23);
|
||||
@@ -247,7 +252,7 @@ void main1(thread float* const tint_symbol_5, const constant ub_PacketParams* co
|
||||
if ((x_e52[0] == 2.0f)) {
|
||||
{
|
||||
float3 const x_e59 = *(tint_symbol_13);
|
||||
Mat4x2_ const x_e64 = (*(tint_symbol_12)).u_TexMtx.arr[0];
|
||||
Mat4x2_ const x_e64 = (*(tint_symbol_12)).u_TexMtx[0];
|
||||
float3 const x_e65 = *(tint_symbol_13);
|
||||
float2 const x_e68 = Mul2(x_e64, float4(x_e65, 1.0f));
|
||||
*(tint_symbol_14) = float2(x_e68).xy;
|
||||
@@ -256,7 +261,7 @@ void main1(thread float* const tint_symbol_5, const constant ub_PacketParams* co
|
||||
} else {
|
||||
{
|
||||
float2 const x_e73 = *(tint_symbol_15);
|
||||
Mat4x2_ const x_e79 = (*(tint_symbol_12)).u_TexMtx.arr[0];
|
||||
Mat4x2_ const x_e79 = (*(tint_symbol_12)).u_TexMtx[0];
|
||||
float2 const x_e80 = *(tint_symbol_15);
|
||||
float2 const x_e84 = Mul2(x_e79, float4(x_e80, 1.0f, 1.0f));
|
||||
*(tint_symbol_14) = float2(x_e84).xy;
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct Params {
|
||||
/* 0x0000 */ uint filterDim;
|
||||
/* 0x0004 */ uint blockDim;
|
||||
@@ -10,19 +23,11 @@ struct Flip {
|
||||
/* 0x0000 */ uint value;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_1 {
|
||||
float3 arr[256];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
tint_array_wrapper_1 arr[4];
|
||||
};
|
||||
|
||||
void tint_symbol_inner(uint3 WorkGroupID, uint3 LocalInvocationID, uint local_invocation_index, threadgroup tint_array_wrapper* const tint_symbol_1, const constant Params* const tint_symbol_2, texture2d<float, access::sample> tint_symbol_3, const constant Flip* const tint_symbol_4, sampler tint_symbol_5, texture2d<float, access::write> tint_symbol_6) {
|
||||
void tint_symbol_inner(uint3 WorkGroupID, uint3 LocalInvocationID, uint local_invocation_index, threadgroup tint_array<tint_array<float3, 256>, 4>* const tint_symbol_1, const constant Params* const tint_symbol_2, texture2d<float, access::sample> tint_symbol_3, const constant Flip* const tint_symbol_4, sampler tint_symbol_5, texture2d<float, access::write> tint_symbol_6) {
|
||||
for(uint idx = local_invocation_index; (idx < 1024u); idx = (idx + 64u)) {
|
||||
uint const i_1 = (idx / 256u);
|
||||
uint const i_2 = (idx % 256u);
|
||||
(*(tint_symbol_1)).arr[i_1].arr[i_2] = float3(0.0f);
|
||||
(*(tint_symbol_1))[i_1][i_2] = float3(0.0f);
|
||||
}
|
||||
threadgroup_barrier(mem_flags::mem_threadgroup);
|
||||
uint const filterOffset = (((*(tint_symbol_2)).filterDim - 1u) / 2u);
|
||||
@@ -34,7 +39,7 @@ void tint_symbol_inner(uint3 WorkGroupID, uint3 LocalInvocationID, uint local_in
|
||||
if (((*(tint_symbol_4)).value != 0u)) {
|
||||
loadIndex = int2(loadIndex).yx;
|
||||
}
|
||||
(*(tint_symbol_1)).arr[r].arr[((4u * LocalInvocationID[0]) + c)] = float4(tint_symbol_3.sample(tint_symbol_5, ((float2(loadIndex) + float2(0.25f)) / float2(dims)), level(0.0f))).rgb;
|
||||
(*(tint_symbol_1))[r][((4u * LocalInvocationID[0]) + c)] = float4(tint_symbol_3.sample(tint_symbol_5, ((float2(loadIndex) + float2(0.25f)) / float2(dims)), level(0.0f))).rgb;
|
||||
}
|
||||
}
|
||||
threadgroup_barrier(mem_flags::mem_threadgroup);
|
||||
@@ -49,7 +54,7 @@ void tint_symbol_inner(uint3 WorkGroupID, uint3 LocalInvocationID, uint local_in
|
||||
float3 acc = float3(0.0f);
|
||||
for(uint f = 0u; (f < (*(tint_symbol_2)).filterDim); f = (f + 1u)) {
|
||||
uint i = ((center + f) - filterOffset);
|
||||
acc = (acc + ((1.0f / float((*(tint_symbol_2)).filterDim)) * (*(tint_symbol_1)).arr[r].arr[i]));
|
||||
acc = (acc + ((1.0f / float((*(tint_symbol_2)).filterDim)) * (*(tint_symbol_1))[r][i]));
|
||||
}
|
||||
tint_symbol_6.write(float4(acc, 1.0f), uint2(writeIndex));
|
||||
}
|
||||
@@ -58,7 +63,7 @@ void tint_symbol_inner(uint3 WorkGroupID, uint3 LocalInvocationID, uint local_in
|
||||
}
|
||||
|
||||
kernel void tint_symbol(const constant Params* tint_symbol_8 [[buffer(0)]], texture2d<float, access::sample> tint_symbol_9 [[texture(0)]], const constant Flip* tint_symbol_10 [[buffer(1)]], sampler tint_symbol_11 [[sampler(0)]], texture2d<float, access::write> tint_symbol_12 [[texture(1)]], uint3 WorkGroupID [[threadgroup_position_in_grid]], uint3 LocalInvocationID [[thread_position_in_threadgroup]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
|
||||
threadgroup tint_array_wrapper tint_symbol_7;
|
||||
threadgroup tint_array<tint_array<float3, 256>, 4> tint_symbol_7;
|
||||
tint_symbol_inner(WorkGroupID, LocalInvocationID, local_invocation_index, &(tint_symbol_7), tint_symbol_8, tint_symbol_9, tint_symbol_10, tint_symbol_11, tint_symbol_12);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4,44 +4,41 @@ note: reading from module-scope private variable 'dimInner_1' may result in a no
|
||||
#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];
|
||||
};
|
||||
|
||||
struct Uniforms {
|
||||
/* 0x0000 */ float tint_symbol;
|
||||
/* 0x0004 */ int8_t tint_pad[12];
|
||||
/* 0x0004 */ tint_array<int8_t, 12> tint_pad;
|
||||
/* 0x0010 */ packed_int3 aShape;
|
||||
/* 0x001c */ int8_t tint_pad_1[4];
|
||||
/* 0x001c */ tint_array<int8_t, 4> tint_pad_1;
|
||||
/* 0x0020 */ packed_int3 bShape;
|
||||
/* 0x002c */ int8_t tint_pad_2[4];
|
||||
/* 0x002c */ tint_array<int8_t, 4> tint_pad_2;
|
||||
/* 0x0030 */ packed_int3 outShape;
|
||||
/* 0x003c */ int8_t tint_pad_3[4];
|
||||
/* 0x003c */ tint_array<int8_t, 4> tint_pad_3;
|
||||
/* 0x0040 */ int2 outShapeStrides;
|
||||
};
|
||||
|
||||
struct ssbOut {
|
||||
/* 0x0000 */ float result[1];
|
||||
/* 0x0000 */ tint_array<float, 1> result;
|
||||
};
|
||||
|
||||
struct ssbA {
|
||||
/* 0x0000 */ float A[1];
|
||||
/* 0x0000 */ tint_array<float, 1> A;
|
||||
};
|
||||
|
||||
struct ssbB {
|
||||
/* 0x0000 */ float B[1];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_1 {
|
||||
float arr[64];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
tint_array_wrapper_1 arr[64];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_3 {
|
||||
float arr[1];
|
||||
};
|
||||
|
||||
struct tint_array_wrapper_2 {
|
||||
tint_array_wrapper_3 arr[64];
|
||||
/* 0x0000 */ tint_array<float, 1> B;
|
||||
};
|
||||
|
||||
bool coordsInBounds_vi2_vi2_(thread int2* const coord, thread int2* const shape) {
|
||||
@@ -175,11 +172,7 @@ void mm_write_i1_i1_f1_(thread int* const row_2, thread int* const col_2, thread
|
||||
return;
|
||||
}
|
||||
|
||||
struct tint_array_wrapper_4 {
|
||||
tint_array_wrapper_3 arr[1];
|
||||
};
|
||||
|
||||
void mm_matMul_i1_i1_i1_(thread int* const dimAOuter, thread int* const dimInner, thread int* const dimBOuter, thread uint3* const tint_symbol_19, thread uint3* const tint_symbol_20, const constant Uniforms* const tint_symbol_21, thread int* const tint_symbol_22, thread int* const tint_symbol_23, thread int* const tint_symbol_24, const device ssbA* const tint_symbol_25, threadgroup tint_array_wrapper* const tint_symbol_26, thread int* const tint_symbol_27, const device ssbB* const tint_symbol_28, threadgroup tint_array_wrapper_2* const tint_symbol_29, device ssbOut* const tint_symbol_30) {
|
||||
void mm_matMul_i1_i1_i1_(thread int* const dimAOuter, thread int* const dimInner, thread int* const dimBOuter, thread uint3* const tint_symbol_19, thread uint3* const tint_symbol_20, const constant Uniforms* const tint_symbol_21, thread int* const tint_symbol_22, thread int* const tint_symbol_23, thread int* const tint_symbol_24, const device ssbA* const tint_symbol_25, threadgroup tint_array<tint_array<float, 64>, 64>* const tint_symbol_26, thread int* const tint_symbol_27, const device ssbB* const tint_symbol_28, threadgroup tint_array<tint_array<float, 1>, 64>* const tint_symbol_29, device ssbOut* const tint_symbol_30) {
|
||||
int tileRow = 0;
|
||||
int tileCol = 0;
|
||||
int globalRow = 0;
|
||||
@@ -187,7 +180,7 @@ void mm_matMul_i1_i1_i1_(thread int* const dimAOuter, thread int* const dimInner
|
||||
int numTiles = 0;
|
||||
int innerRow = 0;
|
||||
int innerCol = 0;
|
||||
tint_array_wrapper_4 acc = {};
|
||||
tint_array<tint_array<float, 1>, 1> acc = {};
|
||||
int tileColA = 0;
|
||||
int tileRowB = 0;
|
||||
int t = 0;
|
||||
@@ -205,7 +198,7 @@ void mm_matMul_i1_i1_i1_(thread int* const dimAOuter, thread int* const dimInner
|
||||
int param_6 = 0;
|
||||
int k = 0;
|
||||
int inner = 0;
|
||||
tint_array_wrapper_3 BCached = {};
|
||||
tint_array<float, 1> BCached = {};
|
||||
int innerRow_3 = 0;
|
||||
float ACached = 0.0f;
|
||||
int innerCol_3 = 0;
|
||||
@@ -240,7 +233,7 @@ void mm_matMul_i1_i1_i1_(thread int* const dimAOuter, thread int* const dimInner
|
||||
}
|
||||
int const x_177 = innerRow;
|
||||
int const x_178 = innerCol;
|
||||
acc.arr[x_177].arr[x_178] = 0.0f;
|
||||
acc[x_177][x_178] = 0.0f;
|
||||
{
|
||||
int const x_181 = innerCol;
|
||||
innerCol = as_type<int>((as_type<uint>(x_181) + as_type<uint>(1)));
|
||||
@@ -292,7 +285,7 @@ void mm_matMul_i1_i1_i1_(thread int* const dimAOuter, thread int* const dimInner
|
||||
param_3 = as_type<int>((as_type<uint>(x_235) + as_type<uint>(x_236)));
|
||||
param_4 = as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_238) * as_type<uint>(64)))) + as_type<uint>(x_240)));
|
||||
float const x_244 = mm_readA_i1_i1_(&(param_3), &(param_4), tint_symbol_21, tint_symbol_22, tint_symbol_23, tint_symbol_24, tint_symbol_25);
|
||||
(*(tint_symbol_26)).arr[x_233].arr[x_234] = x_244;
|
||||
(*(tint_symbol_26))[x_233][x_234] = x_244;
|
||||
{
|
||||
int const x_247 = innerCol_1;
|
||||
innerCol_1 = as_type<int>((as_type<uint>(x_247) + as_type<uint>(1)));
|
||||
@@ -332,7 +325,7 @@ void mm_matMul_i1_i1_i1_(thread int* const dimAOuter, thread int* const dimInner
|
||||
param_5 = as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_280) * as_type<uint>(64)))) + as_type<uint>(x_282)));
|
||||
param_6 = as_type<int>((as_type<uint>(x_284) + as_type<uint>(x_285)));
|
||||
float const x_289 = mm_readB_i1_i1_(&(param_5), &(param_6), tint_symbol_21, tint_symbol_23, tint_symbol_27, tint_symbol_24, tint_symbol_28);
|
||||
(*(tint_symbol_29)).arr[x_278].arr[x_279] = x_289;
|
||||
(*(tint_symbol_29))[x_278][x_279] = x_289;
|
||||
{
|
||||
int const x_291 = innerCol_2;
|
||||
innerCol_2 = as_type<int>((as_type<uint>(x_291) + as_type<uint>(1)));
|
||||
@@ -362,8 +355,8 @@ void mm_matMul_i1_i1_i1_(thread int* const dimAOuter, thread int* const dimInner
|
||||
int const x_315 = k;
|
||||
int const x_316 = tileCol;
|
||||
int const x_317 = inner;
|
||||
float const x_320 = (*(tint_symbol_29)).arr[x_315].arr[as_type<int>((as_type<uint>(x_316) + as_type<uint>(x_317)))];
|
||||
BCached.arr[x_314] = x_320;
|
||||
float const x_320 = (*(tint_symbol_29))[x_315][as_type<int>((as_type<uint>(x_316) + as_type<uint>(x_317)))];
|
||||
BCached[x_314] = x_320;
|
||||
{
|
||||
int const x_322 = inner;
|
||||
inner = as_type<int>((as_type<uint>(x_322) + as_type<uint>(1)));
|
||||
@@ -379,7 +372,7 @@ void mm_matMul_i1_i1_i1_(thread int* const dimAOuter, thread int* const dimInner
|
||||
int const x_333 = tileRow;
|
||||
int const x_334 = innerRow_3;
|
||||
int const x_336 = k;
|
||||
float const x_338 = (*(tint_symbol_26)).arr[as_type<int>((as_type<uint>(x_333) + as_type<uint>(x_334)))].arr[x_336];
|
||||
float const x_338 = (*(tint_symbol_26))[as_type<int>((as_type<uint>(x_333) + as_type<uint>(x_334)))][x_336];
|
||||
ACached = x_338;
|
||||
innerCol_3 = 0;
|
||||
while (true) {
|
||||
@@ -392,9 +385,9 @@ void mm_matMul_i1_i1_i1_(thread int* const dimAOuter, thread int* const dimInner
|
||||
int const x_348 = innerCol_3;
|
||||
float const x_349 = ACached;
|
||||
int const x_350 = innerCol_3;
|
||||
float const x_352 = BCached.arr[x_350];
|
||||
float const x_355 = acc.arr[x_347].arr[x_348];
|
||||
acc.arr[x_347].arr[x_348] = (x_355 + (x_349 * x_352));
|
||||
float const x_352 = BCached[x_350];
|
||||
float const x_355 = acc[x_347][x_348];
|
||||
acc[x_347][x_348] = (x_355 + (x_349 * x_352));
|
||||
{
|
||||
int const x_358 = innerCol_3;
|
||||
innerCol_3 = as_type<int>((as_type<uint>(x_358) + as_type<uint>(1)));
|
||||
@@ -454,7 +447,7 @@ void mm_matMul_i1_i1_i1_(thread int* const dimAOuter, thread int* const dimInner
|
||||
int const x_404 = innerCol_4;
|
||||
param_7 = as_type<int>((as_type<uint>(x_397) + as_type<uint>(x_398)));
|
||||
param_8 = as_type<int>((as_type<uint>(x_400) + as_type<uint>(x_401)));
|
||||
float const x_409 = acc.arr[x_403].arr[x_404];
|
||||
float const x_409 = acc[x_403][x_404];
|
||||
param_9 = x_409;
|
||||
mm_write_i1_i1_f1_(&(param_7), &(param_8), &(param_9), tint_symbol_24, tint_symbol_21, tint_symbol_30);
|
||||
}
|
||||
@@ -471,7 +464,7 @@ void mm_matMul_i1_i1_i1_(thread int* const dimAOuter, thread int* const dimInner
|
||||
return;
|
||||
}
|
||||
|
||||
void main_1(const constant Uniforms* const tint_symbol_31, thread int* const tint_symbol_32, thread int* const tint_symbol_33, thread int* const tint_symbol_34, thread uint3* const tint_symbol_35, thread int* const tint_symbol_36, thread uint3* const tint_symbol_37, const device ssbA* const tint_symbol_38, threadgroup tint_array_wrapper* const tint_symbol_39, const device ssbB* const tint_symbol_40, threadgroup tint_array_wrapper_2* const tint_symbol_41, device ssbOut* const tint_symbol_42) {
|
||||
void main_1(const constant Uniforms* const tint_symbol_31, thread int* const tint_symbol_32, thread int* const tint_symbol_33, thread int* const tint_symbol_34, thread uint3* const tint_symbol_35, thread int* const tint_symbol_36, thread uint3* const tint_symbol_37, const device ssbA* const tint_symbol_38, threadgroup tint_array<tint_array<float, 64>, 64>* const tint_symbol_39, const device ssbB* const tint_symbol_40, threadgroup tint_array<tint_array<float, 1>, 64>* const tint_symbol_41, device ssbOut* const tint_symbol_42) {
|
||||
int param_18 = 0;
|
||||
int param_19 = 0;
|
||||
int param_20 = 0;
|
||||
@@ -493,16 +486,16 @@ void main_1(const constant Uniforms* const tint_symbol_31, thread int* const tin
|
||||
return;
|
||||
}
|
||||
|
||||
void tint_symbol_1_inner(uint3 gl_LocalInvocationID_param, uint3 gl_GlobalInvocationID_param, uint local_invocation_index, threadgroup tint_array_wrapper_2* const tint_symbol_43, threadgroup tint_array_wrapper* const tint_symbol_44, thread uint3* const tint_symbol_45, thread uint3* const tint_symbol_46, const constant Uniforms* const tint_symbol_47, thread int* const tint_symbol_48, thread int* const tint_symbol_49, thread int* const tint_symbol_50, thread int* const tint_symbol_51, const device ssbA* const tint_symbol_52, const device ssbB* const tint_symbol_53, device ssbOut* const tint_symbol_54) {
|
||||
void tint_symbol_1_inner(uint3 gl_LocalInvocationID_param, uint3 gl_GlobalInvocationID_param, uint local_invocation_index, threadgroup tint_array<tint_array<float, 1>, 64>* const tint_symbol_43, threadgroup tint_array<tint_array<float, 64>, 64>* const tint_symbol_44, thread uint3* const tint_symbol_45, thread uint3* const tint_symbol_46, const constant Uniforms* const tint_symbol_47, thread int* const tint_symbol_48, thread int* const tint_symbol_49, thread int* const tint_symbol_50, thread int* const tint_symbol_51, const device ssbA* const tint_symbol_52, const device ssbB* const tint_symbol_53, device ssbOut* const tint_symbol_54) {
|
||||
{
|
||||
uint const i_1 = local_invocation_index;
|
||||
uint const i_2 = (local_invocation_index % 1u);
|
||||
(*(tint_symbol_43)).arr[i_1].arr[i_2] = 0.0f;
|
||||
(*(tint_symbol_43))[i_1][i_2] = 0.0f;
|
||||
}
|
||||
for(uint idx = local_invocation_index; (idx < 4096u); idx = (idx + 64u)) {
|
||||
uint const i = (idx / 64u);
|
||||
uint const i_1 = (idx % 64u);
|
||||
(*(tint_symbol_44)).arr[i].arr[i_1] = 0.0f;
|
||||
(*(tint_symbol_44))[i][i_1] = 0.0f;
|
||||
}
|
||||
threadgroup_barrier(mem_flags::mem_threadgroup);
|
||||
*(tint_symbol_45) = gl_LocalInvocationID_param;
|
||||
@@ -511,8 +504,8 @@ void tint_symbol_1_inner(uint3 gl_LocalInvocationID_param, uint3 gl_GlobalInvoca
|
||||
}
|
||||
|
||||
kernel void tint_symbol_1(const constant Uniforms* tint_symbol_59 [[buffer(0)]], const device ssbA* tint_symbol_64 [[buffer(2)]], const device ssbB* tint_symbol_65 [[buffer(3)]], device ssbOut* tint_symbol_66 [[buffer(1)]], uint3 gl_LocalInvocationID_param [[thread_position_in_threadgroup]], uint3 gl_GlobalInvocationID_param [[thread_position_in_grid]], uint local_invocation_index [[thread_index_in_threadgroup]]) {
|
||||
threadgroup tint_array_wrapper_2 tint_symbol_55;
|
||||
threadgroup tint_array_wrapper tint_symbol_56;
|
||||
threadgroup tint_array<tint_array<float, 1>, 64> tint_symbol_55;
|
||||
threadgroup tint_array<tint_array<float, 64>, 64> tint_symbol_56;
|
||||
thread uint3 tint_symbol_57 = 0u;
|
||||
thread uint3 tint_symbol_58 = 0u;
|
||||
thread int tint_symbol_60 = 0;
|
||||
|
||||
@@ -14,6 +14,18 @@ bug/tint/948.wgsl:137:27 note: reading from module-scope private variable 'mt' m
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
template<typename T, int N, int M>
|
||||
inline vec<T, M> operator*(matrix<T, N, M> lhs, packed_vec<T, N> rhs) {
|
||||
return lhs * vec<T, N>(rhs);
|
||||
@@ -27,7 +39,7 @@ inline vec<T, N> operator*(packed_vec<T, M> lhs, matrix<T, N, M> rhs) {
|
||||
struct LeftOver {
|
||||
/* 0x0000 */ float time;
|
||||
/* 0x0004 */ uint padding;
|
||||
/* 0x0008 */ int8_t tint_pad[8];
|
||||
/* 0x0008 */ tint_array<int8_t, 8> tint_pad;
|
||||
/* 0x0010 */ float4x4 worldViewProjection;
|
||||
/* 0x0050 */ float2 outputSize;
|
||||
/* 0x0058 */ float2 stageSize;
|
||||
@@ -35,7 +47,7 @@ struct LeftOver {
|
||||
/* 0x0068 */ float stageScale;
|
||||
/* 0x006c */ float spriteCount;
|
||||
/* 0x0070 */ packed_float3 colorMul;
|
||||
/* 0x007c */ int8_t tint_pad_1[4];
|
||||
/* 0x007c */ tint_array<int8_t, 4> tint_pad_1;
|
||||
};
|
||||
|
||||
float4x4 getFrameData_f1_(thread float* const frameID, const constant LeftOver* const tint_symbol_5, texture2d<float, access::sample> tint_symbol_6, sampler tint_symbol_7) {
|
||||
|
||||
@@ -14,6 +14,18 @@ bug/tint/949.wgsl:308:27 note: reading from module-scope private variable 'v_out
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
template<typename T, int N, int M>
|
||||
inline vec<T, M> operator*(matrix<T, N, M> lhs, packed_vec<T, N> rhs) {
|
||||
return lhs * vec<T, N>(rhs);
|
||||
@@ -34,7 +46,7 @@ struct LeftOver {
|
||||
/* 0x0040 */ float4x4 u_ViewProjection;
|
||||
/* 0x0080 */ float u_bumpStrength;
|
||||
/* 0x0084 */ uint padding;
|
||||
/* 0x0088 */ int8_t tint_pad[8];
|
||||
/* 0x0088 */ tint_array<int8_t, 8> tint_pad;
|
||||
/* 0x0090 */ packed_float3 u_cameraPosition;
|
||||
/* 0x009c */ float u_parallaxScale;
|
||||
/* 0x00a0 */ float textureInfoName;
|
||||
@@ -50,7 +62,7 @@ struct Light0 {
|
||||
/* 0x003c */ uint padding_2;
|
||||
/* 0x0040 */ float4 shadowsInfo;
|
||||
/* 0x0050 */ float2 depthValues;
|
||||
/* 0x0058 */ int8_t tint_pad_1[8];
|
||||
/* 0x0058 */ tint_array<int8_t, 8> tint_pad_1;
|
||||
};
|
||||
|
||||
float3x3 cotangent_frame_vf3_vf3_vf2_vf2_(thread float3* const normal_1, thread float3* const p, thread float2* const uv, thread float2* const tangentSpaceParams) {
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct ssbOut {
|
||||
/* 0x0000 */ float result[1];
|
||||
/* 0x0000 */ tint_array<float, 1> result;
|
||||
};
|
||||
|
||||
struct ssbA {
|
||||
/* 0x0000 */ float A[1];
|
||||
/* 0x0000 */ tint_array<float, 1> A;
|
||||
};
|
||||
|
||||
struct Uniforms {
|
||||
|
||||
@@ -1,16 +1,29 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct ResultMatrix {
|
||||
/* 0x0000 */ float numbers[1];
|
||||
/* 0x0000 */ tint_array<float, 1> numbers;
|
||||
};
|
||||
|
||||
struct FirstMatrix {
|
||||
float numbers[1];
|
||||
tint_array<float, 1> numbers;
|
||||
};
|
||||
|
||||
struct SecondMatrix {
|
||||
float numbers[1];
|
||||
tint_array<float, 1> numbers;
|
||||
};
|
||||
|
||||
struct Uniforms {
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct Constants {
|
||||
/* 0x0000 */ uint zero;
|
||||
};
|
||||
@@ -9,16 +22,12 @@ struct Result {
|
||||
/* 0x0000 */ uint value;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ atomic_int arr[3];
|
||||
};
|
||||
|
||||
struct TestData {
|
||||
/* 0x0000 */ tint_array_wrapper data;
|
||||
/* 0x0000 */ tint_array<atomic_int, 3> data;
|
||||
};
|
||||
|
||||
int runTest(device TestData* const tint_symbol_3, const constant Constants* const tint_symbol_4) {
|
||||
return atomic_load_explicit(&((*(tint_symbol_3)).data.arr[(0u + uint((*(tint_symbol_4)).zero))]), memory_order_relaxed);
|
||||
return atomic_load_explicit(&((*(tint_symbol_3)).data[(0u + uint((*(tint_symbol_4)).zero))]), memory_order_relaxed);
|
||||
}
|
||||
|
||||
kernel void tint_symbol(device TestData* tint_symbol_5 [[buffer(2)]], const constant Constants* tint_symbol_6 [[buffer(0)]], device Result* tint_symbol_7 [[buffer(1)]]) {
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct Constants {
|
||||
/* 0x0000 */ uint zero;
|
||||
};
|
||||
@@ -9,17 +22,13 @@ struct Result {
|
||||
uint value;
|
||||
};
|
||||
|
||||
struct tint_array_wrapper {
|
||||
uint arr[3];
|
||||
};
|
||||
|
||||
struct S {
|
||||
tint_array_wrapper data;
|
||||
tint_array<uint, 3> data;
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant Constants* tint_symbol_2 [[buffer(0)]]) {
|
||||
thread S tint_symbol_1 = {};
|
||||
tint_symbol_1.data.arr[(*(tint_symbol_2)).zero] = 0u;
|
||||
tint_symbol_1.data[(*(tint_symbol_2)).zero] = 0u;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
/* 0x0000 */ tint_array<uint4, 1> buffer_size;
|
||||
};
|
||||
|
||||
struct S {
|
||||
int a[1];
|
||||
tint_array<int, 1> a;
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant tint_symbol_1* tint_symbol_3 [[buffer(30)]]) {
|
||||
|
||||
@@ -1,8 +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];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
/* 0x0000 */ tint_array<uint4, 1> buffer_size;
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant tint_symbol_1* tint_symbol_3 [[buffer(30)]]) {
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
/* 0x0000 */ tint_array<uint4, 1> buffer_size;
|
||||
};
|
||||
|
||||
struct S {
|
||||
int a[1];
|
||||
tint_array<int, 1> a;
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant tint_symbol_1* tint_symbol_3 [[buffer(30)]]) {
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
/* 0x0000 */ tint_array<uint4, 1> buffer_size;
|
||||
};
|
||||
|
||||
struct S {
|
||||
int a[1];
|
||||
tint_array<int, 1> a;
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant tint_symbol_1* tint_symbol_3 [[buffer(30)]]) {
|
||||
|
||||
@@ -1,8 +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];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
/* 0x0000 */ tint_array<uint4, 1> buffer_size;
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant tint_symbol_1* tint_symbol_3 [[buffer(30)]]) {
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
/* 0x0000 */ tint_array<uint4, 1> buffer_size;
|
||||
};
|
||||
|
||||
struct S {
|
||||
int a[1];
|
||||
tint_array<int, 1> a;
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant tint_symbol_1* tint_symbol_3 [[buffer(30)]]) {
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
/* 0x0000 */ tint_array<uint4, 1> buffer_size;
|
||||
};
|
||||
|
||||
struct S {
|
||||
int a[1];
|
||||
tint_array<int, 1> a;
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant tint_symbol_1* tint_symbol_3 [[buffer(30)]]) {
|
||||
|
||||
@@ -1,8 +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];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
/* 0x0000 */ tint_array<uint4, 1> buffer_size;
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant tint_symbol_1* tint_symbol_3 [[buffer(30)]]) {
|
||||
|
||||
@@ -1,8 +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];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
/* 0x0000 */ tint_array<uint4, 1> buffer_size;
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const constant tint_symbol_1* tint_symbol_3 [[buffer(30)]]) {
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
/* 0x0000 */ tint_array<uint4, 1> buffer_size;
|
||||
};
|
||||
|
||||
struct SB_RO {
|
||||
int arg_0[1];
|
||||
tint_array<int, 1> arg_0;
|
||||
};
|
||||
|
||||
void arrayLength_1588cd(const constant tint_symbol_1* const tint_symbol_3) {
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
/* 0x0000 */ tint_array<uint4, 1> buffer_size;
|
||||
};
|
||||
|
||||
struct SB_RW {
|
||||
int arg_0[1];
|
||||
tint_array<int, 1> arg_0;
|
||||
};
|
||||
|
||||
void arrayLength_61b1c7(const constant tint_symbol_1* const tint_symbol_3) {
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
/* 0x0000 */ tint_array<uint4, 1> buffer_size;
|
||||
};
|
||||
|
||||
struct SB_RO {
|
||||
float arg_0[1];
|
||||
tint_array<float, 1> arg_0;
|
||||
};
|
||||
|
||||
void arrayLength_a0f5ca(const constant tint_symbol_1* const tint_symbol_3) {
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
/* 0x0000 */ tint_array<uint4, 1> buffer_size;
|
||||
};
|
||||
|
||||
struct SB_RW {
|
||||
float arg_0[1];
|
||||
tint_array<float, 1> arg_0;
|
||||
};
|
||||
|
||||
void arrayLength_cdd123(const constant tint_symbol_1* const tint_symbol_3) {
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
/* 0x0000 */ tint_array<uint4, 1> buffer_size;
|
||||
};
|
||||
|
||||
struct SB_RO {
|
||||
uint arg_0[1];
|
||||
tint_array<uint, 1> arg_0;
|
||||
};
|
||||
|
||||
void arrayLength_cfca0a(const constant tint_symbol_1* const tint_symbol_3) {
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
/* 0x0000 */ tint_array<uint4, 1> buffer_size;
|
||||
};
|
||||
|
||||
struct SB_RW {
|
||||
uint arg_0[1];
|
||||
tint_array<uint, 1> arg_0;
|
||||
};
|
||||
|
||||
void arrayLength_eb510f(const constant tint_symbol_1* const tint_symbol_3) {
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct GammaTransferParams {
|
||||
/* 0x0000 */ float G;
|
||||
/* 0x0004 */ float A;
|
||||
@@ -15,7 +28,7 @@ struct GammaTransferParams {
|
||||
struct ExternalTextureParams {
|
||||
/* 0x0000 */ uint numPlanes;
|
||||
/* 0x0004 */ uint doYuvToRgbConversionOnly;
|
||||
/* 0x0008 */ int8_t tint_pad[8];
|
||||
/* 0x0008 */ tint_array<int8_t, 8> tint_pad;
|
||||
/* 0x0010 */ float3x4 yuvToRgbConversionMatrix;
|
||||
/* 0x0040 */ GammaTransferParams gammaDecodeParams;
|
||||
/* 0x0060 */ GammaTransferParams gammaEncodeParams;
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct GammaTransferParams {
|
||||
/* 0x0000 */ float G;
|
||||
/* 0x0004 */ float A;
|
||||
@@ -15,7 +28,7 @@ struct GammaTransferParams {
|
||||
struct ExternalTextureParams {
|
||||
/* 0x0000 */ uint numPlanes;
|
||||
/* 0x0004 */ uint doYuvToRgbConversionOnly;
|
||||
/* 0x0008 */ int8_t tint_pad[8];
|
||||
/* 0x0008 */ tint_array<int8_t, 8> tint_pad;
|
||||
/* 0x0010 */ float3x4 yuvToRgbConversionMatrix;
|
||||
/* 0x0040 */ GammaTransferParams gammaDecodeParams;
|
||||
/* 0x0060 */ GammaTransferParams gammaEncodeParams;
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
/* 0x0000 */ tint_array<uint4, 1> buffer_size;
|
||||
};
|
||||
|
||||
struct SB_RO {
|
||||
int arg_0[1];
|
||||
tint_array<int, 1> arg_0;
|
||||
};
|
||||
|
||||
void arrayLength_1588cd(const constant tint_symbol_1* const tint_symbol_3) {
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
/* 0x0000 */ tint_array<uint4, 1> buffer_size;
|
||||
};
|
||||
|
||||
struct SB_RW {
|
||||
int arg_0[1];
|
||||
tint_array<int, 1> arg_0;
|
||||
};
|
||||
|
||||
void arrayLength_61b1c7(const constant tint_symbol_1* const tint_symbol_3) {
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
/* 0x0000 */ tint_array<uint4, 1> buffer_size;
|
||||
};
|
||||
|
||||
struct SB_RO {
|
||||
float arg_0[1];
|
||||
tint_array<float, 1> arg_0;
|
||||
};
|
||||
|
||||
void arrayLength_a0f5ca(const constant tint_symbol_1* const tint_symbol_3) {
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
/* 0x0000 */ tint_array<uint4, 1> buffer_size;
|
||||
};
|
||||
|
||||
struct SB_RW {
|
||||
float arg_0[1];
|
||||
tint_array<float, 1> arg_0;
|
||||
};
|
||||
|
||||
void arrayLength_cdd123(const constant tint_symbol_1* const tint_symbol_3) {
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
/* 0x0000 */ tint_array<uint4, 1> buffer_size;
|
||||
};
|
||||
|
||||
struct SB_RO {
|
||||
uint arg_0[1];
|
||||
tint_array<uint, 1> arg_0;
|
||||
};
|
||||
|
||||
void arrayLength_cfca0a(const constant tint_symbol_1* const tint_symbol_3) {
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct tint_symbol_1 {
|
||||
/* 0x0000 */ uint4 buffer_size[1];
|
||||
/* 0x0000 */ tint_array<uint4, 1> buffer_size;
|
||||
};
|
||||
|
||||
struct SB_RW {
|
||||
uint arg_0[1];
|
||||
tint_array<uint, 1> arg_0;
|
||||
};
|
||||
|
||||
void arrayLength_eb510f(const constant tint_symbol_1* const tint_symbol_3) {
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct GammaTransferParams {
|
||||
/* 0x0000 */ float G;
|
||||
/* 0x0004 */ float A;
|
||||
@@ -15,7 +28,7 @@ struct GammaTransferParams {
|
||||
struct ExternalTextureParams {
|
||||
/* 0x0000 */ uint numPlanes;
|
||||
/* 0x0004 */ uint doYuvToRgbConversionOnly;
|
||||
/* 0x0008 */ int8_t tint_pad[8];
|
||||
/* 0x0008 */ tint_array<int8_t, 8> tint_pad;
|
||||
/* 0x0010 */ float3x4 yuvToRgbConversionMatrix;
|
||||
/* 0x0040 */ GammaTransferParams gammaDecodeParams;
|
||||
/* 0x0060 */ GammaTransferParams gammaEncodeParams;
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct GammaTransferParams {
|
||||
/* 0x0000 */ float G;
|
||||
/* 0x0004 */ float A;
|
||||
@@ -15,7 +28,7 @@ struct GammaTransferParams {
|
||||
struct ExternalTextureParams {
|
||||
/* 0x0000 */ uint numPlanes;
|
||||
/* 0x0004 */ uint doYuvToRgbConversionOnly;
|
||||
/* 0x0008 */ int8_t tint_pad[8];
|
||||
/* 0x0008 */ tint_array<int8_t, 8> tint_pad;
|
||||
/* 0x0010 */ float3x4 yuvToRgbConversionMatrix;
|
||||
/* 0x0040 */ GammaTransferParams gammaDecodeParams;
|
||||
/* 0x0060 */ GammaTransferParams gammaEncodeParams;
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#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];
|
||||
};
|
||||
|
||||
struct GammaTransferParams {
|
||||
/* 0x0000 */ float G;
|
||||
/* 0x0004 */ float A;
|
||||
@@ -15,7 +28,7 @@ struct GammaTransferParams {
|
||||
struct ExternalTextureParams {
|
||||
/* 0x0000 */ uint numPlanes;
|
||||
/* 0x0004 */ uint doYuvToRgbConversionOnly;
|
||||
/* 0x0008 */ int8_t tint_pad[8];
|
||||
/* 0x0008 */ tint_array<int8_t, 8> tint_pad;
|
||||
/* 0x0010 */ float3x4 yuvToRgbConversionMatrix;
|
||||
/* 0x0040 */ GammaTransferParams gammaDecodeParams;
|
||||
/* 0x0060 */ GammaTransferParams gammaEncodeParams;
|
||||
|
||||
@@ -2,6 +2,18 @@
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
template<typename T, int N, int M>
|
||||
inline vec<T, M> operator*(matrix<T, N, M> lhs, packed_vec<T, N> rhs) {
|
||||
return lhs * vec<T, N>(rhs);
|
||||
@@ -14,9 +26,9 @@ inline vec<T, N> operator*(packed_vec<T, M> lhs, matrix<T, N, M> rhs) {
|
||||
|
||||
struct S {
|
||||
/* 0x0000 */ float3x2 tint_symbol;
|
||||
/* 0x0018 */ int8_t tint_pad[8];
|
||||
/* 0x0018 */ tint_array<int8_t, 8> tint_pad;
|
||||
/* 0x0020 */ packed_float3 vector;
|
||||
/* 0x002c */ int8_t tint_pad_1[4];
|
||||
/* 0x002c */ tint_array<int8_t, 4> tint_pad_1;
|
||||
};
|
||||
|
||||
fragment void tint_symbol_1(const constant S* tint_symbol_2 [[buffer(0)]]) {
|
||||
|
||||
@@ -12,10 +12,22 @@ inline vec<T, N> operator*(packed_vec<T, M> lhs, matrix<T, N, M> rhs) {
|
||||
return vec<T, M>(lhs) * rhs;
|
||||
}
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
struct S {
|
||||
/* 0x0000 */ float3x3 tint_symbol;
|
||||
/* 0x0030 */ packed_float3 vector;
|
||||
/* 0x003c */ int8_t tint_pad[4];
|
||||
/* 0x003c */ tint_array<int8_t, 4> tint_pad;
|
||||
};
|
||||
|
||||
fragment void tint_symbol_1(const constant S* tint_symbol_2 [[buffer(0)]]) {
|
||||
|
||||
@@ -12,10 +12,22 @@ inline vec<T, N> operator*(packed_vec<T, M> lhs, matrix<T, N, M> rhs) {
|
||||
return vec<T, M>(lhs) * rhs;
|
||||
}
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
struct S {
|
||||
/* 0x0000 */ float3x3 tint_symbol;
|
||||
/* 0x0030 */ packed_float3 vector;
|
||||
/* 0x003c */ int8_t tint_pad[4];
|
||||
/* 0x003c */ tint_array<int8_t, 4> tint_pad;
|
||||
};
|
||||
|
||||
fragment void tint_symbol_1(const constant S* tint_symbol_2 [[buffer(0)]]) {
|
||||
|
||||
@@ -12,10 +12,22 @@ inline vec<T, N> operator*(packed_vec<T, M> lhs, matrix<T, N, M> rhs) {
|
||||
return vec<T, M>(lhs) * rhs;
|
||||
}
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
struct S {
|
||||
/* 0x0000 */ float4x3 tint_symbol;
|
||||
/* 0x0040 */ packed_float3 vector;
|
||||
/* 0x004c */ int8_t tint_pad[4];
|
||||
/* 0x004c */ tint_array<int8_t, 4> tint_pad;
|
||||
};
|
||||
|
||||
fragment void tint_symbol_1(const constant S* tint_symbol_2 [[buffer(0)]]) {
|
||||
|
||||
@@ -1,13 +1,22 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
int arr[8];
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
int f() {
|
||||
tint_array_wrapper const a = {.arr={1, 2, 3, 4, 5, 6, 7, 8}};
|
||||
tint_array<int, 8> const a = tint_array<int, 8>{1, 2, 3, 4, 5, 6, 7, 8};
|
||||
int const i = 1;
|
||||
return a.arr[1];
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,22 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
int arr[8];
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
int f(int x) {
|
||||
tint_array_wrapper const a = {.arr={1, 2, 3, 4, 5, 6, 7, 8}};
|
||||
tint_array<int, 8> const a = tint_array<int, 8>{1, 2, 3, 4, 5, 6, 7, 8};
|
||||
int const i = x;
|
||||
return a.arr[i];
|
||||
return a[i];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
int arr[8];
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
int f() {
|
||||
tint_array_wrapper const a = {.arr={1, 2, 3, 4, 5, 6, 7, 8}};
|
||||
return a.arr[1];
|
||||
tint_array<int, 8> const a = tint_array<int, 8>{1, 2, 3, 4, 5, 6, 7, 8};
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
int arr[8];
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
int f(int i) {
|
||||
tint_array_wrapper const a = {.arr={1, 2, 3, 4, 5, 6, 7, 8}};
|
||||
return a.arr[i];
|
||||
tint_array<int, 8> const a = tint_array<int, 8>{1, 2, 3, 4, 5, 6, 7, 8};
|
||||
return a[i];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,22 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
int arr[8];
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
int f() {
|
||||
tint_array_wrapper a = {.arr={1, 2, 3, 4, 5, 6, 7, 8}};
|
||||
tint_array<int, 8> a = tint_array<int, 8>{1, 2, 3, 4, 5, 6, 7, 8};
|
||||
int const i = 1;
|
||||
return a.arr[1];
|
||||
return a[1];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,22 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
int arr[8];
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
int f() {
|
||||
tint_array_wrapper a = {.arr={1, 2, 3, 4, 5, 6, 7, 8}};
|
||||
tint_array<int, 8> a = tint_array<int, 8>{1, 2, 3, 4, 5, 6, 7, 8};
|
||||
int const i = 1;
|
||||
return a.arr[1];
|
||||
return a[1];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,22 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
int arr[8];
|
||||
|
||||
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];
|
||||
};
|
||||
|
||||
int f(int x) {
|
||||
tint_array_wrapper a = {.arr={1, 2, 3, 4, 5, 6, 7, 8}};
|
||||
tint_array<int, 8> a = tint_array<int, 8>{1, 2, 3, 4, 5, 6, 7, 8};
|
||||
int const i = x;
|
||||
return a.arr[i];
|
||||
return a[i];
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user