Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Unified Diff: src/gpu/vk/GrVkImage.cpp

Issue 2018933004: Add offset to memory allocations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix tests Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/vk/GrVkImage.cpp
diff --git a/src/gpu/vk/GrVkImage.cpp b/src/gpu/vk/GrVkImage.cpp
index d3195e7e8a0a9f41c6f96fe842e7b69aef471b65..bbef1b40e8b136b1182a60d33e6009895d054980 100644
--- a/src/gpu/vk/GrVkImage.cpp
+++ b/src/gpu/vk/GrVkImage.cpp
@@ -62,7 +62,7 @@ void GrVkImage::setImageLayout(const GrVkGpu* gpu, VkImageLayout newLayout,
bool GrVkImage::InitImageInfo(const GrVkGpu* gpu, const ImageDesc& imageDesc, GrVkImageInfo* info) {
VkImage image = 0;
- VkDeviceMemory alloc;
+ GrVkAlloc alloc;
VkImageLayout initialLayout = (VK_IMAGE_TILING_LINEAR == imageDesc.fImageTiling)
? VK_IMAGE_LAYOUT_PREINITIALIZED
@@ -118,10 +118,10 @@ bool GrVkImage::InitImageInfo(const GrVkGpu* gpu, const ImageDesc& imageDesc, Gr
void GrVkImage::DestroyImageInfo(const GrVkGpu* gpu, GrVkImageInfo* info) {
VK_CALL(gpu, DestroyImage(gpu->device(), info->fImage, nullptr));
- VK_CALL(gpu, FreeMemory(gpu->device(), info->fAlloc, nullptr));
+ GrVkMemory::FreeImageMemory(gpu, info->fAlloc);
}
-void GrVkImage::setNewResource(VkImage image, VkDeviceMemory alloc) {
+void GrVkImage::setNewResource(VkImage image, const GrVkAlloc& alloc) {
fResource = new Resource(image, alloc);
}
@@ -146,7 +146,7 @@ void GrVkImage::abandonImage() {
void GrVkImage::Resource::freeGPUData(const GrVkGpu* gpu) const {
VK_CALL(gpu, DestroyImage(gpu->device(), fImage, nullptr));
- VK_CALL(gpu, FreeMemory(gpu->device(), fAlloc, nullptr));
+ GrVkMemory::FreeImageMemory(gpu, fAlloc);
}
void GrVkImage::BorrowedResource::freeGPUData(const GrVkGpu* gpu) const {
« src/gpu/vk/GrVkBuffer.cpp ('K') | « src/gpu/vk/GrVkImage.h ('k') | src/gpu/vk/GrVkMemory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698