From: Conor McCarthy Subject: [PATCH vkd3d v3 3/5] vkd3d: Implement support for D3D12_FEATURE_D3D12_OPTIONS2. Message-Id: <20191205140135.20805-4-cmccarthy@codeweavers.com> Date: Fri, 6 Dec 2019 00:01:33 +1000 In-Reply-To: <20191205140135.20805-1-cmccarthy@codeweavers.com> References: <20191205140135.20805-1-cmccarthy@codeweavers.com> Signed-off-by: Conor McCarthy --- include/vkd3d_d3d12.idl | 13 +++++++++++++ libs/vkd3d/device.c | 22 ++++++++++++++++++++++ libs/vkd3d/vkd3d_private.h | 1 + 3 files changed, 36 insertions(+) diff --git a/include/vkd3d_d3d12.idl b/include/vkd3d_d3d12.idl index ec102a8..4c69454 100644 --- a/include/vkd3d_d3d12.idl +++ b/include/vkd3d_d3d12.idl @@ -177,6 +177,13 @@ typedef enum D3D12_FORMAT_SUPPORT2 D3D12_FORMAT_SUPPORT2_MULTIPLANE_OVERLAY = 0x00004000, } D3D12_FORMAT_SUPPORT2; +typedef enum D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER +{ + D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_NOT_SUPPORTED = 0x0, + D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_1 = 0x1, + D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_2 = 0x2, +} D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER; + interface ID3D12Fence; interface ID3D12RootSignature; interface ID3D12Heap; @@ -1627,6 +1634,12 @@ typedef struct D3D12_FEATURE_DATA_ARCHITECTURE1 BOOL IsolatedMMU; } D3D12_FEATURE_DATA_ARCHITECTURE1; +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS2 +{ + BOOL DepthBoundsTestSupported; + D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER ProgrammableSamplePositionsTier; +} D3D12_FEATURE_DATA_D3D12_OPTIONS2; + typedef enum D3D12_FEATURE { D3D12_FEATURE_D3D12_OPTIONS = 0, diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index dc8ca44..1063680 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -1343,6 +1343,11 @@ static HRESULT vkd3d_init_device_caps(struct d3d12_device *device, device->feature_options1.ExpandedComputeResourceStates = TRUE; device->feature_options1.Int64ShaderOps = features->shaderInt64; + /* Depth bounds test is enabled in D3D12_DEPTH_STENCIL_DESC1, which is not supported. */ + device->feature_options2.DepthBoundsTestSupported = FALSE; + /* d3d12_command_list_SetSamplePositions() is not implemented. */ + device->feature_options2.ProgrammableSamplePositionsTier = D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_NOT_SUPPORTED; + if ((vr = VK_CALL(vkEnumerateDeviceExtensionProperties(physical_device, NULL, &count, NULL))) < 0) { ERR("Failed to enumerate device extensions, vr %d.\n", vr); @@ -2744,6 +2749,23 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CheckFeatureSupport(ID3D12Device * return S_OK; } + case D3D12_FEATURE_D3D12_OPTIONS2: + { + D3D12_FEATURE_DATA_D3D12_OPTIONS2 *data = feature_data; + + if (feature_data_size != sizeof(*data)) + { + WARN("Invalid size %u.\n", feature_data_size); + return E_INVALIDARG; + } + + *data = device->feature_options2; + + TRACE("Depth bounds test %#x.\n", data->DepthBoundsTestSupported); + TRACE("Programmable sample positions tier %#x.\n", data->ProgrammableSamplePositionsTier); + 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 6c7ec4e..72a7913 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -1135,6 +1135,7 @@ struct d3d12_device D3D12_FEATURE_DATA_D3D12_OPTIONS feature_options; D3D12_FEATURE_DATA_D3D12_OPTIONS1 feature_options1; + D3D12_FEATURE_DATA_D3D12_OPTIONS2 feature_options2; struct vkd3d_vulkan_info vk_info; -- 2.24.0