Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/HansKristian-Work/vkd3d-proton.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Kristian Arntzen <post@arntzen-software.no>2022-07-15 14:03:04 +0300
committerHans-Kristian Arntzen <post@arntzen-software.no>2022-07-15 14:16:26 +0300
commit5a58ed3ecf3b77f79ca5c0d7bf63ad12fa479f04 (patch)
tree1f27d0a10a4a2e4ce57c28a33a4e5bcaeb7eb80b
parent22e2fd43efc11a481cd26120a582d8fd953a2769 (diff)
tests: Add test creating root signature without RTS0 blob.root-signature-parse-empty-fix
We're supposed to fail here, but we ended up failing due to parsing uninitialized version instead, meaning it could spuriously succeed or read garbage. Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
-rw-r--r--tests/d3d12_root_signature.c33
-rw-r--r--tests/d3d12_tests.h1
2 files changed, 34 insertions, 0 deletions
diff --git a/tests/d3d12_root_signature.c b/tests/d3d12_root_signature.c
index 07742d71..8e7d0545 100644
--- a/tests/d3d12_root_signature.c
+++ b/tests/d3d12_root_signature.c
@@ -1467,3 +1467,36 @@ void test_missing_bindings_root_signature(void)
destroy_test_context(&context);
}
+void test_root_signature_empty_blob(void)
+{
+ ID3D12RootSignature *root_signature;
+ struct test_context context;
+ HRESULT hr;
+
+ static const DWORD cs_code[] =
+ {
+#if 0
+ RWStructuredBuffer<uint> RWBuf;
+
+ [numthreads(1, 1, 1)]
+ void main(int wg : SV_GroupID)
+ {
+ RWBuf[wg] = wg;
+ }
+#endif
+ 0x43425844, 0x81a88c98, 0x1ab24abd, 0xfdb8fb1f, 0x7e9cb035, 0x00000001, 0x000000a8, 0x00000003,
+ 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
+ 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x00000054, 0x00050050, 0x00000015, 0x0100086a,
+ 0x0400009e, 0x0011e000, 0x00000000, 0x00000004, 0x0200005f, 0x00021012, 0x0400009b, 0x00000001,
+ 0x00000001, 0x00000001, 0x070000a8, 0x0011e012, 0x00000000, 0x0002100a, 0x00004001, 0x00000000,
+ 0x0002100a, 0x0100003e,
+ };
+
+ if (!init_compute_test_context(&context))
+ return;
+
+ hr = ID3D12Device_CreateRootSignature(context.device, 0, cs_code, sizeof(cs_code), &IID_ID3D12RootSignature, (void **)&root_signature);
+ /* Has to be E_FAIL, not E_INVALIDARG, oddly enough. */
+ ok(hr == E_FAIL, "Unexpected hr #%x.\n", hr);
+ destroy_test_context(&context);
+}
diff --git a/tests/d3d12_tests.h b/tests/d3d12_tests.h
index 98244536..f33e9c6a 100644
--- a/tests/d3d12_tests.h
+++ b/tests/d3d12_tests.h
@@ -317,3 +317,4 @@ decl_test(test_raytracing_reject_duplicate_objects);
decl_test(test_raytracing_embedded_subobjects);
decl_test(test_raytracing_default_association_tiebreak);
decl_test(test_raytracing_collection_identifiers);
+decl_test(test_root_signature_empty_blob); \ No newline at end of file