From a27dfbe759fdafa6f29d9faadcd5a04d70221b04 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Thu, 3 Mar 2022 14:24:03 +0100 Subject: [PATCH] d3d10/tests: Add tests for Direct3D 10 shader reflection interfaces. Signed-off-by: Zebediah Figura Signed-off-by: Matteo Bruni Signed-off-by: Alexandre Julliard --- dlls/d3dcompiler_43/tests/reflection.c | 29 +++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/dlls/d3dcompiler_43/tests/reflection.c b/dlls/d3dcompiler_43/tests/reflection.c index 9c8247790c5..bd9179779e9 100644 --- a/dlls/d3dcompiler_43/tests/reflection.c +++ b/dlls/d3dcompiler_43/tests/reflection.c @@ -53,7 +53,6 @@ static DWORD shader_creator[] = { 0x39207265, 0x2e39322e, 0x2e323539, 0x31313133, 0xababab00, }; -#if D3D_COMPILER_VERSION /* * fxc.exe /E VS /Tvs_4_0 /Fx */ @@ -81,6 +80,7 @@ static DWORD test_reflection_blob[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; +#if D3D_COMPILER_VERSION static void test_reflection_references(void) { ID3D11ShaderReflection *ref11, *ref11_test; @@ -212,6 +212,31 @@ static void test_reflection_interfaces(void) count = ref11->lpVtbl->Release(ref11); ok(!count, "Got unexpected ref count %lu.\n", count); } +#else +static void test_d3d10_interfaces(void) +{ + ID3D10ShaderReflection *ref10; + IUnknown *unk; + HRESULT hr; + + hr = D3D10ReflectShader(test_reflection_blob, sizeof(test_reflection_blob), &ref10); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = ref10->lpVtbl->QueryInterface(ref10, &IID_ID3D10ShaderReflection, (void **)&unk); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + IUnknown_Release(unk); + + hr = ref10->lpVtbl->QueryInterface(ref10, &IID_ID3D10ShaderReflection1, (void **)&unk); + ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr); + + hr = ref10->lpVtbl->QueryInterface(ref10, &IID_ID3D11ShaderReflection, (void **)&unk); + ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr); + + hr = ref10->lpVtbl->QueryInterface(ref10, &IID_ID3D12ShaderReflection, (void **)&unk); + ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr); + + ref10->lpVtbl->Release(ref10); +} #endif /* @@ -2125,6 +2150,8 @@ START_TEST(reflection) #if D3D_COMPILER_VERSION test_reflection_references(); test_reflection_interfaces(); +#else + test_d3d10_interfaces(); #endif test_reflection_desc_vs(); test_reflection_desc_ps();