[PATCH vkd3d 1/2] vkd3d: Fix feature queries for depth/stencil formats.
Józef Kucia
joseph.kucia at gmail.com
Mon Mar 11 06:19:19 CDT 2019
From: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
libs/vkd3d/device.c | 4 ++++
tests/d3d12.c | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+)
diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c
index 3d9d90cb6558..204489c2993a 100644
--- a/libs/vkd3d/device.c
+++ b/libs/vkd3d/device.c
@@ -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;
diff --git a/tests/d3d12.c b/tests/d3d12.c
index 173c576e1855..e044a5385b21 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -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);
}
--
2.19.2
More information about the wine-devel
mailing list