1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-01 16:24:12 +01:00

[dxvk] Move UMA check to backend

This commit is contained in:
Philip Rebohle 2020-01-28 12:12:03 +01:00 committed by Joshie
parent b1edf227f8
commit 3beca254e2
4 changed files with 21 additions and 15 deletions

View File

@ -1682,7 +1682,7 @@ namespace dxvk {
info->MapOnDefaultTextures = TRUE;
info->TiledResourcesTier = D3D11_TILED_RESOURCES_NOT_SUPPORTED;
info->StandardSwizzle = FALSE;
info->UnifiedMemoryArchitecture = IsUnifiedMemoryArch();
info->UnifiedMemoryArchitecture = m_dxvkDevice->isUnifiedMemoryArchitecture();
} return S_OK;
case D3D11_FEATURE_D3D11_OPTIONS3: {
@ -2295,18 +2295,6 @@ namespace dxvk {
}
BOOL D3D11Device::IsUnifiedMemoryArch() {
auto memory = m_dxvkAdapter->memoryProperties();
bool result = true;
// Report unified memory if all heaps are device-local
for (uint32_t i = 0; i < memory.memoryHeapCount && result; i++)
result &= memory.memoryHeaps[i].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT;
return result;
}
D3D_FEATURE_LEVEL D3D11Device::GetMaxFeatureLevel(const Rc<DxvkInstance>& pInstance) {
static const std::array<std::pair<std::string, D3D_FEATURE_LEVEL>, 9> s_featureLevels = {{
{ "12_1", D3D_FEATURE_LEVEL_12_1 },

View File

@ -481,8 +481,6 @@ namespace dxvk {
UINT Subresource,
const D3D11_BOX* pBox);
BOOL IsUnifiedMemoryArch();
static D3D_FEATURE_LEVEL GetMaxFeatureLevel(
const Rc<DxvkInstance>& pInstance);

View File

@ -34,6 +34,17 @@ namespace dxvk {
}
bool DxvkDevice::isUnifiedMemoryArchitecture() const {
auto memory = m_adapter->memoryProperties();
bool result = true;
for (uint32_t i = 0; i < memory.memoryHeapCount; i++)
result &= memory.memoryHeaps[i].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT;
return result;
}
VkPipelineStageFlags DxvkDevice::getShaderPipelineStages() const {
VkPipelineStageFlags result = VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT
| VK_PIPELINE_STAGE_VERTEX_SHADER_BIT

View File

@ -196,6 +196,15 @@ namespace dxvk {
return m_submissionQueue.getLastError();
}
/**
* \brief Checks whether this is a UMA system
*
* Basically tests whether all heaps are device-local.
* Can be used for various optimizations in client APIs.
* \returns \c true if the system has unified memory.
*/
bool isUnifiedMemoryArchitecture() const;
/**
* \brief Queries supported shader stages
* \returns Supported shader pipeline stages