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

github.com/ValveSoftware/vkd3d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Bernon <rbernon@codeweavers.com>2019-10-31 16:07:03 +0300
committerAlexandre Julliard <julliard@winehq.org>2019-10-31 21:25:07 +0300
commit4576236199769eacadc6de49e03d05df999f9181 (patch)
treecddf5c4ac14a12db56b2a2dd62e916d0e93a2168
parent1b66138006c25ae921bedd868dc05fdf98c52c3f (diff)
vkd3d: Do not report a root signature version higher than requested.
This fixes Shadow of the Tomb Raider crashing because of NULL root signatures being passed since c002aee119b638d30eeb7cdc91099449ccafeafc. Signed-off-by: Rémi Bernon <rbernon@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
-rw-r--r--libs/vkd3d/device.c3
-rw-r--r--tests/d3d12.c16
2 files changed, 18 insertions, 1 deletions
diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c
index 4d6f7c9b..13ebc70a 100644
--- a/libs/vkd3d/device.c
+++ b/libs/vkd3d/device.c
@@ -2665,7 +2665,8 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CheckFeatureSupport(ID3D12Device *
return E_INVALIDARG;
}
- data->HighestVersion = D3D_ROOT_SIGNATURE_VERSION_1_1;
+ TRACE("Root signature requested %#x.\n", data->HighestVersion);
+ data->HighestVersion = min(data->HighestVersion, D3D_ROOT_SIGNATURE_VERSION_1_1);
TRACE("Root signature version %#x.\n", data->HighestVersion);
return S_OK;
diff --git a/tests/d3d12.c b/tests/d3d12.c
index 6e0617d8..858cf991 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -1039,6 +1039,7 @@ static void test_check_feature_support(void)
{
D3D12_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT gpu_virtual_address;
D3D12_FEATURE_DATA_FEATURE_LEVELS feature_levels;
+ D3D12_FEATURE_DATA_ROOT_SIGNATURE root_signature;
D3D_FEATURE_LEVEL max_supported_feature_level;
D3D12_FEATURE_DATA_ARCHITECTURE architecture;
D3D12_FEATURE_DATA_FORMAT_INFO format_info;
@@ -1229,6 +1230,21 @@ static void test_check_feature_support(void)
trace("GPU virtual address bits per process: %u.\n",
gpu_virtual_address.MaxGPUVirtualAddressBitsPerProcess);
+ root_signature.HighestVersion = D3D_ROOT_SIGNATURE_VERSION_1_0;
+ hr = ID3D12Device_CheckFeatureSupport(device, D3D12_FEATURE_ROOT_SIGNATURE,
+ &root_signature, sizeof(root_signature));
+ ok(hr == S_OK, "Failed to get root signature feature support, hr %#x.\n", hr);
+ ok(root_signature.HighestVersion == D3D_ROOT_SIGNATURE_VERSION_1_0,
+ "Got unexpected root signature feature version %#x.\n", root_signature.HighestVersion);
+
+ root_signature.HighestVersion = D3D_ROOT_SIGNATURE_VERSION_1_1;
+ hr = ID3D12Device_CheckFeatureSupport(device, D3D12_FEATURE_ROOT_SIGNATURE,
+ &root_signature, sizeof(root_signature));
+ ok(hr == S_OK, "Failed to get root signature feature support, hr %#x.\n", hr);
+ ok(root_signature.HighestVersion == D3D_ROOT_SIGNATURE_VERSION_1_0
+ || root_signature.HighestVersion == D3D_ROOT_SIGNATURE_VERSION_1_1,
+ "Got unexpected root signature feature version %#x.\n", root_signature.HighestVersion);
+
refcount = ID3D12Device_Release(device);
ok(!refcount, "ID3D12Device has %u references left.\n", (unsigned int)refcount);
}