OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrVkGpu.h" | 8 #include "GrVkGpu.h" |
9 #include "GrVkImage.h" | 9 #include "GrVkImage.h" |
10 #include "GrVkMemory.h" | 10 #include "GrVkMemory.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 if (newLayout == currentLayout) { | 37 if (newLayout == currentLayout) { |
38 return; | 38 return; |
39 } | 39 } |
40 | 40 |
41 VkAccessFlags srcAccessMask = GrVkMemory::LayoutToSrcAccessMask(currentLayou
t); | 41 VkAccessFlags srcAccessMask = GrVkMemory::LayoutToSrcAccessMask(currentLayou
t); |
42 VkPipelineStageFlags srcStageMask = GrVkMemory::LayoutToPipelineStageFlags(c
urrentLayout); | 42 VkPipelineStageFlags srcStageMask = GrVkMemory::LayoutToPipelineStageFlags(c
urrentLayout); |
43 | 43 |
44 VkImageAspectFlags aspectFlags = vk_format_to_aspect_flags(fInfo.fFormat); | 44 VkImageAspectFlags aspectFlags = vk_format_to_aspect_flags(fInfo.fFormat); |
45 VkImageMemoryBarrier imageMemoryBarrier = { | 45 VkImageMemoryBarrier imageMemoryBarrier = { |
46 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // sType | 46 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // sType |
47 NULL, // pNext | 47 nullptr, // pNext |
48 srcAccessMask, // outputMask | 48 srcAccessMask, // outputMask |
49 dstAccessMask, // inputMask | 49 dstAccessMask, // inputMask |
50 currentLayout, // oldLayout | 50 currentLayout, // oldLayout |
51 newLayout, // newLayout | 51 newLayout, // newLayout |
52 VK_QUEUE_FAMILY_IGNORED, // srcQueueFamilyIndex | 52 VK_QUEUE_FAMILY_IGNORED, // srcQueueFamilyIndex |
53 VK_QUEUE_FAMILY_IGNORED, // dstQueueFamilyIndex | 53 VK_QUEUE_FAMILY_IGNORED, // dstQueueFamilyIndex |
54 fInfo.fImage, // image | 54 fInfo.fImage, // image |
55 { aspectFlags, 0, fInfo.fLevelCount, 0, 1 } // subresourceRange | 55 { aspectFlags, 0, fInfo.fLevelCount, 0, 1 } // subresourceRange |
56 }; | 56 }; |
57 | 57 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 } | 149 } |
150 | 150 |
151 void GrVkImage::Resource::freeGPUData(const GrVkGpu* gpu) const { | 151 void GrVkImage::Resource::freeGPUData(const GrVkGpu* gpu) const { |
152 VK_CALL(gpu, DestroyImage(gpu->device(), fImage, nullptr)); | 152 VK_CALL(gpu, DestroyImage(gpu->device(), fImage, nullptr)); |
153 bool isLinear = (VK_IMAGE_TILING_LINEAR == fImageTiling); | 153 bool isLinear = (VK_IMAGE_TILING_LINEAR == fImageTiling); |
154 GrVkMemory::FreeImageMemory(gpu, isLinear, fAlloc); | 154 GrVkMemory::FreeImageMemory(gpu, isLinear, fAlloc); |
155 } | 155 } |
156 | 156 |
157 void GrVkImage::BorrowedResource::freeGPUData(const GrVkGpu* gpu) const { | 157 void GrVkImage::BorrowedResource::freeGPUData(const GrVkGpu* gpu) const { |
158 } | 158 } |
OLD | NEW |