diff --git a/src/dxvk/dxvk_device.cpp b/src/dxvk/dxvk_device.cpp index ad3000db0..a0de88384 100644 --- a/src/dxvk/dxvk_device.cpp +++ b/src/dxvk/dxvk_device.cpp @@ -16,6 +16,7 @@ namespace dxvk { m_extensions (extensions), m_features (features), m_properties (adapter->deviceProperties()), + m_perfHints (getPerfHints()), m_memory (new DxvkMemoryAllocator (this)), m_renderPassPool (new DxvkRenderPassPool (vkd)), m_pipelineManager (new DxvkPipelineManager (this, m_renderPassPool.ptr())), @@ -258,6 +259,14 @@ namespace dxvk { } + DxvkDevicePerfHints DxvkDevice::getPerfHints() { + DxvkDevicePerfHints hints; + hints.preferFbDepthStencilCopy = m_extensions.extShaderStencilExport + && m_adapter->matchesDriver(DxvkGpuVendor::Amd, VK_DRIVER_ID_MESA_RADV_KHR, 0, 0); + return hints; + } + + void DxvkDevice::recycleCommandList(const Rc& cmdList) { m_recycledCommandLists.returnObject(cmdList); } diff --git a/src/dxvk/dxvk_device.h b/src/dxvk/dxvk_device.h index bd6dfd089..6e62222b3 100644 --- a/src/dxvk/dxvk_device.h +++ b/src/dxvk/dxvk_device.h @@ -34,6 +34,13 @@ namespace dxvk { uint32_t maxNumDynamicUniformBuffers = 0; uint32_t maxNumDynamicStorageBuffers = 0; }; + + /** + * \brief Device performance hints + */ + struct DxvkDevicePerfHints { + VkBool32 preferFbDepthStencilCopy : 1; + }; /** * \brief Device queue @@ -168,6 +175,14 @@ namespace dxvk { * \returns Device options */ DxvkDeviceOptions options() const; + + /** + * \brief Retrieves performance hints + * \returns Device-specific perf hints + */ + DxvkDevicePerfHints perfHints() const { + return m_perfHints; + } /** * \brief Creates a command list @@ -417,6 +432,8 @@ namespace dxvk { DxvkDeviceFeatures m_features; VkPhysicalDeviceProperties m_properties; + DxvkDevicePerfHints m_perfHints; + Rc m_memory; Rc m_renderPassPool; Rc m_pipelineManager; @@ -441,6 +458,8 @@ namespace dxvk { DxvkRecycler m_recycledDescriptorPools; DxvkSubmissionQueue m_submissionQueue; + + DxvkDevicePerfHints getPerfHints(); void recycleCommandList( const Rc& cmdList);