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 15 matching lines...) Expand all Loading... |
26 | 26 |
27 | 27 |
28 /////////////////////////////////////////////////////////////////////////////// | 28 /////////////////////////////////////////////////////////////////////////////// |
29 /** | 29 /** |
30 * Types for interacting with Vulkan resources created externally to Skia. GrBac
kendObjects for | 30 * Types for interacting with Vulkan resources created externally to Skia. GrBac
kendObjects for |
31 * Vulkan textures are really const GrVkImageInfo* | 31 * Vulkan textures are really const GrVkImageInfo* |
32 */ | 32 */ |
33 struct GrVkAlloc { | 33 struct GrVkAlloc { |
34 VkDeviceMemory fMemory; // can be VK_NULL_HANDLE iff Tex is an RT and uses
borrow semantics | 34 VkDeviceMemory fMemory; // can be VK_NULL_HANDLE iff Tex is an RT and uses
borrow semantics |
35 VkDeviceSize fOffset; | 35 VkDeviceSize fOffset; |
| 36 VkDeviceSize fSize; // this can be indeterminate iff Tex uses borrow se
mantics |
36 }; | 37 }; |
37 | 38 |
38 struct GrVkImageInfo { | 39 struct GrVkImageInfo { |
39 /** | 40 /** |
40 * If the image's format is sRGB (GrVkFormatIsSRGB returns true), then the i
mage must have | 41 * If the image's format is sRGB (GrVkFormatIsSRGB returns true), then the i
mage must have |
41 * been created with VkImageCreateFlags containing VK_IMAGE_CREATE_MUTABLE_F
ORMAT_BIT. | 42 * been created with VkImageCreateFlags containing VK_IMAGE_CREATE_MUTABLE_F
ORMAT_BIT. |
42 */ | 43 */ |
43 VkImage fImage; | 44 VkImage fImage; |
44 GrVkAlloc fAlloc; | 45 GrVkAlloc fAlloc; |
45 VkImageTiling fImageTiling; | 46 VkImageTiling fImageTiling; |
46 VkImageLayout fImageLayout; | 47 VkImageLayout fImageLayout; |
47 VkFormat fFormat; | 48 VkFormat fFormat; |
48 uint32_t fLevelCount; | 49 uint32_t fLevelCount; |
49 | 50 |
50 // This gives a way for a client to update the layout of the Image if they c
hange the layout | 51 // This gives a way for a client to update the layout of the Image if they c
hange the layout |
51 // while we're still holding onto the wrapped texture. They will first need
to get a handle | 52 // while we're still holding onto the wrapped texture. They will first need
to get a handle |
52 // to our internal GrVkImageInfo by calling getTextureHandle on a GrVkTextur
e. | 53 // to our internal GrVkImageInfo by calling getTextureHandle on a GrVkTextur
e. |
53 void updateImageLayout(VkImageLayout layout) { fImageLayout = layout; } | 54 void updateImageLayout(VkImageLayout layout) { fImageLayout = layout; } |
54 }; | 55 }; |
55 | 56 |
56 GR_STATIC_ASSERT(sizeof(GrBackendObject) >= sizeof(const GrVkImageInfo*)); | 57 GR_STATIC_ASSERT(sizeof(GrBackendObject) >= sizeof(const GrVkImageInfo*)); |
57 | 58 |
58 #endif | 59 #endif |
OLD | NEW |