MayaFlux 0.1.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 771 of file BackendResoureManager.cpp.

772{
773 vk::PhysicalDeviceMemoryProperties mem_properties;
774 mem_properties = m_context.get_physical_device().getMemoryProperties();
775
776 for (uint32_t i = 0; i < mem_properties.memoryTypeCount; i++) {
777 if ((type_filter & (1 << i)) && (mem_properties.memoryTypes[i].propertyFlags & properties) == properties) {
778 return i;
779 }
780 }
781
782 error<std::runtime_error>(
785 std::source_location::current(),
786 "Failed to find suitable memory type");
787
788 return 0;
789}
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: