Skip to content

Commit 8fc0eb0

Browse files
committed
Removed unused method
1 parent b76bb1e commit 8fc0eb0

2 files changed

Lines changed: 0 additions & 47 deletions

File tree

include/vsg/vk/Device.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ namespace vsg
8585
/// return true if Device was created with specified extension
8686
bool supportsDeviceExtension(const char* extensionName) const;
8787

88-
/// return the amount of memory available in deviceMemoryBufferPools and allocatable on device
89-
VkDeviceSize availableMemory(bool includeMemoryPools = true) const;
90-
9188
/// return the amount of remaining memory, compatible with specified flags, available that can be allocated.
9289
VkDeviceSize availableMemory(VkMemoryPropertyFlags memoryPropertiesFlags, double allocatedMemoryLimit = 1.0) const;
9390

src/vsg/vk/Device.cpp

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -206,50 +206,6 @@ bool Device::supportsDeviceExtension(const char* extensionName) const
206206
return (std::find_if(enabledExtensions.begin(), enabledExtensions.end(), compare) != enabledExtensions.end());
207207
}
208208

209-
VkDeviceSize Device::availableMemory(bool includeMemoryPools) const
210-
{
211-
VkDeviceSize available = 0;
212-
213-
VkPhysicalDeviceMemoryBudgetPropertiesEXT memoryBudget;
214-
memoryBudget.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT;
215-
memoryBudget.pNext = nullptr;
216-
217-
VkPhysicalDeviceMemoryProperties2 dmp;
218-
dmp.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2;
219-
dmp.pNext = &memoryBudget;
220-
221-
vkGetPhysicalDeviceMemoryProperties2(*(getPhysicalDevice()), &dmp);
222-
223-
auto& memoryProperties = dmp.memoryProperties;
224-
225-
VkMemoryPropertyFlags requiredPropertyFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
226-
227-
std::set<uint32_t> compatibleHeaps;
228-
for (uint32_t i = 0; i < memoryProperties.memoryTypeCount; ++i)
229-
{
230-
if ((memoryProperties.memoryTypes[i].propertyFlags & requiredPropertyFlags) == requiredPropertyFlags) // supported
231-
{
232-
compatibleHeaps.insert(memoryProperties.memoryTypes[i].heapIndex);
233-
}
234-
}
235-
236-
for (const auto& heapIndex : compatibleHeaps)
237-
{
238-
VkDeviceSize heapAvailable = memoryBudget.heapBudget[heapIndex] - memoryBudget.heapUsage[heapIndex];
239-
available += heapAvailable;
240-
}
241-
242-
if (includeMemoryPools)
243-
{
244-
if (auto pool = deviceMemoryBufferPools.ref_ptr())
245-
{
246-
available += pool->computeMemoryTotalAvailable();
247-
}
248-
}
249-
250-
return available;
251-
}
252-
253209
VkDeviceSize Device::availableMemory(VkMemoryPropertyFlags memoryPropertiesFlags, double allocatedMemoryLimit) const
254210
{
255211
VkPhysicalDeviceMemoryBudgetPropertiesEXT memoryBudget;

0 commit comments

Comments
 (0)