yum-mirror/slang

Making it easier to work with shaders

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

Julius IkkalaReplace SLANG_ALIGN_OF with C++11 alignof (#7523)551d0c365

master
665 B15 linesraw
1//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -cpu
2
3//TEST_INPUT:ubuffer(data=[0 0], stride=4):out,name=outputBuffer
4RWStructuredBuffer<int> outputBuffer;
5
6[numthreads(1, 1, 1)]
7void computeMain(int3 dispatchThreadID: SV_DispatchThreadID)
8{
9    // The point of this test is to just check that __alignOf isn't implemented
10    // as a C macro that misinterprets templates as multiple arguments and fails
11    // to compile :) That's why it doesn't care much about the actual values of
12    // the alignments.
13    outputBuffer[0] = __alignOf<float2>() > 0 ? 1 : 0; // CHECK: 1
14    outputBuffer[1] = __alignOf<vector<int, 2>>() > 0 ? 1 : 0; // CHECK-NEXT: 1
15}