[PATCH 5/9] d3d11: Partially implement d3d11_device_CheckFeatureSupport().
Józef Kucia
jkucia at codeweavers.com
Fri Jun 24 04:46:01 CDT 2016
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
dlls/d3d11/device.c | 23 +++++++++++++++++++++--
dlls/d3d11/tests/d3d11.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++
include/d3d11.idl | 6 ++++++
3 files changed, 76 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 224e3ca..22e102e 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -2706,10 +2706,29 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckCounter(ID3D11Device *iface,
static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFeatureSupport(ID3D11Device *iface, D3D11_FEATURE feature,
void *feature_support_data, UINT feature_support_data_size)
{
- FIXME("iface %p, feature %u, feature_support_data %p, feature_support_data_size %u stub!\n",
+ TRACE("iface %p, feature %u, feature_support_data %p, feature_support_data_size %u.\n",
iface, feature, feature_support_data, feature_support_data_size);
- return E_NOTIMPL;
+ switch (feature)
+ {
+ case D3D11_FEATURE_THREADING:
+ {
+ D3D11_FEATURE_DATA_THREADING *threading_data = feature_support_data;
+ if (feature_support_data_size != sizeof(*threading_data))
+ {
+ WARN("Invalid data size.\n");
+ return E_INVALIDARG;
+ }
+
+ threading_data->DriverConcurrentCreates = FALSE;
+ threading_data->DriverCommandLists = FALSE;
+ return S_OK;
+ }
+
+ default:
+ FIXME("Unhandled feature %#x.\n", feature);
+ return E_NOTIMPL;
+ }
}
static HRESULT STDMETHODCALLTYPE d3d11_device_GetPrivateData(ID3D11Device *iface, REFGUID guid,
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 8626b68..62c119a 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -8468,6 +8468,54 @@ static void test_null_sampler(void)
release_test_context(&test_context);
}
+static void test_check_feature_support(void)
+{
+ D3D11_FEATURE_DATA_THREADING threading[2];
+ ID3D11Device *device;
+ ULONG refcount;
+ HRESULT hr;
+
+ if (!(device = create_device(NULL)))
+ {
+ skip("Failed to create device.\n");
+ return;
+ }
+
+ memset(threading, 0xef, sizeof(threading));
+
+ hr = ID3D11Device_CheckFeatureSupport(device, D3D11_FEATURE_THREADING, NULL, 0);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ hr = ID3D11Device_CheckFeatureSupport(device, D3D11_FEATURE_THREADING, threading, 0);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ hr = ID3D11Device_CheckFeatureSupport(device, D3D11_FEATURE_THREADING, threading, sizeof(*threading) - 1);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ hr = ID3D11Device_CheckFeatureSupport(device, D3D11_FEATURE_THREADING, threading, sizeof(*threading) / 2);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ hr = ID3D11Device_CheckFeatureSupport(device, D3D11_FEATURE_THREADING, threading, sizeof(*threading) + 1);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ hr = ID3D11Device_CheckFeatureSupport(device, D3D11_FEATURE_THREADING, threading, sizeof(*threading) * 2);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+
+ ok(threading[0].DriverConcurrentCreates == 0xefefefef,
+ "Got unexpected concurrent creates %#x.\n", threading[0].DriverConcurrentCreates);
+ ok(threading[0].DriverCommandLists == 0xefefefef,
+ "Got unexpected command lists %#x.\n", threading[0].DriverCommandLists);
+ ok(threading[1].DriverConcurrentCreates == 0xefefefef,
+ "Got unexpected concurrent creates %#x.\n", threading[1].DriverConcurrentCreates);
+ ok(threading[1].DriverCommandLists == 0xefefefef,
+ "Got unexpected command lists %#x.\n", threading[1].DriverCommandLists);
+
+ hr = ID3D11Device_CheckFeatureSupport(device, D3D11_FEATURE_THREADING, threading, sizeof(*threading));
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(threading->DriverConcurrentCreates == TRUE || threading->DriverConcurrentCreates == FALSE,
+ "Got unexpected concurrent creates %#x.\n", threading->DriverConcurrentCreates);
+ ok(threading->DriverCommandLists == TRUE || threading->DriverCommandLists == FALSE,
+ "Got unexpected command lists %#x.\n", threading->DriverCommandLists);
+
+ refcount = ID3D11Device_Release(device);
+ ok(!refcount, "Device has %u references left.\n", refcount);
+}
+
START_TEST(d3d11)
{
test_create_device();
@@ -8513,4 +8561,5 @@ START_TEST(d3d11)
test_sm4_breakc_instruction();
test_input_assembler();
test_null_sampler();
+ test_check_feature_support();
}
diff --git a/include/d3d11.idl b/include/d3d11.idl
index 9d4d8fd..cd177c2 100644
--- a/include/d3d11.idl
+++ b/include/d3d11.idl
@@ -439,6 +439,12 @@ typedef enum D3D11_FEATURE
D3D11_FEATURE_D3D9_SHADOW_SUPPORT
} D3D11_FEATURE;
+typedef struct D3D11_FEATURE_DATA_THREADING
+{
+ BOOL DriverConcurrentCreates;
+ BOOL DriverCommandLists;
+} D3D11_FEATURE_DATA_THREADING;
+
typedef struct D3D11_FEATURE_DATA_D3D11_OPTIONS
{
BOOL OutputMergerLogicOp;
--
2.7.3
More information about the wine-patches
mailing list