OLD | NEW |
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 |
(...skipping 12 matching lines...) Expand all Loading... |
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, uint32_t featureFlags, uint32_t extensionF
lags); | 30 VkPhysicalDevice device, uint32_t featureFlags, uint32_t extensionF
lags); |
31 | 31 |
32 bool isConfigTexturable(GrPixelConfig config) const override { | 32 bool isConfigTexturable(GrPixelConfig config) const override { |
33 SkASSERT(kGrPixelConfigCnt > config); | |
34 return SkToBool(ConfigInfo::kTextureable_Flag & fConfigTable[config].fOp
timalFlags); | 33 return SkToBool(ConfigInfo::kTextureable_Flag & fConfigTable[config].fOp
timalFlags); |
35 } | 34 } |
36 | 35 |
37 bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const override
{ | 36 bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const override
{ |
38 SkASSERT(kGrPixelConfigCnt > config); | |
39 return SkToBool(ConfigInfo::kRenderable_Flag & fConfigTable[config].fOpt
imalFlags); | 37 return SkToBool(ConfigInfo::kRenderable_Flag & fConfigTable[config].fOpt
imalFlags); |
40 } | 38 } |
41 | 39 |
42 bool isConfigTexurableLinearly(GrPixelConfig config) const { | 40 bool isConfigTexurableLinearly(GrPixelConfig config) const { |
43 SkASSERT(kGrPixelConfigCnt > config); | |
44 return SkToBool(ConfigInfo::kTextureable_Flag & fConfigTable[config].fLi
nearFlags); | 41 return SkToBool(ConfigInfo::kTextureable_Flag & fConfigTable[config].fLi
nearFlags); |
45 } | 42 } |
46 | 43 |
47 bool isConfigRenderableLinearly(GrPixelConfig config, bool withMSAA) const { | 44 bool isConfigRenderableLinearly(GrPixelConfig config, bool withMSAA) const { |
48 SkASSERT(kGrPixelConfigCnt > config); | |
49 return !withMSAA && SkToBool(ConfigInfo::kRenderable_Flag & | 45 return !withMSAA && SkToBool(ConfigInfo::kRenderable_Flag & |
50 fConfigTable[config].fLinearFlags); | 46 fConfigTable[config].fLinearFlags); |
51 } | 47 } |
52 | 48 |
53 bool configCanBeDstofBlit(GrPixelConfig config, bool linearTiled) const { | 49 bool configCanBeDstofBlit(GrPixelConfig config, bool linearTiled) const { |
54 SkASSERT(kGrPixelConfigCnt > config); | |
55 const uint16_t& flags = linearTiled ? fConfigTable[config].fLinearFlags
: | 50 const uint16_t& flags = linearTiled ? fConfigTable[config].fLinearFlags
: |
56 fConfigTable[config].fOptimalFlags
; | 51 fConfigTable[config].fOptimalFlags
; |
57 return SkToBool(ConfigInfo::kBlitDst_Flag & flags); | 52 return SkToBool(ConfigInfo::kBlitDst_Flag & flags); |
58 } | 53 } |
59 | 54 |
60 bool configCanBeSrcofBlit(GrPixelConfig config, bool linearTiled) const { | 55 bool configCanBeSrcofBlit(GrPixelConfig config, bool linearTiled) const { |
61 SkASSERT(kGrPixelConfigCnt > config); | |
62 const uint16_t& flags = linearTiled ? fConfigTable[config].fLinearFlags
: | 56 const uint16_t& flags = linearTiled ? fConfigTable[config].fLinearFlags
: |
63 fConfigTable[config].fOptimalFlags
; | 57 fConfigTable[config].fOptimalFlags
; |
64 return SkToBool(ConfigInfo::kBlitSrc_Flag & flags); | 58 return SkToBool(ConfigInfo::kBlitSrc_Flag & flags); |
65 } | 59 } |
66 | 60 |
67 bool canUseGLSLForShaderModule() const { | 61 bool canUseGLSLForShaderModule() const { |
68 return fCanUseGLSLForShaderModule; | 62 return fCanUseGLSLForShaderModule; |
69 } | 63 } |
70 | 64 |
71 /** | 65 /** |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 104 |
111 StencilFormat fPreferedStencilFormat; | 105 StencilFormat fPreferedStencilFormat; |
112 | 106 |
113 // Tells of if we can pass in straight GLSL string into vkCreateShaderModule | 107 // Tells of if we can pass in straight GLSL string into vkCreateShaderModule |
114 bool fCanUseGLSLForShaderModule; | 108 bool fCanUseGLSLForShaderModule; |
115 | 109 |
116 typedef GrCaps INHERITED; | 110 typedef GrCaps INHERITED; |
117 }; | 111 }; |
118 | 112 |
119 #endif | 113 #endif |
OLD | NEW |