diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2021-01-15 12:10:06 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-15 12:10:06 -0800 |
| commit | 2a5d5b32348c33aac7ca62aa9a4c2bb7cff8e08a (patch) | |
| tree | 01c394d8a3551d3e191e538d27b82472b721f749 /tests/bugs | |
| parent | f834f25794cfb746079e92d58c7410b767c57208 (diff) | |
Convert more tests to use shader objects (#1659)
This change converts a large number of our existing tests to use the `ShaderObject` support that was added to the `gfx` layer.
In many cases, tests were just updated to pass `-shaderobj` and the result Just Worked.
In other cases, a `name` attribute had to be added to one or more `TEST_INPUT` lines.
For tests that did not work with shader objects "out of the box," I spent a little bit of time trying to get them work, but fell back to letting those tests run in the older mode.
Future changes to the infrastructure will be needed to get those additional tests working in the new path.
Along with the changes to test files, the following implementation changes were made to get additional tests working:
* Because the shader object mode uses explicit register bindings (from reflection), the hacky logic that was offseting `u` registers for D3D12 based on the number of render targets gets disabled (by another hack).
* The "flat" reflection information coming from Slang was not correctly reporting "binding ranges" for things that consumed only uniform data (which would be everything on CUDA/CPU), so it was refactored to properly include binding ranges for anything where the type of the field/variable implied a binding range should be created (even if the `LayoutResourceKind` was `::Uniform`).
* A few fixes were made to the CUDA implementation of `Renderer`, in order to get additional tests up and running. Most of these changes had to do with texture bindings, which hadn't really been tested previously.
In addition, a few changes were made that were attempts at getting more tests working, but didn't actually help. These could be dropped if requested:
* As a quality-of-life feature (not being used) the `object` style of `TEST_INPUT` line is upgraded to support inferring the type to use from the type of the input being set.
* Any `object` shader input lines get ignored in non-shader-object mode.
Diffstat (limited to 'tests/bugs')
25 files changed, 46 insertions, 46 deletions
diff --git a/tests/bugs/bool-init.slang b/tests/bugs/bool-init.slang index 1e9627024..51fa852f9 100644 --- a/tests/bugs/bool-init.slang +++ b/tests/bugs/bool-init.slang @@ -1,5 +1,5 @@ -//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -//TEST(compute,vulkan):COMPARE_COMPUTE_EX:-vk -slang -compute +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj +//TEST(compute,vulkan):COMPARE_COMPUTE_EX:-vk -slang -compute -shaderobj struct Thing { diff --git a/tests/bugs/bool-op.slang b/tests/bugs/bool-op.slang index c10c7e0dd..4d4b43221 100644 --- a/tests/bugs/bool-op.slang +++ b/tests/bugs/bool-op.slang @@ -1,6 +1,6 @@ // enum.slang -//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj +//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj // Confirm operations that produce bools - such as comparisons, or && ||, ! work correctly diff --git a/tests/bugs/dxbc-double-problem.slang b/tests/bugs/dxbc-double-problem.slang index 1cd3ab204..50abf4d7b 100644 --- a/tests/bugs/dxbc-double-problem.slang +++ b/tests/bugs/dxbc-double-problem.slang @@ -1,8 +1,8 @@ -//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -output-using-type -//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -output-using-type -//TEST(compute):COMPARE_COMPUTE_EX:-cpu -compute -output-using-type -//TEST(compute):COMPARE_COMPUTE_EX:-dx12 -compute -use-dxil -output-using-type -//DISABLE_TEST(compute):COMPARE_COMPUTE_EX:-dx12 -compute -output-using-type +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -output-using-type -shaderobj +//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -output-using-type -shaderobj +//TEST(compute):COMPARE_COMPUTE_EX:-cpu -compute -output-using-type -shaderobj +//TEST(compute):COMPARE_COMPUTE_EX:-dx12 -compute -use-dxil -output-using-type -shaderobj +//DISABLE_TEST(compute):COMPARE_COMPUTE_EX:-dx12 -compute -output-using-type -shaderobj // The problem this test shows is around handling of double with dxbc on D3D12. In that combination // this code does not write the correct value into the first element - it appears as 0, where diff --git a/tests/bugs/empty-switch.slang b/tests/bugs/empty-switch.slang index 104c63367..6ea38dcc7 100644 --- a/tests/bugs/empty-switch.slang +++ b/tests/bugs/empty-switch.slang @@ -1,7 +1,7 @@ -//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -//TEST(compute,vulkan):COMPARE_COMPUTE_EX:-vk -slang -compute -//TEST(compute):COMPARE_COMPUTE_EX:-cpu -slang -compute -//TEST(compute):COMPARE_COMPUTE_EX:-cuda -slang -compute +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj +//TEST(compute,vulkan):COMPARE_COMPUTE_EX:-vk -slang -compute -shaderobj +//TEST(compute):COMPARE_COMPUTE_EX:-cpu -slang -compute -shaderobj +//TEST(compute):COMPARE_COMPUTE_EX:-cuda -slang -compute -shaderobj //TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out, name outputBuffer RWStructuredBuffer<int> outputBuffer; diff --git a/tests/bugs/gh-357.slang b/tests/bugs/gh-357.slang index 90eba799b..522cabd7c 100644 --- a/tests/bugs/gh-357.slang +++ b/tests/bugs/gh-357.slang @@ -1,4 +1,4 @@ -//TEST(compute):COMPARE_COMPUTE: +//TEST(compute):COMPARE_COMPUTE: -shaderobj //TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer diff --git a/tests/bugs/gh-471.slang b/tests/bugs/gh-471.slang index adc50e799..e7b09760b 100644 --- a/tests/bugs/gh-471.slang +++ b/tests/bugs/gh-471.slang @@ -1,4 +1,4 @@ -//TEST(compute):COMPARE_COMPUTE: +//TEST(compute):COMPARE_COMPUTE: -shaderobj //TEST_INPUT:ubuffer(data=[0 1 2 3], stride=4):out,name outputBuffer // Test that "operator comma" works as expected diff --git a/tests/bugs/gh-487.slang b/tests/bugs/gh-487.slang index 08ae8aa06..e425dabe2 100644 --- a/tests/bugs/gh-487.slang +++ b/tests/bugs/gh-487.slang @@ -1,5 +1,5 @@ // gh-487.slang -//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj // This test is to confirm that we can apply builtin functions taht expect // a floating-point argument to an integer, with the compiler filling diff --git a/tests/bugs/gh-518.slang b/tests/bugs/gh-518.slang index 8de61a94e..16189ca9b 100644 --- a/tests/bugs/gh-518.slang +++ b/tests/bugs/gh-518.slang @@ -1,6 +1,6 @@ -//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12 -//TEST_DISABLED(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12 -shaderobj +//TEST_DISABLED(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj // Note: can't actually test this on Vulkan right now because // the support in render-test isn't good enough. diff --git a/tests/bugs/gh-519.slang b/tests/bugs/gh-519.slang index 207fa6d0a..368c7a617 100644 --- a/tests/bugs/gh-519.slang +++ b/tests/bugs/gh-519.slang @@ -1,6 +1,6 @@ -//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12 -//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12 -shaderobj +//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj // This bug involved incorrect computation of the successor // blocks for a `switch`, which led to incorrect SSA form. diff --git a/tests/bugs/gh-566.slang b/tests/bugs/gh-566.slang index 4c5fa1772..f1e53ba9a 100644 --- a/tests/bugs/gh-566.slang +++ b/tests/bugs/gh-566.slang @@ -1,6 +1,6 @@ // legalize-struct-init.slang -//TEST(compute):COMPARE_COMPUTE: +//TEST(compute):COMPARE_COMPUTE: -shaderobj //TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer //TEST_INPUT:ubuffer(data=[4 3 2 1], stride=4):name inputBuffer diff --git a/tests/bugs/gh-569.slang b/tests/bugs/gh-569.slang index 21fbfa514..0dc6eceda 100644 --- a/tests/bugs/gh-569.slang +++ b/tests/bugs/gh-569.slang @@ -1,5 +1,5 @@ // gh-569.slang -//TEST(compute):COMPARE_COMPUTE: +//TEST(compute):COMPARE_COMPUTE: -shaderobj // Test that correct scoping is used in generated HLSL/GLSL, // even when dominator tree and structured control flow disagree. diff --git a/tests/bugs/gh-775.slang b/tests/bugs/gh-775.slang index 867233919..d25fa493b 100644 --- a/tests/bugs/gh-775.slang +++ b/tests/bugs/gh-775.slang @@ -1,5 +1,5 @@ // gh-775.slang -//TEST(compute):COMPARE_COMPUTE: +//TEST(compute):COMPARE_COMPUTE: -shaderobj int test(int inVal) { diff --git a/tests/bugs/gl-33.slang b/tests/bugs/gl-33.slang index 10c9ea208..3050115e5 100644 --- a/tests/bugs/gl-33.slang +++ b/tests/bugs/gl-33.slang @@ -1,5 +1,5 @@ // gl-33.slang -//TEST(compute):COMPARE_COMPUTE: +//TEST(compute):COMPARE_COMPUTE: -shaderobj // Test for GitLab issue # 33 diff --git a/tests/bugs/glsl-static-const-array.slang b/tests/bugs/glsl-static-const-array.slang index 4d03d5ef8..f351af31b 100644 --- a/tests/bugs/glsl-static-const-array.slang +++ b/tests/bugs/glsl-static-const-array.slang @@ -1,6 +1,6 @@ // glsl-static-const-array.slang -//TEST(compute):COMPARE_COMPUTE:-vk +//TEST(compute):COMPARE_COMPUTE:-vk -shaderobj static const int gData[4] = { diff --git a/tests/bugs/mutating/mutating-generic-method.slang b/tests/bugs/mutating/mutating-generic-method.slang index 18f4d315b..625e70101 100644 --- a/tests/bugs/mutating/mutating-generic-method.slang +++ b/tests/bugs/mutating/mutating-generic-method.slang @@ -1,5 +1,5 @@ -//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -//TEST(compute,vulkan):COMPARE_COMPUTE_EX:-vk -slang -compute +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj +//TEST(compute,vulkan):COMPARE_COMPUTE_EX:-vk -slang -compute -shaderobj // Confirm that a generic method marked `[mutating]` // produces an `inout` parameter for `this`. @@ -38,7 +38,7 @@ int test(int val) return r.state; } -//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out, name outputBuffer RWStructuredBuffer<int> outputBuffer; [numthreads(4, 1, 1)] diff --git a/tests/bugs/negative-literal.slang b/tests/bugs/negative-literal.slang index 586cd601c..66fc90edf 100644 --- a/tests/bugs/negative-literal.slang +++ b/tests/bugs/negative-literal.slang @@ -1,7 +1,7 @@ -//TEST(compute):COMPARE_COMPUTE_EX:-cpu -compute -compile-arg -O3 -//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12 -//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute +//TEST(compute):COMPARE_COMPUTE_EX:-cpu -compute -compile-arg -O3 -shaderobj +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12 -shaderobj +//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj //TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer RWStructuredBuffer<float> outputBuffer; diff --git a/tests/bugs/nested-generics-call.slang b/tests/bugs/nested-generics-call.slang index ba1566ec2..e3073e827 100644 --- a/tests/bugs/nested-generics-call.slang +++ b/tests/bugs/nested-generics-call.slang @@ -1,4 +1,4 @@ -//TEST(compute):COMPARE_COMPUTE: +//TEST(compute):COMPARE_COMPUTE: -shaderobj //TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer RWStructuredBuffer<float> outputBuffer; diff --git a/tests/bugs/nested-generics-method-call.slang b/tests/bugs/nested-generics-method-call.slang index fa0a983b9..a3a9814d1 100644 --- a/tests/bugs/nested-generics-method-call.slang +++ b/tests/bugs/nested-generics-method-call.slang @@ -1,4 +1,4 @@ -//TEST(compute):COMPARE_COMPUTE: +//TEST(compute):COMPARE_COMPUTE: -shaderobj //TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer RWStructuredBuffer<float> outputBuffer; diff --git a/tests/bugs/paren-insertion-bug.slang b/tests/bugs/paren-insertion-bug.slang index 790934372..dfbcd9a41 100644 --- a/tests/bugs/paren-insertion-bug.slang +++ b/tests/bugs/paren-insertion-bug.slang @@ -3,7 +3,7 @@ // Confirm that precedence is correctly handled // for cast from scalar to vector. -//TEST(compute):COMPARE_COMPUTE: +//TEST(compute):COMPARE_COMPUTE: -shaderobj int test(float a) { diff --git a/tests/bugs/specialize-function-array-args.slang b/tests/bugs/specialize-function-array-args.slang index 6b7ec44b4..8a572eda4 100644 --- a/tests/bugs/specialize-function-array-args.slang +++ b/tests/bugs/specialize-function-array-args.slang @@ -1,5 +1,5 @@ -//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -//TEST(compute,vulkan):COMPARE_COMPUTE_EX:-vk -slang -compute +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj +//TEST(compute,vulkan):COMPARE_COMPUTE_EX:-vk -slang -compute -shaderobj // When a function is passed a parameter that contains an array, it specialized it as a performance // improvement for VK. If the struct contained a structured buffer, though it meant that the diff --git a/tests/bugs/ssa-loop.slang b/tests/bugs/ssa-loop.slang index 722c40d98..4f15f8bed 100644 --- a/tests/bugs/ssa-loop.slang +++ b/tests/bugs/ssa-loop.slang @@ -2,7 +2,7 @@ // Bug related to SSA form for loops -//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj int test(int val) { diff --git a/tests/bugs/static-method.slang b/tests/bugs/static-method.slang index f95d40def..4f2d363f2 100644 --- a/tests/bugs/static-method.slang +++ b/tests/bugs/static-method.slang @@ -1,6 +1,6 @@ // static-method.slang -//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj struct S { diff --git a/tests/bugs/static-var.slang b/tests/bugs/static-var.slang index 75662c7b5..004567466 100644 --- a/tests/bugs/static-var.slang +++ b/tests/bugs/static-var.slang @@ -1,5 +1,5 @@ // gh-775-ext.slang -//TEST(compute):COMPARE_COMPUTE: +//TEST(compute):COMPARE_COMPUTE: -shaderobj int test(int inVal) { diff --git a/tests/bugs/vec-compare.slang b/tests/bugs/vec-compare.slang index 7a6d8388d..184e57a49 100644 --- a/tests/bugs/vec-compare.slang +++ b/tests/bugs/vec-compare.slang @@ -1,6 +1,6 @@ -//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12 -//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12 -shaderobj +//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj //TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], stride=4):out,name outputBuffer RWStructuredBuffer<int> outputBuffer; diff --git a/tests/bugs/while-in-generic.slang b/tests/bugs/while-in-generic.slang index 4efa9a5d2..63a459eaa 100644 --- a/tests/bugs/while-in-generic.slang +++ b/tests/bugs/while-in-generic.slang @@ -1,4 +1,4 @@ -//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj struct Context { int genFunc<TGenType>(TGenType t) |
