mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-05 19:46:15 +01:00
[ðxvk] Clean up some device creation code
This commit is contained in:
parent
d29d403c67
commit
6276d5503c
@ -28,12 +28,8 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
DxvkAdapterMemoryInfo DxvkAdapter::getMemoryHeapInfo() const {
|
DxvkAdapterMemoryInfo DxvkAdapter::getMemoryHeapInfo() const {
|
||||||
VkPhysicalDeviceMemoryBudgetPropertiesEXT memBudget = { };
|
VkPhysicalDeviceMemoryBudgetPropertiesEXT memBudget = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT };
|
||||||
memBudget.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT;
|
VkPhysicalDeviceMemoryProperties2 memProps = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2 };
|
||||||
memBudget.pNext = nullptr;
|
|
||||||
|
|
||||||
VkPhysicalDeviceMemoryProperties2 memProps = { };
|
|
||||||
memProps.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2;
|
|
||||||
memProps.pNext = m_hasMemoryBudget ? &memBudget : nullptr;
|
memProps.pNext = m_hasMemoryBudget ? &memBudget : nullptr;
|
||||||
|
|
||||||
m_vki->vkGetPhysicalDeviceMemoryProperties2(m_handle, &memProps);
|
m_vki->vkGetPhysicalDeviceMemoryProperties2(m_handle, &memProps);
|
||||||
@ -428,9 +424,7 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Report the desired overallocation behaviour to the driver
|
// Report the desired overallocation behaviour to the driver
|
||||||
VkDeviceMemoryOverallocationCreateInfoAMD overallocInfo;
|
VkDeviceMemoryOverallocationCreateInfoAMD overallocInfo = { VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD };
|
||||||
overallocInfo.sType = VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD;
|
|
||||||
overallocInfo.pNext = nullptr;
|
|
||||||
overallocInfo.overallocationBehavior = VK_MEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD;
|
overallocInfo.overallocationBehavior = VK_MEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD;
|
||||||
|
|
||||||
// Create the requested queues
|
// Create the requested queues
|
||||||
@ -445,24 +439,16 @@ namespace dxvk {
|
|||||||
this->logQueueFamilies(queueFamilies);
|
this->logQueueFamilies(queueFamilies);
|
||||||
|
|
||||||
for (uint32_t family : queueFamiliySet) {
|
for (uint32_t family : queueFamiliySet) {
|
||||||
VkDeviceQueueCreateInfo graphicsQueue;
|
VkDeviceQueueCreateInfo graphicsQueue = { VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO };
|
||||||
graphicsQueue.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
|
|
||||||
graphicsQueue.pNext = nullptr;
|
|
||||||
graphicsQueue.flags = 0;
|
|
||||||
graphicsQueue.queueFamilyIndex = family;
|
graphicsQueue.queueFamilyIndex = family;
|
||||||
graphicsQueue.queueCount = 1;
|
graphicsQueue.queueCount = 1;
|
||||||
graphicsQueue.pQueuePriorities = &queuePriority;
|
graphicsQueue.pQueuePriorities = &queuePriority;
|
||||||
queueInfos.push_back(graphicsQueue);
|
queueInfos.push_back(graphicsQueue);
|
||||||
}
|
}
|
||||||
|
|
||||||
VkDeviceCreateInfo info;
|
VkDeviceCreateInfo info = { VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, &enabledFeatures.core.pNext };
|
||||||
info.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO;
|
|
||||||
info.pNext = enabledFeatures.core.pNext;
|
|
||||||
info.flags = 0;
|
|
||||||
info.queueCreateInfoCount = queueInfos.size();
|
info.queueCreateInfoCount = queueInfos.size();
|
||||||
info.pQueueCreateInfos = queueInfos.data();
|
info.pQueueCreateInfos = queueInfos.data();
|
||||||
info.enabledLayerCount = 0;
|
|
||||||
info.ppEnabledLayerNames = nullptr;
|
|
||||||
info.enabledExtensionCount = extensionNameList.count();
|
info.enabledExtensionCount = extensionNameList.count();
|
||||||
info.ppEnabledExtensionNames = extensionNameList.names();
|
info.ppEnabledExtensionNames = extensionNameList.names();
|
||||||
info.pEnabledFeatures = &enabledFeatures.core.features;
|
info.pEnabledFeatures = &enabledFeatures.core.features;
|
||||||
|
Loading…
Reference in New Issue
Block a user