Skip to content

Commit 9cb3174

Browse files
authored
Repro test that loads repro (shader-slang#1576)
* #include an absolute path didn't work - because paths were taken to always be relative. * Slang repro test that reloads and runs compiled code.
1 parent fab1c9f commit 9cb3174

File tree

2 files changed

+14
-21
lines changed

2 files changed

+14
-21
lines changed

tests/compute/dump-repro.slang

+6-21
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,16 @@
1-
//TEST(compute):SIMPLE:-target hlsl -dump-repro repro.slang-repro
1+
//DISABLE_TEST(compute):SIMPLE:-profile cs_5_0 -entry computeMain -target dxbc -dump-repro repro.slang-repro
2+
//TEST:COMPILE:tests/compute/dump-repro.slang -profile cs_5_0 -entry computeMain -target dxbc -dump-repro repro.slang-repro
3+
//TEST(compute):COMPARE_COMPUTE_EX:-dx11 -compute -no-default-entry-point -compile-arg -load-repro -compile-arg repro.slang-repro
4+
// We only want to run on one API to test load worked
5+
//DISABLE_TEST(compute):COMPARE_COMPUTE:-dx12 -load-repro repro.slang-repro
26

37
//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0], stride=4):out,name outputBuffer
48
RWStructuredBuffer<int> outputBuffer;
59

6-
//TEST_INPUT:array(size=2):name g_aoa
7-
RWStructuredBuffer<int> g_aoa[];
8-
9-
//TEST_INPUT:ubuffer(data=[1 2 3 4], stride=4):name=g_aoa[0]
10-
//TEST_INPUT:ubuffer(data=[8 17 34], stride=4):name=g_aoa[1]
11-
1210
[numthreads(8, 1, 1)]
1311
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
1412
{
1513
int index = int(dispatchThreadID.x);
1614

17-
int baseIndex = index >> 2;
18-
int innerIndex = index & 3;
19-
20-
RWStructuredBuffer<int> buffer = g_aoa[baseIndex];
21-
22-
// Get the size
23-
uint bufferCount, bufferStride;
24-
buffer.GetDimensions(bufferCount, bufferStride);
25-
26-
if (innerIndex >= bufferCount)
27-
{
28-
innerIndex = bufferCount - 1;
29-
}
30-
outputBuffer[index] = buffer[innerIndex];
15+
outputBuffer[index] = index * 2 + 1;
3116
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
1
2+
3
3+
5
4+
7
5+
9
6+
B
7+
D
8+
F

0 commit comments

Comments
 (0)