From 18dbfd05e435bdfbc85d436f0ec29ccbbc450291 Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Tue, 29 May 2018 10:46:51 -0400 Subject: Reland "Create API for GrVkMemoryAllocator and impliment use of AMD VulkanMemoryAllocator on this API." This reverts commit 98bddf930e4a8767bca60d84d585c386fabfc6b7. Reason for revert: Original change's description: > Revert "Create API for GrVkMemoryAllocator and impliment use of AMD VulkanMemoryAllocator on this API." > > This reverts commit 26c0e4c1f54759249c2d61b50fb5430bd73793f2. > > Reason for revert: breaks roll into fuchsia > > Original change's description: > > Create API for GrVkMemoryAllocator and impliment use of AMD VulkanMemoryAllocator on this API. > > > > Bug: skia: > > Change-Id: I1e122e1b11ab308c2f83cb98c36c81511f4507d0 > > Reviewed-on: https://skia-review.googlesource.com/129980 > > Commit-Queue: Greg Daniel > > Reviewed-by: Brian Salomon > > Reviewed-by: Jim Van Verth > > > > Change-Id: I6c74978f778987c422e6162e7dd85ea9c6baa0e4 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/130182 > Reviewed-by: Greg Daniel > Commit-Queue: Greg Daniel Bug: skia: Change-Id: I422ffb3562da567f2e85c806286ad1a17c3862cd Reviewed-on: https://skia-review.googlesource.com/130183 Reviewed-by: Greg Daniel Commit-Queue: Greg Daniel --- include/gpu/vk/GrVkTypes.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'include/gpu/vk/GrVkTypes.h') diff --git a/include/gpu/vk/GrVkTypes.h b/include/gpu/vk/GrVkTypes.h index 0f7ff71d2e..2e31250324 100644 --- a/include/gpu/vk/GrVkTypes.h +++ b/include/gpu/vk/GrVkTypes.h @@ -26,6 +26,9 @@ /////////////////////////////////////////////////////////////////////////////// + +typedef intptr_t GrVkBackendMemory; + /** * Types for interacting with Vulkan resources created externally to Skia. GrBackendObjects for * Vulkan textures are really const GrVkImageInfo* @@ -36,6 +39,7 @@ struct GrVkAlloc { , fOffset(0) , fSize(0) , fFlags(0) + , fBackendMemory(0) , fUsesSystemHeap(false) {} GrVkAlloc(VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, uint32_t flags) @@ -43,15 +47,18 @@ struct GrVkAlloc { , fOffset(offset) , fSize(size) , fFlags(flags) + , fBackendMemory(0) , fUsesSystemHeap(false) {} - VkDeviceMemory fMemory; // can be VK_NULL_HANDLE iff is an RT and is borrowed - VkDeviceSize fOffset; - VkDeviceSize fSize; // this can be indeterminate iff Tex uses borrow semantics - uint32_t fFlags; + VkDeviceMemory fMemory; // can be VK_NULL_HANDLE iff is an RT and is borrowed + VkDeviceSize fOffset; + VkDeviceSize fSize; // this can be indeterminate iff Tex uses borrow semantics + uint32_t fFlags; + GrVkBackendMemory fBackendMemory; // handle to memory allocated via GrVkMemoryAllocator. enum Flag { kNoncoherent_Flag = 0x1, // memory must be flushed to device after mapping + kMappable_Flag = 0x2, // memory is able to be mapped. }; bool operator==(const GrVkAlloc& that) const { -- cgit v1.2.3