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 "GrTypes.h" |
13 #include "vk/GrVkDefines.h" | 13 #include "vk/GrVkDefines.h" |
14 | 14 |
15 /** | 15 /** |
16 * KHR_debug | 16 * KHR_debug |
17 */ | 17 */ |
18 /*typedef void (GR_GL_FUNCTION_TYPE* GrVkDEBUGPROC)(GrVkenum source, | 18 /*typedef void (GR_GL_FUNCTION_TYPE* GrVkDEBUGPROC)(GrVkenum source, |
19 GrVkenum type, | 19 GrVkenum type, |
20 GrVkuint id, | 20 GrVkuint id, |
21 GrVkenum severity, | 21 GrVkenum severity, |
22 GrVksizei length, | 22 GrVksizei length, |
23 const GrVkchar* message, | 23 const GrVkchar* message, |
24 const void* userParam);*/ | 24 const void* userParam);*/ |
25 | 25 |
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 VkDeviceSize fSize; // this can be indeterminate iff Tex uses borrow se
mantics |
37 }; | 37 }; |
38 | 38 |
39 struct GrVkImageInfo { | 39 struct GrVkImageInfo { |
40 /** | 40 /** |
41 * 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 |
42 * 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. |
43 */ | 43 */ |
44 VkImage fImage; | 44 VkImage fImage; |
45 GrVkAlloc fAlloc; | 45 GrVkAlloc fAlloc; |
46 VkImageTiling fImageTiling; | 46 VkImageTiling fImageTiling; |
47 VkImageLayout fImageLayout; | 47 VkImageLayout fImageLayout; |
48 VkFormat fFormat; | 48 VkFormat fFormat; |
49 uint32_t fLevelCount; | 49 uint32_t fLevelCount; |
50 | 50 |
51 // 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 |
52 // 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 |
53 // to our internal GrVkImageInfo by calling getTextureHandle on a GrVkTextur
e. | 53 // to our internal GrVkImageInfo by calling getTextureHandle on a GrVkTextur
e. |
54 void updateImageLayout(VkImageLayout layout) { fImageLayout = layout; } | 54 void updateImageLayout(VkImageLayout layout) { fImageLayout = layout; } |
55 }; | 55 }; |
56 | 56 |
57 GR_STATIC_ASSERT(sizeof(GrBackendObject) >= sizeof(const GrVkImageInfo*)); | 57 GR_STATIC_ASSERT(sizeof(GrBackendObject) >= sizeof(const GrVkImageInfo*)); |
58 | 58 |
59 #endif | 59 #endif |
OLD | NEW |