mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-05 11:45:54 +00:00
This CL rearranges testcases for E2E test/tint/bug/chromium/1367602, now it has testcases for both function, private, and storage address space array variable, with and without explicit initializer, and array count less than 65536. Bug: chromium:1367602 Change-Id: Ica0ec9c36586bc7eae0d46473575284e9b734092 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105282 Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com> Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
21 lines
704 B
Plaintext
21 lines
704 B
Plaintext
#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 A {
|
|
tint_array<float, 1000000> a;
|
|
};
|
|
|