diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-10-13 16:30:25 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-13 13:30:25 -0700 |
| commit | 9cb31747782d07111ded70664d46da4f568bea2f (patch) | |
| tree | 1411c77fdc682a81ef994347fde15d589faf2d8e | |
| parent | fab1c9f4c745ba84983c2448646376799d461e96 (diff) | |
Repro test that loads repro (#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.
| -rw-r--r-- | tests/compute/dump-repro.slang | 27 | ||||
| -rw-r--r-- | tests/compute/dump-repro.slang.2.expected.txt | 8 |
2 files changed, 14 insertions, 21 deletions
diff --git a/tests/compute/dump-repro.slang b/tests/compute/dump-repro.slang index 314388aa6..dd07574ad 100644 --- a/tests/compute/dump-repro.slang +++ b/tests/compute/dump-repro.slang @@ -1,31 +1,16 @@ -//TEST(compute):SIMPLE:-target hlsl -dump-repro repro.slang-repro +//DISABLE_TEST(compute):SIMPLE:-profile cs_5_0 -entry computeMain -target dxbc -dump-repro repro.slang-repro +//TEST:COMPILE:tests/compute/dump-repro.slang -profile cs_5_0 -entry computeMain -target dxbc -dump-repro repro.slang-repro +//TEST(compute):COMPARE_COMPUTE_EX:-dx11 -compute -no-default-entry-point -compile-arg -load-repro -compile-arg repro.slang-repro +// We only want to run on one API to test load worked +//DISABLE_TEST(compute):COMPARE_COMPUTE:-dx12 -load-repro repro.slang-repro //TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0], stride=4):out,name outputBuffer RWStructuredBuffer<int> outputBuffer; -//TEST_INPUT:array(size=2):name g_aoa -RWStructuredBuffer<int> g_aoa[]; - -//TEST_INPUT:ubuffer(data=[1 2 3 4], stride=4):name=g_aoa[0] -//TEST_INPUT:ubuffer(data=[8 17 34], stride=4):name=g_aoa[1] - [numthreads(8, 1, 1)] void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) { int index = int(dispatchThreadID.x); - int baseIndex = index >> 2; - int innerIndex = index & 3; - - RWStructuredBuffer<int> buffer = g_aoa[baseIndex]; - - // Get the size - uint bufferCount, bufferStride; - buffer.GetDimensions(bufferCount, bufferStride); - - if (innerIndex >= bufferCount) - { - innerIndex = bufferCount - 1; - } - outputBuffer[index] = buffer[innerIndex]; + outputBuffer[index] = index * 2 + 1; }
\ No newline at end of file diff --git a/tests/compute/dump-repro.slang.2.expected.txt b/tests/compute/dump-repro.slang.2.expected.txt new file mode 100644 index 000000000..29f677b0f --- /dev/null +++ b/tests/compute/dump-repro.slang.2.expected.txt @@ -0,0 +1,8 @@ +1 +3 +5 +7 +9 +B +D +F |
