mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-02 01:24:11 +01:00
[dxvk] Move isUnifiedMemoryArchitecture to adapter
This commit is contained in:
parent
e624cfa0b4
commit
fe0dc2d579
@ -497,6 +497,17 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool DxvkAdapter::isUnifiedMemoryArchitecture() const {
|
||||||
|
auto memory = this->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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void DxvkAdapter::initHeapAllocInfo() {
|
void DxvkAdapter::initHeapAllocInfo() {
|
||||||
for (uint32_t i = 0; i < m_heapAlloc.size(); i++)
|
for (uint32_t i = 0; i < m_heapAlloc.size(); i++)
|
||||||
m_heapAlloc[i] = 0;
|
m_heapAlloc[i] = 0;
|
||||||
|
@ -247,6 +247,15 @@ namespace dxvk {
|
|||||||
*/
|
*/
|
||||||
void logAdapterInfo() const;
|
void logAdapterInfo() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \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;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Rc<vk::InstanceFn> m_vki;
|
Rc<vk::InstanceFn> m_vki;
|
||||||
|
@ -33,13 +33,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
bool DxvkDevice::isUnifiedMemoryArchitecture() const {
|
bool DxvkDevice::isUnifiedMemoryArchitecture() const {
|
||||||
auto memory = m_adapter->memoryProperties();
|
return m_adapter->isUnifiedMemoryArchitecture();
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user