[PATCH vkd3d 1/6] vkd3d: Implement support for D3D12_FEATURE_D3D12_OPTIONS3.

Henri Verbeet hverbeet at codeweavers.com
Mon May 25 10:37:06 CDT 2020


From: Conor McCarthy <conor.mccarthy.444 at gmail.com>

Signed-off-by: Conor McCarthy <conor.mccarthy.444 at gmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
This supersedes patch 185481.

 include/vkd3d_d3d12.idl    | 30 ++++++++++++++++++++++++++++++
 libs/vkd3d/device.c        | 28 ++++++++++++++++++++++++++++
 libs/vkd3d/vkd3d_private.h |  1 +
 3 files changed, 59 insertions(+)

diff --git a/include/vkd3d_d3d12.idl b/include/vkd3d_d3d12.idl
index e8b27bb..0982483 100644
--- a/include/vkd3d_d3d12.idl
+++ b/include/vkd3d_d3d12.idl
@@ -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
diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c
index d3cfff2..359da7f 100644
--- a/libs/vkd3d/device.c
+++ b/libs/vkd3d/device.c
@@ -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;
diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h
index 2559824..20134a8 100644
--- a/libs/vkd3d/vkd3d_private.h
+++ b/libs/vkd3d/vkd3d_private.h
@@ -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;
 
-- 
2.11.0




More information about the wine-devel mailing list