MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ find_memory_type()

uint32_t MayaFlux::Core::BackendResourceManager::find_memory_type ( uint32_t  type_filter,
vk::MemoryPropertyFlags  properties 
) const

Find a suitable memory type for Vulkan buffer allocation.

Parameters
type_filterMemory type bits filter
propertiesDesired memory property flags
Returns
Index of the suitable memory type

Definition at line 985 of file BackendResoureManager.cpp.

986{
987 vk::PhysicalDeviceMemoryProperties mem_properties;
988 mem_properties = m_context.get_physical_device().getMemoryProperties();
989
990 for (uint32_t i = 0; i < mem_properties.memoryTypeCount; i++) {
991 if ((type_filter & (1 << i)) && (mem_properties.memoryTypes[i].propertyFlags & properties) == properties) {
992 return i;
993 }
994 }
995
996 error<std::runtime_error>(
999 std::source_location::current(),
1000 "Failed to find suitable memory type");
1001
1002 return 0;
1003}
vk::PhysicalDevice get_physical_device() const
Get physical device.
Definition VKContext.hpp:44
@ GraphicsBackend
Graphics/visual rendering backend (Vulkan, OpenGL)
@ Core
Core engine, backend, subsystems.

References MayaFlux::Journal::Core, MayaFlux::Core::VKContext::get_physical_device(), MayaFlux::Journal::GraphicsBackend, and m_context.

Referenced by initialize_buffer(), and initialize_image().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: