MayaFlux 0.3.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 861 of file BackendResoureManager.cpp.

862{
863 vk::PhysicalDeviceMemoryProperties mem_properties;
864 mem_properties = m_context.get_physical_device().getMemoryProperties();
865
866 for (uint32_t i = 0; i < mem_properties.memoryTypeCount; i++) {
867 if ((type_filter & (1 << i)) && (mem_properties.memoryTypes[i].propertyFlags & properties) == properties) {
868 return i;
869 }
870 }
871
872 error<std::runtime_error>(
875 std::source_location::current(),
876 "Failed to find suitable memory type");
877
878 return 0;
879}
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: