MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-ValidationLayers / UtilInitializeVma

Function UtilInitializeVma

layers/gpuav/core/gpuav_setup.cpp:159–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159static VkResult UtilInitializeVma(VkInstance instance, VkPhysicalDevice physical_device, VkDevice device,
160 VmaAllocator* pAllocator) {
161 VmaVulkanFunctions functions = {};
162 VmaAllocatorCreateInfo allocator_info = {};
163 allocator_info.instance = instance;
164 allocator_info.device = device;
165 allocator_info.physicalDevice = physical_device;
166
167 allocator_info.flags |= VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT;
168
169 functions.vkGetInstanceProcAddr = static_cast<PFN_vkGetInstanceProcAddr>(gpuVkGetInstanceProcAddr);
170 functions.vkGetDeviceProcAddr = static_cast<PFN_vkGetDeviceProcAddr>(gpuVkGetDeviceProcAddr);
171 functions.vkGetPhysicalDeviceProperties = static_cast<PFN_vkGetPhysicalDeviceProperties>(gpuVkGetPhysicalDeviceProperties);
172 functions.vkGetPhysicalDeviceMemoryProperties =
173 static_cast<PFN_vkGetPhysicalDeviceMemoryProperties>(gpuVkGetPhysicalDeviceMemoryProperties);
174 functions.vkAllocateMemory = static_cast<PFN_vkAllocateMemory>(gpuVkAllocateMemory);
175 functions.vkFreeMemory = static_cast<PFN_vkFreeMemory>(gpuVkFreeMemory);
176 functions.vkMapMemory = static_cast<PFN_vkMapMemory>(gpuVkMapMemory);
177 functions.vkUnmapMemory = static_cast<PFN_vkUnmapMemory>(gpuVkUnmapMemory);
178 functions.vkFlushMappedMemoryRanges = static_cast<PFN_vkFlushMappedMemoryRanges>(gpuVkFlushMappedMemoryRanges);
179 functions.vkInvalidateMappedMemoryRanges = static_cast<PFN_vkInvalidateMappedMemoryRanges>(gpuVkInvalidateMappedMemoryRanges);
180 functions.vkBindBufferMemory = static_cast<PFN_vkBindBufferMemory>(gpuVkBindBufferMemory);
181 functions.vkBindImageMemory = static_cast<PFN_vkBindImageMemory>(gpuVkBindImageMemory);
182 functions.vkGetBufferMemoryRequirements = static_cast<PFN_vkGetBufferMemoryRequirements>(gpuVkGetBufferMemoryRequirements);
183 functions.vkGetImageMemoryRequirements = static_cast<PFN_vkGetImageMemoryRequirements>(gpuVkGetImageMemoryRequirements);
184 functions.vkCreateBuffer = static_cast<PFN_vkCreateBuffer>(gpuVkCreateBuffer);
185 functions.vkDestroyBuffer = static_cast<PFN_vkDestroyBuffer>(gpuVkDestroyBuffer);
186 functions.vkCreateImage = static_cast<PFN_vkCreateImage>(gpuVkCreateImage);
187 functions.vkDestroyImage = static_cast<PFN_vkDestroyImage>(gpuVkDestroyImage);
188 functions.vkCmdCopyBuffer = static_cast<PFN_vkCmdCopyBuffer>(gpuVkCmdCopyBuffer);
189 allocator_info.pVulkanFunctions = &functions;
190
191 return vmaCreateAllocator(&allocator_info, pAllocator);
192}
193
194void Instance::PreCallRecordCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo,
195 const VkAllocationCallbacks* pAllocator, VkDevice* pDevice, const RecordObject& record_obj,

Callers 1

FinishDeviceSetupMethod · 0.85

Calls 1

vmaCreateAllocatorFunction · 0.85

Tested by

no test coverage detected