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 #ifndef VulkanTestContext_DEFINED | 8 #ifndef VulkanTestContext_DEFINED |
9 #define VulkanTestContext_DEFINED | 9 #define VulkanTestContext_DEFINED |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 struct BackbufferInfo { | 57 struct BackbufferInfo { |
58 uint32_t fImageIndex; // image this is associated with | 58 uint32_t fImageIndex; // image this is associated with |
59 VkSemaphore fAcquireSemaphore; // we signal on this for acquisiti
on of image | 59 VkSemaphore fAcquireSemaphore; // we signal on this for acquisiti
on of image |
60 VkSemaphore fRenderSemaphore; // we wait on this for rendering t
o be done | 60 VkSemaphore fRenderSemaphore; // we wait on this for rendering t
o be done |
61 VkCommandBuffer fTransitionCmdBuffers[2]; // to transition layout betwee
n present and render | 61 VkCommandBuffer fTransitionCmdBuffers[2]; // to transition layout betwee
n present and render |
62 VkFence fUsageFences[2]; // used to ensure this data is no
longer used on GPU | 62 VkFence fUsageFences[2]; // used to ensure this data is no
longer used on GPU |
63 }; | 63 }; |
64 | 64 |
65 BackbufferInfo* getAvailableBackbuffer(); | 65 BackbufferInfo* getAvailableBackbuffer(); |
66 bool createSwapchain(uint32_t width, uint32_t height); | 66 bool createSwapchain(uint32_t width, uint32_t height); |
67 void createBuffers(); | 67 void createBuffers(VkFormat format); |
68 void destroyBuffers(); | 68 void destroyBuffers(); |
69 | 69 |
70 SkAutoTUnref<const GrVkBackendContext> fBackendContext; | 70 SkAutoTUnref<const GrVkBackendContext> fBackendContext; |
71 | 71 |
72 GrContext* fContext; | 72 GrContext* fContext; |
73 VkSurfaceKHR fSurface; | 73 VkSurfaceKHR fSurface; |
74 VkSwapchainKHR fSwapchain; | 74 VkSwapchainKHR fSwapchain; |
75 uint32_t fPresentQueueIndex; | 75 uint32_t fPresentQueueIndex; |
76 VkQueue fPresentQueue; | 76 VkQueue fPresentQueue; |
77 int fWidth; | 77 int fWidth; |
78 int fHeight; | 78 int fHeight; |
79 GrPixelConfig fPixelConfig; | 79 GrPixelConfig fPixelConfig; |
80 | 80 |
81 uint32_t fImageCount; | 81 uint32_t fImageCount; |
82 VkImage* fImages; // images in the swapchain | 82 VkImage* fImages; // images in the swapchain |
83 VkImageLayout* fImageLayouts; // layouts of these images when not color
attachment | 83 VkImageLayout* fImageLayouts; // layouts of these images when not color
attachment |
84 sk_sp<SkSurface>* fSurfaces; // wrapped surface for those images | 84 sk_sp<SkSurface>* fSurfaces; // wrapped surface for those images |
85 VkCommandPool fCommandPool; | 85 VkCommandPool fCommandPool; |
86 BackbufferInfo* fBackbuffers; | 86 BackbufferInfo* fBackbuffers; |
87 uint32_t fCurrentBackbufferIndex; | 87 uint32_t fCurrentBackbufferIndex; |
88 }; | 88 }; |
89 | 89 |
90 #endif // SK_VULKAN | 90 #endif // SK_VULKAN |
91 | 91 |
92 #endif | 92 #endif |
OLD | NEW |