Henri Verbeet : vkd3d: Require VKD3D_API_VERSION_1_2 for version 1.1 root signatures.
Alexandre Julliard
julliard at winehq.org
Tue Jun 30 14:53:05 CDT 2020
Module: vkd3d
Branch: master
Commit: 24eaeb2cdf2a7df998673792a5d092bf0062468c
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=24eaeb2cdf2a7df998673792a5d092bf0062468c
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Tue Jun 30 15:20:05 2020 +0430
vkd3d: Require VKD3D_API_VERSION_1_2 for version 1.1 root signatures.
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
libs/vkd3d/device.c | 2 ++
tests/vkd3d_api.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 56 insertions(+)
diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c
index c53856a..d88fde9 100644
--- a/libs/vkd3d/device.c
+++ b/libs/vkd3d/device.c
@@ -2766,6 +2766,8 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CheckFeatureSupport(ID3D12Device *
TRACE("Root signature requested %#x.\n", data->HighestVersion);
data->HighestVersion = min(data->HighestVersion, D3D_ROOT_SIGNATURE_VERSION_1_1);
+ if (device->vkd3d_instance->api_version < VKD3D_API_VERSION_1_2)
+ data->HighestVersion = min(data->HighestVersion, D3D_ROOT_SIGNATURE_VERSION_1_0);
TRACE("Root signature version %#x.\n", data->HighestVersion);
return S_OK;
diff --git a/tests/vkd3d_api.c b/tests/vkd3d_api.c
index 13fa3d6..8195c06 100644
--- a/tests/vkd3d_api.c
+++ b/tests/vkd3d_api.c
@@ -1073,12 +1073,28 @@ static void test_formats(void)
static void test_application_info(void)
{
+ D3D12_FEATURE_DATA_ROOT_SIGNATURE root_signature;
struct vkd3d_instance_create_info create_info;
+ struct vkd3d_device_create_info device_info;
struct vkd3d_application_info app_info;
struct vkd3d_instance *instance;
+ ID3D12Device *device;
+ unsigned int i;
ULONG refcount;
HRESULT hr;
+ static const struct
+ {
+ enum vkd3d_api_version api_version;
+ D3D_ROOT_SIGNATURE_VERSION rs_version;
+ }
+ root_signature_versions[] =
+ {
+ {VKD3D_API_VERSION_1_0, D3D_ROOT_SIGNATURE_VERSION_1_0},
+ {VKD3D_API_VERSION_1_1, D3D_ROOT_SIGNATURE_VERSION_1_0},
+ {VKD3D_API_VERSION_1_2, D3D_ROOT_SIGNATURE_VERSION_1_1},
+ };
+
app_info.type = VKD3D_STRUCTURE_TYPE_APPLICATION_INFO;
app_info.next = NULL;
app_info.engine_name = NULL;
@@ -1113,6 +1129,44 @@ static void test_application_info(void)
ok(hr == S_OK, "Failed to create instance, hr %#x.\n", hr);
refcount = vkd3d_instance_decref(instance);
ok(!refcount, "Instance has %u references left.\n", refcount);
+
+ device_info = device_default_create_info;
+ device_info.instance_create_info = &create_info;
+ for (i = 0; i < ARRAY_SIZE(root_signature_versions); ++i)
+ {
+ app_info.api_version = root_signature_versions[i].api_version;
+ hr = vkd3d_create_device(&device_info, &IID_ID3D12Device, (void **)&device);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+
+ 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, "Got unexpected 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, "Got unexpected hr %#x.\n", hr);
+ ok(root_signature.HighestVersion == root_signature_versions[i].rs_version,
+ "Got unexpected root signature feature version %#x.\n", root_signature.HighestVersion);
+
+ ID3D12Device_Release(device);
+ }
+
+ create_info.next = NULL;
+ hr = vkd3d_create_device(&device_info, &IID_ID3D12Device, (void **)&device);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+
+ 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, "Got unexpected 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);
+
+ ID3D12Device_Release(device);
}
static bool have_d3d12_device(void)
More information about the wine-cvs
mailing list