Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: include/gpu/vk/GrVkTypes.h

Issue 1974983002: Refactor Vulkan image, texture, RTs so that create and getter handles match. (Closed) Base URL: https://skia.googlesource.com/skia.git@fixLayerVersion
Patch Set: Remove templated create Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "vk/GrVkDefines.h" 12 #include "vk/GrVkDefines.h"
13 13
14 /** 14 /**
15 * KHR_debug 15 * KHR_debug
16 */ 16 */
17 /*typedef void (GR_GL_FUNCTION_TYPE* GrVkDEBUGPROC)(GrVkenum source, 17 /*typedef void (GR_GL_FUNCTION_TYPE* GrVkDEBUGPROC)(GrVkenum source,
18 GrVkenum type, 18 GrVkenum type,
19 GrVkuint id, 19 GrVkuint id,
20 GrVkenum severity, 20 GrVkenum severity,
21 GrVksizei length, 21 GrVksizei length,
22 const GrVkchar* message, 22 const GrVkchar* message,
23 const void* userParam);*/ 23 const void* userParam);*/
24 24
25 25
26 26
27 /////////////////////////////////////////////////////////////////////////////// 27 ///////////////////////////////////////////////////////////////////////////////
28 /** 28 /**
29 * Types for interacting with Vulkan resources created externally to Skia. GrBac kendObjects for 29 * Types for interacting with Vulkan resources created externally to Skia. GrBac kendObjects for
30 * Vulkan textures are really const GrVkTextureInfo* 30 * Vulkan textures are really const GrVkImageInfo*
31 */ 31 */
32 32 struct GrVkImageInfo {
33 struct GrVkTextureInfo {
34 VkImage fImage; 33 VkImage fImage;
35 VkDeviceMemory fAlloc; // this may be null iff the texture is an RT and u ses borrow semantics 34 VkDeviceMemory fAlloc; // can be VK_NULL_HANDLE iff Tex is an RT and uses borrow semantics
36 VkImageTiling fImageTiling; 35 VkImageTiling fImageTiling;
37 VkImageLayout fImageLayout; 36 VkImageLayout fImageLayout;
38 VkFormat fFormat; 37 VkFormat fFormat;
39 uint32_t fLevelCount; 38 uint32_t fLevelCount;
39
40 // This gives a way for a client to update the layout of the Image if they c hange the layout
41 // while we're still holding onto the wrapped texture.
42 void updateImageLayout(VkImageLayout layout) { fImageLayout = layout; }
jvanverth1 2016/05/13 16:14:40 I don't understand how this would be used. The ori
egdaniel 2016/05/13 18:00:05 When they call getTextureHandle they will get a po
40 }; 43 };
41 44
42 GR_STATIC_ASSERT(sizeof(GrBackendObject) >= sizeof(const GrVkTextureInfo*)); 45 GR_STATIC_ASSERT(sizeof(GrBackendObject) >= sizeof(const GrVkImageInfo*));
43 46
44 #endif 47 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698