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 16 matching lines...) Expand all Loading... |
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 VkDeviceSize fSize; // this can be indeterminate iff Tex uses borrow se
mantics |
| 37 uint32_t fFlags; |
| 38 |
| 39 enum Flag { |
| 40 kNoncoherent_Flag = 0x1, // memory must be flushed to device after map
ping |
| 41 }; |
37 }; | 42 }; |
38 | 43 |
39 struct GrVkImageInfo { | 44 struct GrVkImageInfo { |
40 /** | 45 /** |
41 * If the image's format is sRGB (GrVkFormatIsSRGB returns true), then the i
mage must have | 46 * If the image's format is sRGB (GrVkFormatIsSRGB returns true), then the i
mage must have |
42 * been created with VkImageCreateFlags containing VK_IMAGE_CREATE_MUTABLE_F
ORMAT_BIT. | 47 * been created with VkImageCreateFlags containing VK_IMAGE_CREATE_MUTABLE_F
ORMAT_BIT. |
43 */ | 48 */ |
44 VkImage fImage; | 49 VkImage fImage; |
45 GrVkAlloc fAlloc; | 50 GrVkAlloc fAlloc; |
46 VkImageTiling fImageTiling; | 51 VkImageTiling fImageTiling; |
47 VkImageLayout fImageLayout; | 52 VkImageLayout fImageLayout; |
48 VkFormat fFormat; | 53 VkFormat fFormat; |
49 uint32_t fLevelCount; | 54 uint32_t fLevelCount; |
50 | 55 |
51 // This gives a way for a client to update the layout of the Image if they c
hange the layout | 56 // This gives a way for a client to update the layout of the Image if they c
hange the layout |
52 // while we're still holding onto the wrapped texture. They will first need
to get a handle | 57 // while we're still holding onto the wrapped texture. They will first need
to get a handle |
53 // to our internal GrVkImageInfo by calling getTextureHandle on a GrVkTextur
e. | 58 // to our internal GrVkImageInfo by calling getTextureHandle on a GrVkTextur
e. |
54 void updateImageLayout(VkImageLayout layout) { fImageLayout = layout; } | 59 void updateImageLayout(VkImageLayout layout) { fImageLayout = layout; } |
55 }; | 60 }; |
56 | 61 |
57 GR_STATIC_ASSERT(sizeof(GrBackendObject) >= sizeof(const GrVkImageInfo*)); | 62 GR_STATIC_ASSERT(sizeof(GrBackendObject) >= sizeof(const GrVkImageInfo*)); |
58 | 63 |
59 #endif | 64 #endif |
OLD | NEW |