d3d11: Support D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS in ID3D11Device CheckFeatureSupport.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alistair Leslie-Hughes 2016-08-17 12:21:07 +00:00 committed by Alexandre Julliard
parent 08f04c5a6e
commit eedd9671c1
3 changed files with 35 additions and 0 deletions

View File

@ -2784,6 +2784,18 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFeatureSupport(ID3D11Device *
threading_data->DriverCommandLists = FALSE;
return S_OK;
}
case D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS:
{
D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS *options = feature_support_data;
if (feature_support_data_size != sizeof(*options))
{
WARN("Invalid data size.\n");
return E_INVALIDARG;
}
options->ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x = FALSE;
return S_OK;
}
default:
FIXME("Unhandled feature %#x.\n", feature);

View File

@ -9190,6 +9190,7 @@ static void test_null_sampler(void)
static void test_check_feature_support(void)
{
D3D11_FEATURE_DATA_THREADING threading[2];
D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS hwopts;
ID3D11Device *device;
ULONG refcount;
HRESULT hr;
@ -9231,6 +9232,23 @@ static void test_check_feature_support(void)
ok(threading->DriverCommandLists == TRUE || threading->DriverCommandLists == FALSE,
"Got unexpected command lists %#x.\n", threading->DriverCommandLists);
hr = ID3D11Device_CheckFeatureSupport(device, D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS, NULL, 0);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
hr = ID3D11Device_CheckFeatureSupport(device, D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS, &hwopts, 0);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
hr = ID3D11Device_CheckFeatureSupport(device, D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS, &hwopts, sizeof(hwopts) - 1);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
hr = ID3D11Device_CheckFeatureSupport(device, D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS, &hwopts, sizeof(hwopts) / 2);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
hr = ID3D11Device_CheckFeatureSupport(device, D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS, &hwopts, sizeof(hwopts) + 1);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
hr = ID3D11Device_CheckFeatureSupport(device, D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS, &hwopts, sizeof(hwopts) * 2);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
hr = ID3D11Device_CheckFeatureSupport(device, D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS, &hwopts, sizeof(hwopts));
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
trace("Shader support %#x.\n", hwopts.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x);
refcount = ID3D11Device_Release(device);
ok(!refcount, "Device has %u references left.\n", refcount);
}

View File

@ -445,6 +445,11 @@ typedef struct D3D11_FEATURE_DATA_THREADING
BOOL DriverCommandLists;
} D3D11_FEATURE_DATA_THREADING;
typedef struct D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS
{
BOOL ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x;
} D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS;
typedef struct D3D11_FEATURE_DATA_D3D11_OPTIONS
{
BOOL OutputMergerLogicOp;