yum-mirror/slang

Making it easier to work with shaders

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

Yong HePush buffer load to end of access chain. (#5544)0754abee6

master
570 B24 linesraw
1//TEST:SIMPLE(filecheck=CHECK): -target spirv
2
3#define FILL_PATTERN_DIMENSIONS_X 16
4#define FILL_PATTERN_DIMENSIONS_Y 16
5
6struct FillPatternBuffer
7{
8    float4 px[FILL_PATTERN_DIMENSIONS_Y][FILL_PATTERN_DIMENSIONS_X];
9};
10
11StructuredBuffer<FillPatternBuffer> dp;
12RWStructuredBuffer<float4> outputBuffer;
13
14// CHECK-NOT: OpCompositeConstruct
15
16[numthreads(4, 4, 1)]
17void main(uint3 GTid : SV_GroupThreadID, 
18          uint GI    : SV_GroupIndex)
19{
20    const uint ii = GTid.x;
21    const uint jj = GTid.y;
22    const float4 pmv = dp[0].px[ii][jj];
23    outputBuffer[GI] = pmv;
24}