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 959 of file BackendResoureManager.cpp.

960{
961 vk::PhysicalDeviceMemoryProperties mem_properties;
962 mem_properties = m_context.get_physical_device().getMemoryProperties();
963
964 for (uint32_t i = 0; i < mem_properties.memoryTypeCount; i++) {
965 if ((type_filter & (1 << i)) && (mem_properties.memoryTypes[i].propertyFlags & properties) == properties) {
966 return i;
967 }
968 }
969
970 error<std::runtime_error>(
973 std::source_location::current(),
974 "Failed to find suitable memory type");
975
976 return 0;
977}
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: