1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 14:52:11 +01:00

[dxvk] Implement device- and driver-specific performance hints

These are meant to be read by the DxvkContext in order to choose
a fast path for certasin operations.
This commit is contained in:
Philip Rebohle 2019-07-18 16:52:44 +02:00
parent e611dff45e
commit a08f9d0897
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 28 additions and 0 deletions

View File

@ -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<DxvkCommandList>& cmdList) {
m_recycledCommandLists.returnObject(cmdList);
}

View File

@ -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<DxvkMemoryAllocator> m_memory;
Rc<DxvkRenderPassPool> m_renderPassPool;
Rc<DxvkPipelineManager> m_pipelineManager;
@ -441,6 +458,8 @@ namespace dxvk {
DxvkRecycler<DxvkDescriptorPool, 16> m_recycledDescriptorPools;
DxvkSubmissionQueue m_submissionQueue;
DxvkDevicePerfHints getPerfHints();
void recycleCommandList(
const Rc<DxvkCommandList>& cmdList);