summaryrefslogtreecommitdiffstats
path: root/tests/compute
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2020-12-03 08:23:05 -0800
committerGitHub <noreply@github.com>2020-12-03 08:23:05 -0800
commit44c0a56974b664e50b2cb8cb6f10740b19c4e02f (patch)
treed6141003be376bdb2c0037178b649b6b2aae673e /tests/compute
parentad5dda9261bae63e32bcb914b109fcb5c92faf25 (diff)
Add shader object parameter binding to renderer_test. (#1622)
* Add shader object parameter binding to renderer_test. * remove multiple-definitions.hlsl * Fix cuda implementation. Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'tests/compute')
-rw-r--r--tests/compute/cbuffer-legalize.slang6
-rw-r--r--tests/compute/compile-time-loop.slang6
-rw-r--r--tests/compute/constexpr.slang7
-rw-r--r--tests/compute/discard-stmt.slang6
-rw-r--r--tests/compute/dump-repro.slang2
-rw-r--r--tests/compute/global-generic-value-param.slang4
-rw-r--r--tests/compute/global-type-param-array.slang5
-rw-r--r--tests/compute/global-type-param-in-entrypoint.slang5
-rw-r--r--tests/compute/global-type-param1.slang16
-rw-r--r--tests/compute/global-type-param2.slang16
-rw-r--r--tests/compute/half-calc.slang3
-rw-r--r--tests/compute/half-structured-buffer.slang3
-rw-r--r--tests/compute/interface-shader-param.slang2
-rw-r--r--tests/compute/interface-shader-param4.slang4
-rw-r--r--tests/compute/matrix-layout-structured-buffer.slang2
-rw-r--r--tests/compute/matrix-layout.hlsl4
16 files changed, 50 insertions, 41 deletions
diff --git a/tests/compute/cbuffer-legalize.slang b/tests/compute/cbuffer-legalize.slang
index bbb08b565..416eded1e 100644
--- a/tests/compute/cbuffer-legalize.slang
+++ b/tests/compute/cbuffer-legalize.slang
@@ -1,8 +1,8 @@
//TEST(compute):COMPARE_COMPUTE:-cpu
-//TEST(compute):COMPARE_COMPUTE:
+//TEST(compute):COMPARE_COMPUTE:-shaderobj
-//TEST_INPUT:cbuffer(data=[1 2 3 4]):name=C.p.c
-//TEST_INPUT:Texture2D(size=4, content = one):name=C.p.t
+//TEST_INPUT: Uniform(data=[1 2 3 4]):name=C.p.c
+//TEST_INPUT: Texture2D(size=4, content = one):name=C.p.t
//TEST_INPUT: Sampler:name=C.p.s
//TEST_INPUT: ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
diff --git a/tests/compute/compile-time-loop.slang b/tests/compute/compile-time-loop.slang
index e081dfbd3..128e72895 100644
--- a/tests/compute/compile-time-loop.slang
+++ b/tests/compute/compile-time-loop.slang
@@ -1,8 +1,8 @@
//TEST(compute):COMPARE_RENDER_COMPUTE:
-//TEST_INPUT: Texture2D(size=4, content = one):
-//TEST_INPUT: Sampler:
-//TEST_INPUT: ubuffer(data=[0], stride=4):out
+//TEST_INPUT: Texture2D(size=4, content = one):name t
+//TEST_INPUT: Sampler:name s
+//TEST_INPUT: ubuffer(data=[0], stride=4):out, name outputBuffer
Texture2D t;
SamplerState s;
diff --git a/tests/compute/constexpr.slang b/tests/compute/constexpr.slang
index 247d3964d..cb14b1a9c 100644
--- a/tests/compute/constexpr.slang
+++ b/tests/compute/constexpr.slang
@@ -1,9 +1,10 @@
// constexpr.slang
//TEST(compute):COMPARE_COMPUTE_EX:-slang -gcompute
//DISABLED://TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -gcompute
-//TEST_INPUT: Texture2D(size=4, content = one):
-//TEST_INPUT: Sampler:
-//TEST_INPUT: ubuffer(data=[0 0], stride=4):out
+
+//TEST_INPUT: Texture2D(size=4, content = one):name tex
+//TEST_INPUT: Sampler:name samp
+//TEST_INPUT: ubuffer(data=[0 0], stride=4):out,name outputBuffer
// Note: Vulkan version of this test is disabled pending adding
// support for rendering tests to the harness.
diff --git a/tests/compute/discard-stmt.slang b/tests/compute/discard-stmt.slang
index 5a8210118..1af42c6a0 100644
--- a/tests/compute/discard-stmt.slang
+++ b/tests/compute/discard-stmt.slang
@@ -1,7 +1,7 @@
//TEST(compute):COMPARE_RENDER_COMPUTE:
-//TEST_INPUT: Texture2D(size=4, content = one):
-//TEST_INPUT: Sampler:
-//TEST_INPUT: ubuffer(data=[0 0], stride=4):out
+//TEST_INPUT: Texture2D(size=4, content = one):name tex
+//TEST_INPUT: Sampler:name samp
+//TEST_INPUT: ubuffer(data=[0 0], stride=4):out,name outputBuffer
Texture2D tex;
diff --git a/tests/compute/dump-repro.slang b/tests/compute/dump-repro.slang
index dd07574ad..90a9578fa 100644
--- a/tests/compute/dump-repro.slang
+++ b/tests/compute/dump-repro.slang
@@ -13,4 +13,4 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
int index = int(dispatchThreadID.x);
outputBuffer[index] = index * 2 + 1;
-} \ No newline at end of file
+}
diff --git a/tests/compute/global-generic-value-param.slang b/tests/compute/global-generic-value-param.slang
index 6214925c6..d2299e501 100644
--- a/tests/compute/global-generic-value-param.slang
+++ b/tests/compute/global-generic-value-param.slang
@@ -29,7 +29,7 @@ __generic_value_param kOffset : uint = 0;
// bit less trivial.
//
RWStructuredBuffer<uint> vals;
-//TEST_INPUT: ubuffer(data=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15], stride=4):
+//TEST_INPUT: ubuffer(data=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15], stride=4):name vals
// The core test function will use the `kOffset` value
// we declared above along with the input value (the
@@ -45,7 +45,7 @@ uint test(uint value)
// And finally we have the boilerplate cruft that almost
// all of our compute tests use.
-//TEST_INPUT: ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], stride=4):out
+//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<uint> outputBuffer;
[numthreads(16, 1, 1)]
diff --git a/tests/compute/global-type-param-array.slang b/tests/compute/global-type-param-array.slang
index ac514901f..f763f49fd 100644
--- a/tests/compute/global-type-param-array.slang
+++ b/tests/compute/global-type-param-array.slang
@@ -1,6 +1,7 @@
//TEST(compute):COMPARE_COMPUTE:
-//TEST_INPUT: cbuffer(data=[1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0], stride=4):
-//TEST_INPUT: ubuffer(data=[0], stride=4):out
+
+//TEST_INPUT: cbuffer(data=[1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0], stride=4):name impl
+//TEST_INPUT: ubuffer(data=[0], stride=4):out,name outputBuffer
//TEST_INPUT: type Pair<Arr<Base,1>, Pair<Arr<Base,2> , Base> >
RWStructuredBuffer<float> outputBuffer;
diff --git a/tests/compute/global-type-param-in-entrypoint.slang b/tests/compute/global-type-param-in-entrypoint.slang
index 06320ba0f..b2a1146d8 100644
--- a/tests/compute/global-type-param-in-entrypoint.slang
+++ b/tests/compute/global-type-param-in-entrypoint.slang
@@ -1,6 +1,7 @@
//TEST(compute):COMPARE_RENDER_COMPUTE:
-//TEST_INPUT: cbuffer(data=[1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0], stride=16):
-//TEST_INPUT: ubuffer(data=[0 0 0 0], stride=4):out
+
+//TEST_INPUT: cbuffer(data=[1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0], stride=16):name Uniforms
+//TEST_INPUT: ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer
//TEST_INPUT: global_type VertImpl
interface IVertInterpolant
diff --git a/tests/compute/global-type-param1.slang b/tests/compute/global-type-param1.slang
index 5362af5e0..b5560e9d9 100644
--- a/tests/compute/global-type-param1.slang
+++ b/tests/compute/global-type-param1.slang
@@ -1,11 +1,13 @@
//TEST(smoke,compute):COMPARE_COMPUTE:
-//TEST_INPUT: cbuffer(data=[0.5 0 0 0 1.0], stride=4):
-//TEST_INPUT: cbuffer(data=[1.0], stride=4):
-//TEST_INPUT: Texture2D(size=4, content = zero):
-//TEST_INPUT: Texture2D(size=4, content = one):
-//TEST_INPUT: Sampler:
-//TEST_INPUT: Sampler:
-//TEST_INPUT: ubuffer(data=[0], stride=4):out
+
+
+//TEST_INPUT: ubuffer(data=[0], stride=4):out,name outputBufer
+//TEST_INPUT: cbuffer(data=[0.5 0 0 0 1.0], stride=4):name C
+//TEST_INPUT: cbuffer(data=[1.0], stride=4):name impl.base
+//TEST_INPUT: Texture2D(size=4, content = zero):name tex1
+//TEST_INPUT: Texture2D(size=4, content = one):name impl.tex
+//TEST_INPUT: Sampler:name sampler
+//TEST_INPUT: Sampler:name impl.sampler
//TEST_INPUT: type Impl
RWStructuredBuffer<float> outputBuffer;
diff --git a/tests/compute/global-type-param2.slang b/tests/compute/global-type-param2.slang
index d731e356a..39701f16f 100644
--- a/tests/compute/global-type-param2.slang
+++ b/tests/compute/global-type-param2.slang
@@ -1,11 +1,13 @@
//TEST(smoke,compute):COMPARE_COMPUTE:
-//TEST_INPUT: cbuffer(data=[0.5 0 0 0], stride=4):
-//TEST_INPUT: cbuffer(data=[1.0], stride=4):
-//TEST_INPUT: Texture2D(size=4, content = zero):
-//TEST_INPUT: Texture2D(size=4, content = one):
-//TEST_INPUT: Sampler:
-//TEST_INPUT: Sampler:
-//TEST_INPUT: ubuffer(data=[0], stride=4):out
+
+//TEST_INPUT: ubuffer(data=[0], stride=4):out,name outputBuffer
+//TEST_INPUT: cbuffer(data=[0.5 0 0 0], stride=4):name existingBuffer
+//__disabled__TEST_INPUT: object(type=Impl):name impl
+//TEST_INPUT: root_constants(data=[1.0], stride=4):name impl.base
+//TEST_INPUT: Texture2D(size=4, content = zero):name tex1
+//TEST_INPUT: Texture2D(size=4, content = one):name impl.tex
+//TEST_INPUT: Sampler:name sampler
+//TEST_INPUT: Sampler:name impl.sampler
//TEST_INPUT: type Impl
diff --git a/tests/compute/half-calc.slang b/tests/compute/half-calc.slang
index 7c94a0d4f..b9ed7c439 100644
--- a/tests/compute/half-calc.slang
+++ b/tests/compute/half-calc.slang
@@ -1,9 +1,10 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE:-dx12 -compute -use-dxil -profile cs_6_2 -render-features half
//TEST(compute):COMPARE_COMPUTE:-vk -compute -profile cs_6_2 -render-features half
-//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out
+
// Test for doing a calculation using half
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer
RWStructuredBuffer<float> outputBuffer;
[numthreads(4, 1, 1)]
diff --git a/tests/compute/half-structured-buffer.slang b/tests/compute/half-structured-buffer.slang
index 08323913e..abccfb32a 100644
--- a/tests/compute/half-structured-buffer.slang
+++ b/tests/compute/half-structured-buffer.slang
@@ -2,8 +2,6 @@
//Disable on Dx12 for now - because writing to structured buffer produces unexpected results
//TEST_DISABLED(compute):COMPARE_COMPUTE:-dx12 -compute -use-dxil -profile cs_6_2 -render-features half
-//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], stride=16):out
-
struct Thing
{
uint pos;
@@ -11,6 +9,7 @@ struct Thing
half4 color;
};
+//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], stride=16):out,name outputBuffer
RWStructuredBuffer<Thing> outputBuffer;
[numthreads(4, 1, 1)]
diff --git a/tests/compute/interface-shader-param.slang b/tests/compute/interface-shader-param.slang
index dde7bf2a6..d4bc1d7fa 100644
--- a/tests/compute/interface-shader-param.slang
+++ b/tests/compute/interface-shader-param.slang
@@ -96,12 +96,14 @@ RWStructuredBuffer<int> gOutputBuffer;
// Now we'll define a global shader parameter for the
// random number generation strategy.
//
+//__disabled__TEST_INPUT:object(type=MyStrategy):name=gStrategy
uniform IRandomNumberGenerationStrategy gStrategy;
// The other parameter (for the modifier) will be attached
// the entry point instead, so that we are testing both
// cases.
//
+//__disabled__TEST_INPUT:object(type=MyModifier):name=modifier
[numthreads(4, 1, 1)]
void computeMain(
//TEST_INPUT:root_constants(data=[0], stride=4):
diff --git a/tests/compute/interface-shader-param4.slang b/tests/compute/interface-shader-param4.slang
index da57175e9..fe8e6b374 100644
--- a/tests/compute/interface-shader-param4.slang
+++ b/tests/compute/interface-shader-param4.slang
@@ -44,7 +44,7 @@ int test(
}
-//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=gOutputBuffer
RWStructuredBuffer<int> gOutputBuffer;
// Note: a constant buffer register/binding is always claimed
@@ -53,7 +53,7 @@ RWStructuredBuffer<int> gOutputBuffer;
// that gets plugged in will involve uniform/ordinary data
// or not.
//
-//TEST_INPUT:cbuffer(data=[0]):
+//TEST_INPUT:cbuffer(data=[0]):name=gStrategy
//
ConstantBuffer<IRandomNumberGenerationStrategy> gStrategy;
diff --git a/tests/compute/matrix-layout-structured-buffer.slang b/tests/compute/matrix-layout-structured-buffer.slang
index bb7dbb381..56112f959 100644
--- a/tests/compute/matrix-layout-structured-buffer.slang
+++ b/tests/compute/matrix-layout-structured-buffer.slang
@@ -26,7 +26,7 @@ int test(int val)
return tmp;
}
-//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0], stride=4):out
+//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0], stride=4):out,name=buffer
RWStructuredBuffer<int> buffer;
[numthreads(12, 1, 1)]
diff --git a/tests/compute/matrix-layout.hlsl b/tests/compute/matrix-layout.hlsl
index 0993a1bb2..a7a167926 100644
--- a/tests/compute/matrix-layout.hlsl
+++ b/tests/compute/matrix-layout.hlsl
@@ -23,13 +23,13 @@ struct S
int b;
};
-//TEST_INPUT:cbuffer(data=[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24]):
+//TEST_INPUT:cbuffer(data=[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24]):name=C0
cbuffer C0
{
S s;
};
-//TEST_INPUT:cbuffer(data=[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24]):
+//TEST_INPUT:cbuffer(data=[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24]):name=C1
cbuffer C1
{