yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Yong HeSPIRV: Fix performance issue when handling large arrays. (#4064)0bb826f8b

master
423 B20 linesraw
1//TEST:SIMPLE(filecheck=CHECK): -target spirv -emit-spirv-directly -profile glsl_460
2
3struct WorkData {
4    float A[2048 * 2048];
5    float B[2048 * 2048];
6};
7struct PushData {
8    WorkData* Input;
9    float* Dest;
10};
11
12[vk::push_constant] ConstantBuffer<PushData> cb;
13
14// CHECK: OpEntryPoint
15
16[numthreads(64, 1, 1)]
17void ComputeMain(uint tid: SV_DispatchThreadID)
18{
19    cb.Dest[tid] = cb.Input->A[tid] * cb.Input->B[tid];
20}