summaryrefslogtreecommitdiffstats
path: root/tests/bugs
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2019-11-21 14:06:19 -0800
committerGitHub <noreply@github.com>2019-11-21 14:06:19 -0800
commit2ea64ff4f2c7c43b72ff24650330fca79a87500f (patch)
tree715f12e80ae04fd3b5073b0b300b578d3a605da8 /tests/bugs
parentcc37fb01b55a351c5fd703160dfd5249cad640e7 (diff)
Remove support for explicit register/binding syntax on TEST_INPUT (#1132)
The `TEST_INPUT` facility allows textual Slang test cases to provide two kinds of information to the `render-test` tool: 1. Information on what shader inputs exist 2. Information on what values/objects to bind into those shader inputs Under the first category of information, there exists supporting for attaching a `dxbinding(...)` annotation to a `TEST_INPUT` which seemingly indicates what HLSL `register` the input uses. There is a similar `glbinding(...)` annotation, used for OpenGL and Vulkan. It turns out that these annotations were, in practice, completely ignored and had no bearing on how `render-test` allocates or bindings graphics API objects. There was some amount of code attempting to validate that explicit registers/bindings were being set appropriately, but the actual values were being ignored. The visible consequence of the `dxbinding` and `glbinding` annotations being ignored is issue #1036: the order of `TEST_INPUT` lines was *de facto* determining the registers/bindings that were being used by `render-test`. This change simply removes the placebo features and strips things down to what is implemented in practice: the `TEST_INPUT` lines do not need target-API-specific binding/register numbers, because their order in the file implicitly defines them. I added logic to the parsing of `TEST_INPUT` lines to make sure I got an error message on any leftover annotations, and went ahead and systematicaly deleted all of the placebo annotations from our test cases. If we decide to make `TEST_INPUT` lines *not* depend on order of declaration in the future, we can build it up as a new and better considered feature. The main alternative I considered was to keep the annotations in place, and change `render-test` and the `gfx` abstraction layer to properly respect them, but that path actually creates much more opportunity for breakage (since every single test case would suddenly be specifying its root signature / pipeline layout via a different path using data that has never been tested). The approach in this change has the benefit of giving me high confidence that all the test cases continue to work just as they had before.
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/bool-init.slang2
-rw-r--r--tests/bugs/bool-op.slang2
-rw-r--r--tests/bugs/gh-357.slang2
-rw-r--r--tests/bugs/gh-471.slang2
-rw-r--r--tests/bugs/gh-487.slang2
-rw-r--r--tests/bugs/gh-518.slang6
-rw-r--r--tests/bugs/gh-519.slang2
-rw-r--r--tests/bugs/gh-566.slang4
-rw-r--r--tests/bugs/gh-569.slang2
-rw-r--r--tests/bugs/gh-775.slang2
-rw-r--r--tests/bugs/gl-33.slang2
-rw-r--r--tests/bugs/glsl-static-const-array.slang2
-rw-r--r--tests/bugs/nested-generics-call.slang2
-rw-r--r--tests/bugs/nested-generics-method-call.slang2
-rw-r--r--tests/bugs/paren-insertion-bug.slang2
-rw-r--r--tests/bugs/static-var.slang2
-rw-r--r--tests/bugs/texture2d-gather.hlsl4
-rw-r--r--tests/bugs/vec-compare.slang2
-rw-r--r--tests/bugs/while-in-generic.slang2
19 files changed, 23 insertions, 23 deletions
diff --git a/tests/bugs/bool-init.slang b/tests/bugs/bool-init.slang
index 95b577c33..7484d450e 100644
--- a/tests/bugs/bool-init.slang
+++ b/tests/bugs/bool-init.slang
@@ -7,7 +7,7 @@ struct Thing
bool b;
};
-//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out
RWStructuredBuffer<int> outputBuffer;
[numthreads(4, 1, 1)]
diff --git a/tests/bugs/bool-op.slang b/tests/bugs/bool-op.slang
index 1388ef8f1..1ce5d7c4f 100644
--- a/tests/bugs/bool-op.slang
+++ b/tests/bugs/bool-op.slang
@@ -4,7 +4,7 @@
// Confirm operations that produce bools - such as comparisons, or && ||, ! work correctly
-//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
+//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], stride=4):out
RWStructuredBuffer<int> outputBuffer;
[numthreads(16, 1, 1)]
diff --git a/tests/bugs/gh-357.slang b/tests/bugs/gh-357.slang
index 043eebf17..7c2a87a41 100644
--- a/tests/bugs/gh-357.slang
+++ b/tests/bugs/gh-357.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE:
-//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out
//TEST_INPUT:type AssocImpl
diff --git a/tests/bugs/gh-471.slang b/tests/bugs/gh-471.slang
index d7123bb4e..a68ade010 100644
--- a/tests/bugs/gh-471.slang
+++ b/tests/bugs/gh-471.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE:
-//TEST_INPUT:ubuffer(data=[0 1 2 3], stride=4):dxbinding(0),glbinding(0),out
+//TEST_INPUT:ubuffer(data=[0 1 2 3], stride=4):out
// Test that "operator comma" works as expected
diff --git a/tests/bugs/gh-487.slang b/tests/bugs/gh-487.slang
index ee01ee9b1..a86c4061f 100644
--- a/tests/bugs/gh-487.slang
+++ b/tests/bugs/gh-487.slang
@@ -15,7 +15,7 @@ int test(int val)
return int(result);
}
-//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out
RWStructuredBuffer<int> gBuffer;
[numthreads(4, 1, 1)]
diff --git a/tests/bugs/gh-518.slang b/tests/bugs/gh-518.slang
index 96a101db2..3f316c19e 100644
--- a/tests/bugs/gh-518.slang
+++ b/tests/bugs/gh-518.slang
@@ -8,11 +8,11 @@
// Confirm that we can handle arrays of resources
// being passed to a function.
-//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out
RWStructuredBuffer<int> gBuffer;
-//TEST_INPUT: Texture2D(size=4, content=one):dxbinding(0),glbinding(0)
-//TEST_INPUT: Texture2D(size=4, content=one):dxbinding(1),glbinding(1)
+//TEST_INPUT: Texture2D(size=4, content=one):
+//TEST_INPUT: Texture2D(size=4, content=one):
Texture2D gTextures[2];
float broken(Texture2D t[2])
diff --git a/tests/bugs/gh-519.slang b/tests/bugs/gh-519.slang
index 35bf6dcd7..733864c85 100644
--- a/tests/bugs/gh-519.slang
+++ b/tests/bugs/gh-519.slang
@@ -29,7 +29,7 @@ int test(int val)
return tmp;
}
-//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out
RWStructuredBuffer<int> gBuffer;
[numthreads(4, 1, 1)]
diff --git a/tests/bugs/gh-566.slang b/tests/bugs/gh-566.slang
index eeb8c1639..5e5803aea 100644
--- a/tests/bugs/gh-566.slang
+++ b/tests/bugs/gh-566.slang
@@ -1,8 +1,8 @@
// legalize-struct-init.slang
//TEST(compute):COMPARE_COMPUTE:
-//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
-//TEST_INPUT:ubuffer(data=[4 3 2 1], stride=4):dxbinding(1),glbinding(1)
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out
+//TEST_INPUT:ubuffer(data=[4 3 2 1], stride=4):
RWStructuredBuffer<uint> outputBuffer;
diff --git a/tests/bugs/gh-569.slang b/tests/bugs/gh-569.slang
index fa7525d45..c0a65aaa8 100644
--- a/tests/bugs/gh-569.slang
+++ b/tests/bugs/gh-569.slang
@@ -21,7 +21,7 @@ uint test(uint inVal)
return tmp + inVal;
}
-//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out
RWStructuredBuffer<uint> gBuffer;
[numthreads(4, 1, 1)]
diff --git a/tests/bugs/gh-775.slang b/tests/bugs/gh-775.slang
index f8125d7d4..f98765bdb 100644
--- a/tests/bugs/gh-775.slang
+++ b/tests/bugs/gh-775.slang
@@ -17,7 +17,7 @@ int test(int inVal)
return int(dot(v, float4(1, 16, 256, 4096)));
}
-//TEST_INPUT:ubuffer(data=[9 9 9 9], stride=4):dxbinding(0),glbinding(0),out
+//TEST_INPUT:ubuffer(data=[9 9 9 9], stride=4):out
RWStructuredBuffer<int> outputBuffer : register(u0);
[numthreads(4, 1, 1)]
diff --git a/tests/bugs/gl-33.slang b/tests/bugs/gl-33.slang
index 89cfa0aad..b459bf409 100644
--- a/tests/bugs/gl-33.slang
+++ b/tests/bugs/gl-33.slang
@@ -13,7 +13,7 @@ int test(int val)
return b.next();
}
-//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out
RWStructuredBuffer<int> gBuffer;
[numthreads(4, 1, 1)]
diff --git a/tests/bugs/glsl-static-const-array.slang b/tests/bugs/glsl-static-const-array.slang
index fb573c690..f4e953259 100644
--- a/tests/bugs/glsl-static-const-array.slang
+++ b/tests/bugs/glsl-static-const-array.slang
@@ -7,7 +7,7 @@ static const int gData[4] =
0xA, 0xB, 0xC, 0xD,
};
-//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out
RWStructuredBuffer<int> gBuffer;
[numthreads(4,1,1)]
diff --git a/tests/bugs/nested-generics-call.slang b/tests/bugs/nested-generics-call.slang
index 438cbb86c..9a540a261 100644
--- a/tests/bugs/nested-generics-call.slang
+++ b/tests/bugs/nested-generics-call.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE:
-//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out
RWStructuredBuffer<float> outputBuffer;
diff --git a/tests/bugs/nested-generics-method-call.slang b/tests/bugs/nested-generics-method-call.slang
index a09a25855..a127ed0da 100644
--- a/tests/bugs/nested-generics-method-call.slang
+++ b/tests/bugs/nested-generics-method-call.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE:
-//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out
RWStructuredBuffer<float> outputBuffer;
diff --git a/tests/bugs/paren-insertion-bug.slang b/tests/bugs/paren-insertion-bug.slang
index 608f8a9dd..6c989d793 100644
--- a/tests/bugs/paren-insertion-bug.slang
+++ b/tests/bugs/paren-insertion-bug.slang
@@ -19,7 +19,7 @@ int test(float a)
}
-//TEST_INPUT: ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
+//TEST_INPUT: ubuffer(data=[0 0 0 0], stride=4):out
RWStructuredBuffer<uint> outputBuffer;
[numthreads(4, 1, 1)]
diff --git a/tests/bugs/static-var.slang b/tests/bugs/static-var.slang
index f060586ad..d130b6a7d 100644
--- a/tests/bugs/static-var.slang
+++ b/tests/bugs/static-var.slang
@@ -7,7 +7,7 @@ int test(int inVal)
return inVal + kVal;
}
-//TEST_INPUT:ubuffer(data=[9 9 9 9], stride=4):dxbinding(0),glbinding(0),out
+//TEST_INPUT:ubuffer(data=[9 9 9 9], stride=4):out
RWStructuredBuffer<int> outputBuffer : register(u0);
[numthreads(4, 1, 1)]
diff --git a/tests/bugs/texture2d-gather.hlsl b/tests/bugs/texture2d-gather.hlsl
index 63d036906..2fc9424c5 100644
--- a/tests/bugs/texture2d-gather.hlsl
+++ b/tests/bugs/texture2d-gather.hlsl
@@ -1,6 +1,6 @@
//TEST(smoke):COMPARE_HLSL_RENDER:
-//TEST_INPUT: Texture2D(size=16, content=chessboard, format=R_Float32):dxbinding(0),glbinding(0)
-//TEST_INPUT: Sampler : dxbinding(0),glbinding(0)
+//TEST_INPUT: Texture2D(size=16, content=chessboard, format=R_Float32):
+//TEST_INPUT: Sampler :
Texture2D<float> g_texture : register(t0);
SamplerState g_sampler : register(s0);
diff --git a/tests/bugs/vec-compare.slang b/tests/bugs/vec-compare.slang
index b3075efe9..2b233f80f 100644
--- a/tests/bugs/vec-compare.slang
+++ b/tests/bugs/vec-compare.slang
@@ -2,7 +2,7 @@
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12
//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute
-//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
+//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], stride=4):out
RWStructuredBuffer<int> outputBuffer;
diff --git a/tests/bugs/while-in-generic.slang b/tests/bugs/while-in-generic.slang
index ea34238f5..7d2b8b255 100644
--- a/tests/bugs/while-in-generic.slang
+++ b/tests/bugs/while-in-generic.slang
@@ -12,7 +12,7 @@ struct Context
return i;
}
};
-//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out
RWStructuredBuffer<int> outputBuffer;
[numthreads(4, 1, 1)]