diff options
Diffstat (limited to 'chromium/gpu/vulkan/vma_wrapper.cc')
-rw-r--r-- | chromium/gpu/vulkan/vma_wrapper.cc | 63 |
1 files changed, 34 insertions, 29 deletions
diff --git a/chromium/gpu/vulkan/vma_wrapper.cc b/chromium/gpu/vulkan/vma_wrapper.cc index 1c8d72f598d..d0541c92ad6 100644 --- a/chromium/gpu/vulkan/vma_wrapper.cc +++ b/chromium/gpu/vulkan/vma_wrapper.cc @@ -18,27 +18,31 @@ VkResult CreateAllocator(VkPhysicalDevice physical_device, VmaAllocator* pAllocator) { auto* function_pointers = gpu::GetVulkanFunctionPointers(); VmaVulkanFunctions functions = { - function_pointers->vkGetPhysicalDevicePropertiesFn.get(), - function_pointers->vkGetPhysicalDeviceMemoryPropertiesFn.get(), - function_pointers->vkAllocateMemoryFn.get(), - function_pointers->vkFreeMemoryFn.get(), - function_pointers->vkMapMemoryFn.get(), - function_pointers->vkUnmapMemoryFn.get(), - function_pointers->vkFlushMappedMemoryRangesFn.get(), - function_pointers->vkInvalidateMappedMemoryRangesFn.get(), - function_pointers->vkBindBufferMemoryFn.get(), - function_pointers->vkBindImageMemoryFn.get(), - function_pointers->vkGetBufferMemoryRequirementsFn.get(), - function_pointers->vkGetImageMemoryRequirementsFn.get(), - function_pointers->vkCreateBufferFn.get(), - function_pointers->vkDestroyBufferFn.get(), - function_pointers->vkCreateImageFn.get(), - function_pointers->vkDestroyImageFn.get(), - function_pointers->vkCmdCopyBufferFn.get(), - function_pointers->vkGetBufferMemoryRequirements2Fn.get(), - function_pointers->vkGetImageMemoryRequirements2Fn.get(), + function_pointers->vkGetPhysicalDeviceProperties.get(), + function_pointers->vkGetPhysicalDeviceMemoryProperties.get(), + function_pointers->vkAllocateMemory.get(), + function_pointers->vkFreeMemory.get(), + function_pointers->vkMapMemory.get(), + function_pointers->vkUnmapMemory.get(), + function_pointers->vkFlushMappedMemoryRanges.get(), + function_pointers->vkInvalidateMappedMemoryRanges.get(), + function_pointers->vkBindBufferMemory.get(), + function_pointers->vkBindImageMemory.get(), + function_pointers->vkGetBufferMemoryRequirements.get(), + function_pointers->vkGetImageMemoryRequirements.get(), + function_pointers->vkCreateBuffer.get(), + function_pointers->vkDestroyBuffer.get(), + function_pointers->vkCreateImage.get(), + function_pointers->vkDestroyImage.get(), + function_pointers->vkCmdCopyBuffer.get(), + function_pointers->vkGetBufferMemoryRequirements2.get(), + function_pointers->vkGetImageMemoryRequirements2.get(), + function_pointers->vkBindBufferMemory2.get(), + function_pointers->vkBindImageMemory2.get(), + function_pointers->vkGetPhysicalDeviceMemoryProperties2.get(), }; + static_assert(kVulkanRequiredApiVersion >= VK_API_VERSION_1_1, ""); VmaAllocatorCreateInfo allocator_info = { .flags = VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT, .physicalDevice = physical_device, @@ -51,6 +55,7 @@ VkResult CreateAllocator(VkPhysicalDevice physical_device, .preferredLargeHeapBlockSize = 4 * 1024 * 1024, .pVulkanFunctions = &functions, .instance = instance, + .vulkanApiVersion = kVulkanRequiredApiVersion, }; return vmaCreateAllocator(&allocator_info, pAllocator); @@ -113,18 +118,18 @@ void FreeMemory(VmaAllocator allocator, VmaAllocation allocation) { vmaFreeMemory(allocator, allocation); } -void FlushAllocation(VmaAllocator allocator, - VmaAllocation allocation, - VkDeviceSize offset, - VkDeviceSize size) { - vmaFlushAllocation(allocator, allocation, offset, size); +VkResult FlushAllocation(VmaAllocator allocator, + VmaAllocation allocation, + VkDeviceSize offset, + VkDeviceSize size) { + return vmaFlushAllocation(allocator, allocation, offset, size); } -void InvalidateAllocation(VmaAllocator allocator, - VmaAllocation allocation, - VkDeviceSize offset, - VkDeviceSize size) { - vmaInvalidateAllocation(allocator, allocation, offset, size); +VkResult InvalidateAllocation(VmaAllocator allocator, + VmaAllocation allocation, + VkDeviceSize offset, + VkDeviceSize size) { + return vmaInvalidateAllocation(allocator, allocation, offset, size); } void GetAllocationInfo(VmaAllocator allocator, |