From 7d47f2323ecced1773ff7a4c927c3637cd73ea15 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Mon, 25 May 2020 20:07:11 +0430 Subject: [PATCH] vkd3d: Implement support for D3D12_FEATURE_D3D12_OPTIONS5. Signed-off-by: Conor McCarthy Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- include/vkd3d_d3d12.idl | 21 +++++++++++++++++++++ libs/vkd3d/device.c | 22 ++++++++++++++++++++++ libs/vkd3d/vkd3d_private.h | 1 + 3 files changed, 44 insertions(+) diff --git a/include/vkd3d_d3d12.idl b/include/vkd3d_d3d12.idl index f27084fe..48b87f09 100644 --- a/include/vkd3d_d3d12.idl +++ b/include/vkd3d_d3d12.idl @@ -232,6 +232,19 @@ typedef enum D3D12_HEAP_SERIALIZATION_TIER D3D12_HEAP_SERIALIZATION_TIER_10 = 0xa, } D3D12_HEAP_SERIALIZATION_TIER; +typedef enum D3D12_RENDER_PASS_TIER +{ + D3D12_RENDER_PASS_TIER_0 = 0x0, + D3D12_RENDER_PASS_TIER_1 = 0x1, + D3D12_RENDER_PASS_TIER_2 = 0x2, +} D3D12_RENDER_PASS_TIER; + +typedef enum D3D12_RAYTRACING_TIER +{ + D3D12_RAYTRACING_TIER_NOT_SUPPORTED = 0x0, + D3D12_RAYTRACING_TIER_1_0 = 0xa, +} D3D12_RAYTRACING_TIER; + interface ID3D12Fence; interface ID3D12RootSignature; interface ID3D12Heap; @@ -1733,6 +1746,13 @@ typedef struct D3D12_FEATURE_DATA_CROSS_NODE BOOL AtomicShaderInstructions; } D3D12_FEATURE_DATA_CROSS_NODE; +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS5 +{ + BOOL SRVOnlyTiledResourceTier3; + D3D12_RENDER_PASS_TIER RenderPassesTier; + D3D12_RAYTRACING_TIER RaytracingTier; +} D3D12_FEATURE_DATA_D3D12_OPTIONS5; + typedef enum D3D12_FEATURE { D3D12_FEATURE_D3D12_OPTIONS = 0, @@ -1754,6 +1774,7 @@ typedef enum D3D12_FEATURE D3D12_FEATURE_D3D12_OPTIONS4 = 23, D3D12_FEATURE_SERIALIZATION = 24, D3D12_FEATURE_CROSS_NODE = 25, + D3D12_FEATURE_D3D12_OPTIONS5 = 27, } D3D12_FEATURE; typedef struct D3D12_MEMCPY_DEST diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 1612bb6c..843f3279 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -1362,6 +1362,10 @@ static HRESULT vkd3d_init_device_caps(struct d3d12_device *device, * VK_KHR_shader_float16_int8. */ device->feature_options4.Native16BitShaderOpsSupported = FALSE; + device->feature_options5.SRVOnlyTiledResourceTier3 = FALSE; + device->feature_options5.RenderPassesTier = D3D12_RENDER_PASS_TIER_0; + device->feature_options5.RaytracingTier = D3D12_RAYTRACING_TIER_NOT_SUPPORTED; + if ((vr = VK_CALL(vkEnumerateDeviceExtensionProperties(physical_device, NULL, &count, NULL))) < 0) { ERR("Failed to enumerate device extensions, vr %d.\n", vr); @@ -2949,6 +2953,24 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CheckFeatureSupport(ID3D12Device * return S_OK; } + case D3D12_FEATURE_D3D12_OPTIONS5: + { + D3D12_FEATURE_DATA_D3D12_OPTIONS5 *data = feature_data; + + if (feature_data_size != sizeof(*data)) + { + WARN("Invalid size %u.\n", feature_data_size); + return E_INVALIDARG; + } + + *data = device->feature_options5; + + TRACE("SRV tiled resource tier 3 only %#x.\n", data->SRVOnlyTiledResourceTier3); + TRACE("Render pass tier %#x.\n", data->RenderPassesTier); + TRACE("Ray tracing tier %#x.\n", data->RaytracingTier); + return S_OK; + } + default: FIXME("Unhandled feature %#x.\n", feature); return E_NOTIMPL; diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index da3e3fe4..1cc78642 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -1135,6 +1135,7 @@ struct d3d12_device D3D12_FEATURE_DATA_D3D12_OPTIONS2 feature_options2; D3D12_FEATURE_DATA_D3D12_OPTIONS3 feature_options3; D3D12_FEATURE_DATA_D3D12_OPTIONS4 feature_options4; + D3D12_FEATURE_DATA_D3D12_OPTIONS5 feature_options5; struct vkd3d_vulkan_info vk_info;