summaryrefslogtreecommitdiff
path: root/tests/spirv/large-struct-ptr.slang
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-05-01 16:44:22 -0700
committerGitHub <noreply@github.com>2024-05-01 16:44:22 -0700
commit0bb826f8b92aec330875d0b966c1f4a6b99988bf (patch)
treef0d086d4bfb93e302fcb8232816842ccfc182480 /tests/spirv/large-struct-ptr.slang
parent4533c825fe628e08228037b846ee9d10004fd56f (diff)
SPIRV: Fix performance issue when handling large arrays. (#4064)
* SPIRV: Fix performance issue when handling large arrays. * Add test for packing. * Fix clang.
Diffstat (limited to 'tests/spirv/large-struct-ptr.slang')
-rw-r--r--tests/spirv/large-struct-ptr.slang20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/spirv/large-struct-ptr.slang b/tests/spirv/large-struct-ptr.slang
new file mode 100644
index 000000000..131ccdbb9
--- /dev/null
+++ b/tests/spirv/large-struct-ptr.slang
@@ -0,0 +1,20 @@
+//TEST:SIMPLE(filecheck=CHECK): -target spirv -emit-spirv-directly -profile glsl_460
+
+struct WorkData {
+ float A[2048 * 2048];
+ float B[2048 * 2048];
+};
+struct PushData {
+ WorkData* Input;
+ float* Dest;
+};
+
+[vk::push_constant] ConstantBuffer<PushData> cb;
+
+// CHECK: OpEntryPoint
+
+[numthreads(64, 1, 1)]
+void ComputeMain(uint tid: SV_DispatchThreadID)
+{
+ cb.Dest[tid] = cb.Input->A[tid] * cb.Input->B[tid];
+} \ No newline at end of file