vkd3d: Implement support for D3D12_FEATURE_D3D12_OPTIONS3.

Signed-off-by: Conor McCarthy <conor.mccarthy.444@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Conor McCarthy 2020-05-25 20:07:06 +04:30 committed by Alexandre Julliard
parent 1cee31ed7a
commit 33217ebfca
3 changed files with 59 additions and 0 deletions

View File

@ -200,6 +200,26 @@ typedef enum D3D12_SHADER_CACHE_SUPPORT_FLAGS
D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_DISK_CACHE = 0x8,
} D3D12_SHADER_CACHE_SUPPORT_FLAGS;
typedef enum D3D12_COMMAND_LIST_SUPPORT_FLAGS
{
D3D12_COMMAND_LIST_SUPPORT_FLAG_NONE = 0x0,
D3D12_COMMAND_LIST_SUPPORT_FLAG_DIRECT = 0x1,
D3D12_COMMAND_LIST_SUPPORT_FLAG_BUNDLE = 0x2,
D3D12_COMMAND_LIST_SUPPORT_FLAG_COMPUTE = 0x4,
D3D12_COMMAND_LIST_SUPPORT_FLAG_COPY = 0x8,
D3D12_COMMAND_LIST_SUPPORT_FLAG_VIDEO_DECODE = 0x10,
D3D12_COMMAND_LIST_SUPPORT_FLAG_VIDEO_PROCESS = 0x20,
D3D12_COMMAND_LIST_SUPPORT_FLAG_VIDEO_ENCODE = 0x40,
} D3D12_COMMAND_LIST_SUPPORT_FLAGS;
typedef enum D3D12_VIEW_INSTANCING_TIER
{
D3D12_VIEW_INSTANCING_TIER_NOT_SUPPORTED = 0x0,
D3D12_VIEW_INSTANCING_TIER_1 = 0x1,
D3D12_VIEW_INSTANCING_TIER_2 = 0x2,
D3D12_VIEW_INSTANCING_TIER_3 = 0x3,
} D3D12_VIEW_INSTANCING_TIER;
interface ID3D12Fence;
interface ID3D12RootSignature;
interface ID3D12Heap;
@ -1668,6 +1688,15 @@ typedef struct D3D12_FEATURE_DATA_COMMAND_QUEUE_PRIORITY
BOOL PriorityForTypeIsSupported;
} D3D12_FEATURE_DATA_COMMAND_QUEUE_PRIORITY;
typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS3
{
BOOL CopyQueueTimestampQueriesSupported;
BOOL CastingFullyTypedFormatSupported;
D3D12_COMMAND_LIST_SUPPORT_FLAGS WriteBufferImmediateSupportFlags;
D3D12_VIEW_INSTANCING_TIER ViewInstancingTier;
BOOL BarycentricsSupported;
} D3D12_FEATURE_DATA_D3D12_OPTIONS3;
typedef enum D3D12_FEATURE
{
D3D12_FEATURE_D3D12_OPTIONS = 0,
@ -1684,6 +1713,7 @@ typedef enum D3D12_FEATURE
D3D12_FEATURE_D3D12_OPTIONS2 = 18,
D3D12_FEATURE_SHADER_CACHE = 19,
D3D12_FEATURE_COMMAND_QUEUE_PRIORITY = 20,
D3D12_FEATURE_D3D12_OPTIONS3 = 21,
} D3D12_FEATURE;
typedef struct D3D12_MEMCPY_DEST

View File

@ -1350,6 +1350,12 @@ static HRESULT vkd3d_init_device_caps(struct d3d12_device *device,
/* d3d12_command_list_SetSamplePositions() is not implemented. */
device->feature_options2.ProgrammableSamplePositionsTier = D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_NOT_SUPPORTED;
device->feature_options3.CopyQueueTimestampQueriesSupported = FALSE;
device->feature_options3.CastingFullyTypedFormatSupported = FALSE;
device->feature_options3.WriteBufferImmediateSupportFlags = D3D12_COMMAND_LIST_SUPPORT_FLAG_NONE;
device->feature_options3.ViewInstancingTier = D3D12_VIEW_INSTANCING_TIER_NOT_SUPPORTED;
device->feature_options3.BarycentricsSupported = FALSE;
if ((vr = VK_CALL(vkEnumerateDeviceExtensionProperties(physical_device, NULL, &count, NULL))) < 0)
{
ERR("Failed to enumerate device extensions, vr %d.\n", vr);
@ -1604,6 +1610,8 @@ static HRESULT d3d12_device_create_vkd3d_queues(struct d3d12_device *device,
else
goto out_destroy_queues;
device->feature_options3.CopyQueueTimestampQueriesSupported = !!device->copy_queue->timestamp_bits;
return S_OK;
out_destroy_queues:
@ -2814,6 +2822,26 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CheckFeatureSupport(ID3D12Device *
}
}
case D3D12_FEATURE_D3D12_OPTIONS3:
{
D3D12_FEATURE_DATA_D3D12_OPTIONS3 *data = feature_data;
if (feature_data_size != sizeof(*data))
{
WARN("Invalid size %u.\n", feature_data_size);
return E_INVALIDARG;
}
*data = device->feature_options3;
TRACE("Copy queue timestamp queries %#x.\n", data->CopyQueueTimestampQueriesSupported);
TRACE("Casting fully typed format %#x.\n", data->CastingFullyTypedFormatSupported);
TRACE("Write buffer immediate %#x.\n", data->WriteBufferImmediateSupportFlags);
TRACE("View instancing tier %#x.\n", data->ViewInstancingTier);
TRACE("Barycentrics %#x.\n", data->BarycentricsSupported);
return S_OK;
}
default:
FIXME("Unhandled feature %#x.\n", feature);
return E_NOTIMPL;

View File

@ -1133,6 +1133,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;
D3D12_FEATURE_DATA_D3D12_OPTIONS3 feature_options3;
struct vkd3d_vulkan_info vk_info;