vkd3d: Fix feature queries for depth/stencil formats.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2019-03-11 12:19:19 +01:00 committed by Alexandre Julliard
parent f1bfb1305e
commit b0c8561cff
2 changed files with 40 additions and 0 deletions

View File

@ -1801,6 +1801,8 @@ static HRESULT d3d12_device_check_multisample_quality_levels(struct d3d12_device
goto done;
if (!(format = vkd3d_get_format(data->Format, false)))
format = vkd3d_get_format(data->Format, true);
if (!format)
{
FIXME("Unhandled format %#x.\n", data->Format);
return E_INVALIDARG;
@ -1934,6 +1936,8 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CheckFeatureSupport(ID3D12Device *
data->Support1 = D3D12_FORMAT_SUPPORT1_NONE;
data->Support2 = D3D12_FORMAT_SUPPORT2_NONE;
if (!(format = vkd3d_get_format(data->Format, false)))
format = vkd3d_get_format(data->Format, true);
if (!format)
{
FIXME("Unhandled format %#x.\n", data->Format);
return E_INVALIDARG;

View File

@ -343,6 +343,22 @@ static unsigned int format_block_height(DXGI_FORMAT format)
}
}
static const DXGI_FORMAT depth_stencil_formats[] =
{
DXGI_FORMAT_R32G8X24_TYPELESS,
DXGI_FORMAT_D32_FLOAT_S8X24_UINT,
DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS,
DXGI_FORMAT_X32_TYPELESS_G8X24_UINT,
DXGI_FORMAT_R32_TYPELESS,
DXGI_FORMAT_D32_FLOAT,
DXGI_FORMAT_R24G8_TYPELESS,
DXGI_FORMAT_D24_UNORM_S8_UINT,
DXGI_FORMAT_R24_UNORM_X8_TYPELESS,
DXGI_FORMAT_X24_TYPELESS_G8_UINT,
DXGI_FORMAT_R16_TYPELESS,
DXGI_FORMAT_D16_UNORM,
};
static void get_buffer_readback_with_command_list(ID3D12Resource *buffer, DXGI_FORMAT format,
struct resource_readback *rb, ID3D12CommandQueue *queue, ID3D12GraphicsCommandList *command_list)
{
@ -1172,6 +1188,15 @@ static void test_format_support(void)
format_support.Support2 & unsupported_format_features[i].f.Support2);
}
for (i = 0; i < ARRAY_SIZE(depth_stencil_formats); ++i)
{
memset(&format_support, 0, sizeof(format_support));
format_support.Format = depth_stencil_formats[i];
hr = ID3D12Device_CheckFeatureSupport(device, D3D12_FEATURE_FORMAT_SUPPORT,
&format_support, sizeof(format_support));
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
}
refcount = ID3D12Device_Release(device);
ok(!refcount, "ID3D12Device has %u references left.\n", (unsigned int)refcount);
}
@ -1292,6 +1317,17 @@ static void test_multisample_quality_levels(void)
ok(!format_support.Flags, "Got unexpected flags %#x.\n", format_support.Flags);
ok(format_support.NumQualityLevels >= 1, "Got unexpected quality levels %u.\n", format_support.NumQualityLevels);
for (i = 0; i < ARRAY_SIZE(depth_stencil_formats); ++i)
{
memset(&format_support, 0, sizeof(format_support));
format_support.Format = depth_stencil_formats[i];
format_support.SampleCount = 4;
format_support.NumQualityLevels = 0xdeadbeef;
hr = ID3D12Device_CheckFeatureSupport(device, D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS,
&format_support, sizeof(format_support));
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
}
refcount = ID3D12Device_Release(device);
ok(!refcount, "ID3D12Device has %u references left.\n", (unsigned int)refcount);
}