| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2016 Google Inc. | 3 * Copyright 2016 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #ifndef GrVkTypes_DEFINED | 9 #ifndef GrVkTypes_DEFINED |
| 10 #define GrVkTypes_DEFINED | 10 #define GrVkTypes_DEFINED |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 const void* userParam);*/ | 23 const void* userParam);*/ |
| 24 | 24 |
| 25 | 25 |
| 26 | 26 |
| 27 /////////////////////////////////////////////////////////////////////////////// | 27 /////////////////////////////////////////////////////////////////////////////// |
| 28 /** | 28 /** |
| 29 * Types for interacting with Vulkan resources created externally to Skia. GrBac
kendObjects for | 29 * Types for interacting with Vulkan resources created externally to Skia. GrBac
kendObjects for |
| 30 * Vulkan textures are really const GrVkImageInfo* | 30 * Vulkan textures are really const GrVkImageInfo* |
| 31 */ | 31 */ |
| 32 struct GrVkImageInfo { | 32 struct GrVkImageInfo { |
| 33 /** |
| 34 * If the image's format is sRGB (GrVkFormatIsSRGB returns true), then the i
mage must have |
| 35 * been created with VkImageCreateFlags containing VK_IMAGE_CREATE_MUTABLE_F
ORMAT_BIT. |
| 36 */ |
| 33 VkImage fImage; | 37 VkImage fImage; |
| 34 VkDeviceMemory fAlloc; // can be VK_NULL_HANDLE iff Tex is an RT and uses
borrow semantics | 38 VkDeviceMemory fAlloc; // can be VK_NULL_HANDLE iff Tex is an RT and uses
borrow semantics |
| 35 VkImageTiling fImageTiling; | 39 VkImageTiling fImageTiling; |
| 36 VkImageLayout fImageLayout; | 40 VkImageLayout fImageLayout; |
| 37 VkFormat fFormat; | 41 VkFormat fFormat; |
| 38 uint32_t fLevelCount; | 42 uint32_t fLevelCount; |
| 39 | 43 |
| 40 // This gives a way for a client to update the layout of the Image if they c
hange the layout | 44 // This gives a way for a client to update the layout of the Image if they c
hange the layout |
| 41 // while we're still holding onto the wrapped texture. They will first need
to get a handle | 45 // while we're still holding onto the wrapped texture. They will first need
to get a handle |
| 42 // to our internal GrVkImageInfo by calling getTextureHandle on a GrVkTextur
e. | 46 // to our internal GrVkImageInfo by calling getTextureHandle on a GrVkTextur
e. |
| 43 void updateImageLayout(VkImageLayout layout) { fImageLayout = layout; } | 47 void updateImageLayout(VkImageLayout layout) { fImageLayout = layout; } |
| 44 }; | 48 }; |
| 45 | 49 |
| 46 GR_STATIC_ASSERT(sizeof(GrBackendObject) >= sizeof(const GrVkImageInfo*)); | 50 GR_STATIC_ASSERT(sizeof(GrBackendObject) >= sizeof(const GrVkImageInfo*)); |
| 47 | 51 |
| 48 #endif | 52 #endif |
| OLD | NEW |