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 |
11 | 11 |
| 12 #include "GrTypes.h" |
12 #include "vk/GrVkDefines.h" | 13 #include "vk/GrVkDefines.h" |
13 | 14 |
14 /** | 15 /** |
15 * KHR_debug | 16 * KHR_debug |
16 */ | 17 */ |
17 /*typedef void (GR_GL_FUNCTION_TYPE* GrVkDEBUGPROC)(GrVkenum source, | 18 /*typedef void (GR_GL_FUNCTION_TYPE* GrVkDEBUGPROC)(GrVkenum source, |
18 GrVkenum type, | 19 GrVkenum type, |
19 GrVkuint id, | 20 GrVkuint id, |
20 GrVkenum severity, | 21 GrVkenum severity, |
21 GrVksizei length, | 22 GrVksizei length, |
22 const GrVkchar* message, | 23 const GrVkchar* message, |
23 const void* userParam);*/ | 24 const void* userParam);*/ |
24 | 25 |
25 | 26 |
26 | 27 |
27 /////////////////////////////////////////////////////////////////////////////// | 28 /////////////////////////////////////////////////////////////////////////////// |
28 /** | 29 /** |
29 * 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 |
30 * Vulkan textures are really const GrVkImageInfo* | 31 * Vulkan textures are really const GrVkImageInfo* |
31 */ | 32 */ |
| 33 struct GrVkAlloc { |
| 34 VkDeviceMemory fMemory; // can be VK_NULL_HANDLE iff Tex is an RT and uses
borrow semantics |
| 35 VkDeviceSize fOffset; |
| 36 }; |
| 37 |
32 struct GrVkImageInfo { | 38 struct GrVkImageInfo { |
33 /** | 39 /** |
34 * If the image's format is sRGB (GrVkFormatIsSRGB returns true), then the i
mage must have | 40 * 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. | 41 * been created with VkImageCreateFlags containing VK_IMAGE_CREATE_MUTABLE_F
ORMAT_BIT. |
36 */ | 42 */ |
37 VkImage fImage; | 43 VkImage fImage; |
38 VkDeviceMemory fAlloc; // can be VK_NULL_HANDLE iff Tex is an RT and uses
borrow semantics | 44 GrVkAlloc fAlloc; |
39 VkImageTiling fImageTiling; | 45 VkImageTiling fImageTiling; |
40 VkImageLayout fImageLayout; | 46 VkImageLayout fImageLayout; |
41 VkFormat fFormat; | 47 VkFormat fFormat; |
42 uint32_t fLevelCount; | 48 uint32_t fLevelCount; |
43 | 49 |
44 // This gives a way for a client to update the layout of the Image if they c
hange the layout | 50 // This gives a way for a client to update the layout of the Image if they c
hange the layout |
45 // while we're still holding onto the wrapped texture. They will first need
to get a handle | 51 // while we're still holding onto the wrapped texture. They will first need
to get a handle |
46 // to our internal GrVkImageInfo by calling getTextureHandle on a GrVkTextur
e. | 52 // to our internal GrVkImageInfo by calling getTextureHandle on a GrVkTextur
e. |
47 void updateImageLayout(VkImageLayout layout) { fImageLayout = layout; } | 53 void updateImageLayout(VkImageLayout layout) { fImageLayout = layout; } |
48 }; | 54 }; |
49 | 55 |
50 GR_STATIC_ASSERT(sizeof(GrBackendObject) >= sizeof(const GrVkImageInfo*)); | 56 GR_STATIC_ASSERT(sizeof(GrBackendObject) >= sizeof(const GrVkImageInfo*)); |
51 | 57 |
52 #endif | 58 #endif |
OLD | NEW |