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

Side by Side Diff: src/gpu/vk/GrVkCaps.h

Issue 1832613003: Revise layer, extension and feature setup for Vulkan (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove extra def of ENABLE_VK_LAYERS Created 4 years, 9 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
« no previous file with comments | « src/gpu/vk/GrVkBackendContext.cpp ('k') | src/gpu/vk/GrVkCaps.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrVkCaps_DEFINED 8 #ifndef GrVkCaps_DEFINED
9 #define GrVkCaps_DEFINED 9 #define GrVkCaps_DEFINED
10 10
11 #include "GrCaps.h" 11 #include "GrCaps.h"
12 #include "GrVkStencilAttachment.h" 12 #include "GrVkStencilAttachment.h"
13 #include "vulkan/vulkan.h" 13 #include "vulkan/vulkan.h"
14 14
15 struct GrVkInterface; 15 struct GrVkInterface;
16 class GrGLSLCaps; 16 class GrGLSLCaps;
17 17
18 /** 18 /**
19 * Stores some capabilities of a Vk backend. 19 * Stores some capabilities of a Vk backend.
20 */ 20 */
21 class GrVkCaps : public GrCaps { 21 class GrVkCaps : public GrCaps {
22 public: 22 public:
23 typedef GrVkStencilAttachment::Format StencilFormat; 23 typedef GrVkStencilAttachment::Format StencilFormat;
24 24
25 /** 25 /**
26 * Creates a GrVkCaps that is set such that nothing is supported. The init f unction should 26 * Creates a GrVkCaps that is set such that nothing is supported. The init f unction should
27 * be called to fill out the caps. 27 * be called to fill out the caps.
28 */ 28 */
29 GrVkCaps(const GrContextOptions& contextOptions, const GrVkInterface* vkInte rface, 29 GrVkCaps(const GrContextOptions& contextOptions, const GrVkInterface* vkInte rface,
30 VkPhysicalDevice device); 30 VkPhysicalDevice device, uint32_t featureFlags);
31 31
32 bool isConfigTexturable(GrPixelConfig config) const override { 32 bool isConfigTexturable(GrPixelConfig config) const override {
33 SkASSERT(kGrPixelConfigCnt > config); 33 SkASSERT(kGrPixelConfigCnt > config);
34 return fConfigTextureSupport[config]; 34 return fConfigTextureSupport[config];
35 } 35 }
36 36
37 bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const override { 37 bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const override {
38 SkASSERT(kGrPixelConfigCnt > config); 38 SkASSERT(kGrPixelConfigCnt > config);
39 return fConfigRenderSupport[config][withMSAA]; 39 return fConfigRenderSupport[config][withMSAA];
40 } 40 }
(...skipping 21 matching lines...) Expand all
62 * the driver but are legal VK_TEXTURE_FORMATs. 62 * the driver but are legal VK_TEXTURE_FORMATs.
63 */ 63 */
64 const SkTArray<StencilFormat, true>& linearStencilFormats() const { 64 const SkTArray<StencilFormat, true>& linearStencilFormats() const {
65 return fLinearStencilFormats; 65 return fLinearStencilFormats;
66 } 66 }
67 67
68 GrGLSLCaps* glslCaps() const { return reinterpret_cast<GrGLSLCaps*>(fShaderC aps.get()); } 68 GrGLSLCaps* glslCaps() const { return reinterpret_cast<GrGLSLCaps*>(fShaderC aps.get()); }
69 69
70 private: 70 private:
71 void init(const GrContextOptions& contextOptions, const GrVkInterface* vkInt erface, 71 void init(const GrContextOptions& contextOptions, const GrVkInterface* vkInt erface,
72 VkPhysicalDevice device); 72 VkPhysicalDevice device, uint32_t featureFlags);
73 void initGrCaps(const VkPhysicalDeviceProperties&, 73 void initGrCaps(const VkPhysicalDeviceProperties&,
74 const VkPhysicalDeviceFeatures&, 74 const VkPhysicalDeviceMemoryProperties&,
75 const VkPhysicalDeviceMemoryProperties&); 75 uint32_t featureFlags);
76 void initGLSLCaps(const VkPhysicalDeviceFeatures&, const VkPhysicalDevicePro perties&); 76 void initGLSLCaps(const VkPhysicalDeviceProperties&, uint32_t featureFlags);
77 void initSampleCount(const VkPhysicalDeviceProperties& properties); 77 void initSampleCount(const VkPhysicalDeviceProperties& properties);
78 void initConfigRenderableTable(const GrVkInterface* interface, VkPhysicalDev ice physDev); 78 void initConfigRenderableTable(const GrVkInterface* interface, VkPhysicalDev ice physDev);
79 void initConfigTexturableTable(const GrVkInterface* interface, VkPhysicalDev ice physDev); 79 void initConfigTexturableTable(const GrVkInterface* interface, VkPhysicalDev ice physDev);
80 void initStencilFormats(const GrVkInterface* interface, VkPhysicalDevice phy sDev); 80 void initStencilFormats(const GrVkInterface* interface, VkPhysicalDevice phy sDev);
81 81
82 82
83 bool fConfigTextureSupport[kGrPixelConfigCnt]; 83 bool fConfigTextureSupport[kGrPixelConfigCnt];
84 // For Vulkan we track whether a config is supported linearly (without need for swizzling) 84 // For Vulkan we track whether a config is supported linearly (without need for swizzling)
85 bool fConfigLinearTextureSupport[kGrPixelConfigCnt]; 85 bool fConfigLinearTextureSupport[kGrPixelConfigCnt];
86 86
87 // The first entry for each config is without msaa and the second is with. 87 // The first entry for each config is without msaa and the second is with.
88 bool fConfigRenderSupport[kGrPixelConfigCnt][2]; 88 bool fConfigRenderSupport[kGrPixelConfigCnt][2];
89 // The first entry for each config is without msaa and the second is with. 89 // The first entry for each config is without msaa and the second is with.
90 bool fConfigLinearRenderSupport[kGrPixelConfigCnt][2]; 90 bool fConfigLinearRenderSupport[kGrPixelConfigCnt][2];
91 91
92 SkTArray<StencilFormat, true> fLinearStencilFormats; 92 SkTArray<StencilFormat, true> fLinearStencilFormats;
93 SkTArray<StencilFormat, true> fStencilFormats; 93 SkTArray<StencilFormat, true> fStencilFormats;
94 94
95 typedef GrCaps INHERITED; 95 typedef GrCaps INHERITED;
96 }; 96 };
97 97
98 #endif 98 #endif
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkBackendContext.cpp ('k') | src/gpu/vk/GrVkCaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698