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

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

Issue 1723503002: Revert of Add vulkan files into skia repo. (Closed) Base URL: https://skia.googlesource.com/skia.git@merge
Patch Set: Created 4 years, 10 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/GrVkBuffer.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
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef GrVkCaps_DEFINED
9 #define GrVkCaps_DEFINED
10
11 #include "GrCaps.h"
12 #include "GrVkStencilAttachment.h"
13 #include "vulkan/vulkan.h"
14
15 struct GrVkInterface;
16 class GrGLSLCaps;
17
18 /**
19 * Stores some capabilities of a Vk backend.
20 */
21 class GrVkCaps : public GrCaps {
22 public:
23 typedef GrVkStencilAttachment::Format StencilFormat;
24
25 /**
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.
28 */
29 GrVkCaps(const GrContextOptions& contextOptions, const GrVkInterface* vkInte rface,
30 VkPhysicalDevice device);
31
32 bool isConfigTexturable(GrPixelConfig config) const override {
33 SkASSERT(kGrPixelConfigCnt > config);
34 return fConfigTextureSupport[config];
35 }
36
37 bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const override {
38 SkASSERT(kGrPixelConfigCnt > config);
39 return fConfigRenderSupport[config][withMSAA];
40 }
41
42 bool isConfigRenderableLinearly(GrPixelConfig config, bool withMSAA) const {
43 SkASSERT(kGrPixelConfigCnt > config);
44 return fConfigLinearRenderSupport[config][withMSAA];
45 }
46
47 bool isConfigTexurableLinearly(GrPixelConfig config) const {
48 SkASSERT(kGrPixelConfigCnt > config);
49 return fConfigLinearTextureSupport[config];
50 }
51
52 /**
53 * Gets an array of legal stencil formats. These formats are not guaranteed to be supported by
54 * the driver but are legal VK_TEXTURE_FORMATs.
55 */
56 const SkTArray<StencilFormat, true>& stencilFormats() const {
57 return fStencilFormats;
58 }
59
60 /**
61 * Gets an array of legal stencil formats. These formats are not guaranteed to be supported by
62 * the driver but are legal VK_TEXTURE_FORMATs.
63 */
64 const SkTArray<StencilFormat, true>& linearStencilFormats() const {
65 return fLinearStencilFormats;
66 }
67
68 /**
69 * Returns the max number of sampled textures we can use in a program. This number is the max of
70 * max samplers and max sampled images. This number is technically the max s ampled textures we
71 * can have per stage, but we'll use it for the whole program since for now we only do texture
72 * lookups in the fragment shader.
73 */
74 int maxSampledTextures() const {
75 return fMaxSampledTextures;
76 }
77
78
79 GrGLSLCaps* glslCaps() const { return reinterpret_cast<GrGLSLCaps*>(fShaderC aps.get()); }
80
81 private:
82 void init(const GrContextOptions& contextOptions, const GrVkInterface* vkInt erface,
83 VkPhysicalDevice device);
84 void initSampleCount(const VkPhysicalDeviceProperties& properties);
85 void initGLSLCaps(const GrVkInterface* interface, VkPhysicalDevice physDev);
86 void initConfigRenderableTable(const GrVkInterface* interface, VkPhysicalDev ice physDev);
87 void initConfigTexturableTable(const GrVkInterface* interface, VkPhysicalDev ice physDev);
88 void initStencilFormats(const GrVkInterface* interface, VkPhysicalDevice phy sDev);
89
90
91 bool fConfigTextureSupport[kGrPixelConfigCnt];
92 // For Vulkan we track whether a config is supported linearly (without need for swizzling)
93 bool fConfigLinearTextureSupport[kGrPixelConfigCnt];
94
95 // The first entry for each config is without msaa and the second is with.
96 bool fConfigRenderSupport[kGrPixelConfigCnt][2];
97 // The first entry for each config is without msaa and the second is with.
98 bool fConfigLinearRenderSupport[kGrPixelConfigCnt][2];
99
100 SkTArray<StencilFormat, true> fLinearStencilFormats;
101 SkTArray<StencilFormat, true> fStencilFormats;
102
103 int fMaxSampledTextures;
104
105 typedef GrCaps INHERITED;
106 };
107
108 #endif
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkBuffer.cpp ('k') | src/gpu/vk/GrVkCaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698