From: Conor McCarthy conor.mccarthy.444@gmail.com
Signed-off-by: Conor McCarthy conor.mccarthy.444@gmail.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- This supersedes patch 185478.
include/vkd3d_d3d12.idl | 13 +++++++++++++ libs/vkd3d/device.c | 23 +++++++++++++++++++++++ libs/vkd3d/vkd3d_private.h | 1 + 3 files changed, 37 insertions(+)
diff --git a/include/vkd3d_d3d12.idl b/include/vkd3d_d3d12.idl index ab7ab8a..01d104f 100644 --- a/include/vkd3d_d3d12.idl +++ b/include/vkd3d_d3d12.idl @@ -184,6 +184,13 @@ typedef enum D3D12_WRITEBUFFERIMMEDIATE_MODE D3D12_WRITEBUFFERIMMEDIATE_MODE_MARKER_OUT = 0x2, } D3D12_WRITEBUFFERIMMEDIATE_MODE;
+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; @@ -1634,6 +1641,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 9ed112e..74b70ce 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -1344,6 +1344,12 @@ 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); @@ -2745,6 +2751,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 add727f..2559824 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -1132,6 +1132,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;