blob: 9d38c82ced58b79b7d2968556bb750c2e370bf95 [file] [log] [blame]
bsalomon@google.comf7fa8062012-02-14 14:09:57 +00001/*
2 * Copyright 2012 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
9#ifndef GrGLCaps_DEFINED
10#define GrGLCaps_DEFINED
11
bsalomoneb1cb5c2015-05-22 08:01:09 -070012#include "GrCaps.h"
egdaniel8dc7c3a2015-04-16 11:22:42 -070013#include "GrGLStencilAttachment.h"
piotaixre4b23142014-10-02 10:57:53 -070014#include "SkChecksum.h"
mtklein2aa1f7e2015-02-20 12:35:32 -080015#include "SkTHash.h"
robertphillips@google.coma2d71482012-08-01 20:08:47 +000016#include "SkTArray.h"
bsalomon@google.comf7fa8062012-02-14 14:09:57 +000017
18class GrGLContextInfo;
jvanverthe9c0fc62015-04-29 11:18:05 -070019class GrGLSLCaps;
bsalomon@google.comf7fa8062012-02-14 14:09:57 +000020
21/**
22 * Stores some capabilities of a GL context. Most are determined by the GL
23 * version and the extensions string. It also tracks formats that have passed
24 * the FBO completeness test.
25 */
bsalomon4b91f762015-05-19 09:29:46 -070026class GrGLCaps : public GrCaps {
bsalomon@google.comf7fa8062012-02-14 14:09:57 +000027public:
bsalomon@google.combcce8922013-03-25 15:38:39 +000028 SK_DECLARE_INST_COUNT(GrGLCaps)
29
egdaniel8dc7c3a2015-04-16 11:22:42 -070030 typedef GrGLStencilAttachment::Format StencilFormat;
bsalomon@google.comf7fa8062012-02-14 14:09:57 +000031
32 /**
33 * The type of MSAA for FBOs supported. Different extensions have different
34 * semantics of how / when a resolve is performed.
35 */
36 enum MSFBOType {
37 /**
38 * no support for MSAA FBOs
39 */
rmistry@google.comfbfcd562012-08-23 18:09:54 +000040 kNone_MSFBOType = 0,
bsalomon@google.comf7fa8062012-02-14 14:09:57 +000041 /**
skia.committer@gmail.com6fc1b492013-09-06 07:01:45 +000042 * GL3.0-style MSAA FBO (GL_ARB_framebuffer_object).
bsalomon@google.comf7fa8062012-02-14 14:09:57 +000043 */
bsalomon@google.com347c3822013-05-01 20:10:01 +000044 kDesktop_ARB_MSFBOType,
bsalomon@google.comf7fa8062012-02-14 14:09:57 +000045 /**
46 * earlier GL_EXT_framebuffer* extensions
47 */
bsalomon@google.com347c3822013-05-01 20:10:01 +000048 kDesktop_EXT_MSFBOType,
bsalomon@google.comf7fa8062012-02-14 14:09:57 +000049 /**
commit-bot@chromium.orga8e5a062013-09-05 23:44:09 +000050 * Similar to kDesktop_ARB but with additional restrictions on glBlitFramebuffer.
51 */
52 kES_3_0_MSFBOType,
53 /**
bsalomon@google.comf7fa8062012-02-14 14:09:57 +000054 * GL_APPLE_framebuffer_multisample ES extension
55 */
bsalomon@google.com347c3822013-05-01 20:10:01 +000056 kES_Apple_MSFBOType,
bsalomon@google.comf3a60c02013-03-19 19:06:09 +000057 /**
bsalomon@google.com347c3822013-05-01 20:10:01 +000058 * GL_IMG_multisampled_render_to_texture. This variation does not have MSAA renderbuffers.
59 * Instead the texture is multisampled when bound to the FBO and then resolved automatically
60 * when read. It also defines an alternate value for GL_MAX_SAMPLES (which we call
61 * GR_GL_MAX_SAMPLES_IMG).
bsalomon@google.comf3a60c02013-03-19 19:06:09 +000062 */
bsalomon@google.com347c3822013-05-01 20:10:01 +000063 kES_IMG_MsToTexture_MSFBOType,
64 /**
65 * GL_EXT_multisampled_render_to_texture. Same as the IMG one above but uses the standard
66 * GL_MAX_SAMPLES value.
67 */
68 kES_EXT_MsToTexture_MSFBOType,
bsalomon@google.com6b0cf022013-05-03 13:35:14 +000069
skia.committer@gmail.comecc9d282013-05-04 07:01:15 +000070 kLast_MSFBOType = kES_EXT_MsToTexture_MSFBOType
bsalomon@google.com6b0cf022013-05-03 13:35:14 +000071 };
72
commit-bot@chromium.org52ffbf62014-04-02 16:19:33 +000073 enum InvalidateFBType {
74 kNone_InvalidateFBType,
75 kDiscard_InvalidateFBType, //<! glDiscardFramebuffer()
76 kInvalidate_InvalidateFBType, //<! glInvalidateFramebuffer()
77
78 kLast_InvalidateFBType = kInvalidate_InvalidateFBType
bsalomon@google.comf7fa8062012-02-14 14:09:57 +000079 };
80
commit-bot@chromium.org160b4782014-05-05 12:32:37 +000081 enum MapBufferType {
82 kNone_MapBufferType,
83 kMapBuffer_MapBufferType, // glMapBuffer()
84 kMapBufferRange_MapBufferType, // glMapBufferRange()
85 kChromium_MapBufferType, // GL_CHROMIUM_map_sub
86
87 kLast_MapBufferType = kChromium_MapBufferType,
88 };
89
bsalomon@google.comf7fa8062012-02-14 14:09:57 +000090 /**
bsalomon@google.comf7fa8062012-02-14 14:09:57 +000091 * Initializes the GrGLCaps to the set of features supported in the current
92 * OpenGL context accessible via ctxInfo.
93 */
bsalomon682c2692015-05-22 14:01:46 -070094 GrGLCaps(const GrContextOptions& contextOptions, const GrGLContextInfo& ctxInfo,
95 const GrGLInterface* glInterface);
bsalomon@google.comf7fa8062012-02-14 14:09:57 +000096
97 /**
98 * Call to note that a color config has been verified as a valid color
99 * attachment. This may save future calls to glCheckFramebufferStatus
100 * using isConfigVerifiedColorAttachment().
101 */
102 void markConfigAsValidColorAttachment(GrPixelConfig config) {
103 fVerifiedColorConfigs.markVerified(config);
104 }
105
106 /**
107 * Call to check whether a config has been verified as a valid color
108 * attachment.
109 */
110 bool isConfigVerifiedColorAttachment(GrPixelConfig config) const {
111 return fVerifiedColorConfigs.isVerified(config);
112 }
113
114 /**
115 * Call to note that a color config / stencil format pair passed
116 * FBO status check. We may skip calling glCheckFramebufferStatus for
117 * this combination in the future using
118 * isColorConfigAndStencilFormatVerified().
119 */
120 void markColorConfigAndStencilFormatAsVerified(
121 GrPixelConfig config,
egdaniel8dc7c3a2015-04-16 11:22:42 -0700122 const GrGLStencilAttachment::Format& format);
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000123
124 /**
125 * Call to check whether color config / stencil format pair has already
126 * passed FBO status check.
127 */
128 bool isColorConfigAndStencilFormatVerified(
129 GrPixelConfig config,
egdaniel8dc7c3a2015-04-16 11:22:42 -0700130 const GrGLStencilAttachment::Format& format) const;
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000131
132 /**
133 * Reports the type of MSAA FBO support.
134 */
135 MSFBOType msFBOType() const { return fMSFBOType; }
136
137 /**
bsalomon@google.com347c3822013-05-01 20:10:01 +0000138 * Does the supported MSAA FBO extension have MSAA renderbuffers?
139 */
140 bool usesMSAARenderBuffers() const {
141 return kNone_MSFBOType != fMSFBOType &&
142 kES_IMG_MsToTexture_MSFBOType != fMSFBOType &&
143 kES_EXT_MsToTexture_MSFBOType != fMSFBOType;
144 }
145
146 /**
147 * Is the MSAA FBO extension one where the texture is multisampled when bound to an FBO and
148 * then implicitly resolved when read.
149 */
150 bool usesImplicitMSAAResolve() const {
151 return kES_IMG_MsToTexture_MSFBOType == fMSFBOType ||
152 kES_EXT_MsToTexture_MSFBOType == fMSFBOType;
153 }
154
vbuzinov08b4d292015-04-01 06:29:49 -0700155 bool fbMixedSamplesSupport() const { return fFBMixedSamplesSupport; }
156
commit-bot@chromium.org52ffbf62014-04-02 16:19:33 +0000157 InvalidateFBType invalidateFBType() const { return fInvalidateFBType; }
158
commit-bot@chromium.org160b4782014-05-05 12:32:37 +0000159 /// What type of buffer mapping is supported?
160 MapBufferType mapBufferType() const { return fMapBufferType; }
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000161
162 /**
163 * Gets an array of legal stencil formats. These formats are not guaranteed
164 * to be supported by the driver but are legal GLenum names given the GL
165 * version and extensions supported.
166 */
167 const SkTArray<StencilFormat, true>& stencilFormats() const {
168 return fStencilFormats;
169 }
170
171 /// The maximum number of fragment uniform vectors (GLES has min. 16).
172 int maxFragmentUniformVectors() const { return fMaxFragmentUniformVectors; }
173
commit-bot@chromium.orga15f7e52013-06-05 23:29:25 +0000174 /// maximum number of attribute values per vertex
bsalomon@google.com60da4172012-06-01 19:25:00 +0000175 int maxVertexAttributes() const { return fMaxVertexAttributes; }
176
commit-bot@chromium.orga15f7e52013-06-05 23:29:25 +0000177 /// maximum number of texture units accessible in the fragment shader.
178 int maxFragmentTextureUnits() const { return fMaxFragmentTextureUnits; }
179
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000180 /// ES requires an extension to support RGBA8 in RenderBufferStorage
181 bool rgba8RenderbufferSupport() const { return fRGBA8RenderbufferSupport; }
182
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000183 /**
184 * Depending on the ES extensions present the BGRA external format may
185 * correspond either a BGRA or RGBA internalFormat. On desktop GL it is
186 * RGBA.
187 */
188 bool bgraIsInternalFormat() const { return fBGRAIsInternalFormat; }
189
190 /// GL_ARB_texture_swizzle support
191 bool textureSwizzleSupport() const { return fTextureSwizzleSupport; }
192
193 /// Is there support for GL_UNPACK_ROW_LENGTH
194 bool unpackRowLengthSupport() const { return fUnpackRowLengthSupport; }
195
196 /// Is there support for GL_UNPACK_FLIP_Y
197 bool unpackFlipYSupport() const { return fUnpackFlipYSupport; }
198
199 /// Is there support for GL_PACK_ROW_LENGTH
200 bool packRowLengthSupport() const { return fPackRowLengthSupport; }
201
202 /// Is there support for GL_PACK_REVERSE_ROW_ORDER
203 bool packFlipYSupport() const { return fPackFlipYSupport; }
204
205 /// Is there support for texture parameter GL_TEXTURE_USAGE
206 bool textureUsageSupport() const { return fTextureUsageSupport; }
207
208 /// Is there support for glTexStorage
209 bool texStorageSupport() const { return fTexStorageSupport; }
210
robertphillips@google.com443e5a52012-04-30 20:01:21 +0000211 /// Is there support for GL_RED and GL_R8
212 bool textureRedSupport() const { return fTextureRedSupport; }
213
bsalomon@google.come76b7cc2012-06-18 12:47:06 +0000214 /// Is GL_ARB_IMAGING supported
215 bool imagingSupport() const { return fImagingSupport; }
216
bsalomon@google.com706f6682012-10-23 14:53:55 +0000217 /// Is GL_ARB_fragment_coord_conventions supported?
218 bool fragCoordConventionsSupport() const { return fFragCoordsConventionSupport; }
219
bsalomon@google.com07631cf2013-03-05 14:14:58 +0000220 /// Is there support for Vertex Array Objects?
221 bool vertexArrayObjectSupport() const { return fVertexArrayObjectSupport; }
222
jvanverth3f801cb2014-12-16 09:49:38 -0800223 /// Is there support for ES2 compatability?
224 bool ES2CompatibilitySupport() const { return fES2CompatibilitySupport; }
225
cdalton0edea2c2015-05-21 08:27:44 -0700226 /// Can we call glDisable(GL_MULTISAMPLE)?
227 bool multisampleDisableSupport() const { return fMultisampleDisableSupport; }
228
bsalomon@google.com07631cf2013-03-05 14:14:58 +0000229 /// Use indices or vertices in CPU arrays rather than VBOs for dynamic content.
bsalomon@google.com96966a52013-02-21 16:34:21 +0000230 bool useNonVBOVertexAndIndexDynamicData() const {
231 return fUseNonVBOVertexAndIndexDynamicData;
232 }
233
bsalomon@google.com07631cf2013-03-05 14:14:58 +0000234 /// Does ReadPixels support the provided format/type combo?
robertphillips@google.com1d89c932012-06-27 19:31:41 +0000235 bool readPixelsSupported(const GrGLInterface* intf,
rmistry@google.comfbfcd562012-08-23 18:09:54 +0000236 GrGLenum format,
piotaixre4b23142014-10-02 10:57:53 -0700237 GrGLenum type,
238 GrGLenum currFboFormat) const;
skia.committer@gmail.com631cdcb2013-03-01 12:12:55 +0000239
bsalomon@google.com2b1b8c02013-02-28 22:06:02 +0000240 bool isCoreProfile() const { return fIsCoreProfile; }
robertphillips@google.com1d89c932012-06-27 19:31:41 +0000241
commit-bot@chromium.org3628ad92013-08-30 19:43:47 +0000242
robertphillips@google.com56ce48a2013-10-31 21:44:25 +0000243 bool fullClearIsFree() const { return fFullClearIsFree; }
244
commit-bot@chromium.org160b4782014-05-05 12:32:37 +0000245 /**
246 * Returns a string containing the caps info.
247 */
mtklein36352bf2015-03-25 18:17:31 -0700248 SkString dump() const override;
commit-bot@chromium.orgbeb8b3a2014-04-15 15:37:51 +0000249
commit-bot@chromium.org6e7ddaa2014-05-30 13:55:58 +0000250 /**
251 * LATC can appear under one of three possible names. In order to know
252 * which GL internal format to use, we need to keep track of which name
253 * we found LATC under. The default is LATC.
254 */
255 enum LATCAlias {
256 kLATC_LATCAlias,
257 kRGTC_LATCAlias,
258 k3DC_LATCAlias
259 };
260
261 LATCAlias latcAlias() const { return fLATCAlias; }
262
jvanverthe9c0fc62015-04-29 11:18:05 -0700263 GrGLSLCaps* glslCaps() const { return reinterpret_cast<GrGLSLCaps*>(fShaderCaps.get()); }
264
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000265private:
bsalomon424cc262015-05-22 10:37:30 -0700266 void init(const GrGLContextInfo& ctxInfo, const GrGLInterface* glInterface);
267
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000268 /**
269 * Maintains a bit per GrPixelConfig. It is used to avoid redundantly
270 * performing glCheckFrameBufferStatus for the same config.
271 */
272 struct VerifiedColorConfigs {
273 VerifiedColorConfigs() {
274 this->reset();
275 }
276
277 void reset() {
278 for (int i = 0; i < kNumUints; ++i) {
279 fVerifiedColorConfigs[i] = 0;
280 }
281 }
282
bsalomon@google.comb8eb2e82013-03-28 13:46:42 +0000283 static const int kNumUints = (kGrPixelConfigCnt + 31) / 32;
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000284 uint32_t fVerifiedColorConfigs[kNumUints];
285
286 void markVerified(GrPixelConfig config) {
287#if !GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT
288 return;
289#endif
290 int u32Idx = config / 32;
291 int bitIdx = config % 32;
292 fVerifiedColorConfigs[u32Idx] |= 1 << bitIdx;
293 }
294
295 bool isVerified(GrPixelConfig config) const {
296#if !GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT
297 return false;
298#endif
299 int u32Idx = config / 32;
300 int bitIdx = config % 32;
301 return SkToBool(fVerifiedColorConfigs[u32Idx] & (1 << bitIdx));
302 }
303 };
304
commit-bot@chromium.org73880512013-10-14 15:33:45 +0000305 void initFSAASupport(const GrGLContextInfo&, const GrGLInterface*);
306 void initStencilFormats(const GrGLContextInfo&);
commit-bot@chromium.org6b7938f2013-10-15 14:18:16 +0000307 // This must be called after initFSAASupport().
commit-bot@chromium.org73880512013-10-14 15:33:45 +0000308 void initConfigRenderableTable(const GrGLContextInfo&);
commit-bot@chromium.org6e7ddaa2014-05-30 13:55:58 +0000309 void initConfigTexturableTable(const GrGLContextInfo&, const GrGLInterface*);
commit-bot@chromium.org42dc8132014-05-27 19:26:59 +0000310
bsalomon17168df2014-12-09 09:00:49 -0800311 bool doReadPixelsSupported(const GrGLInterface* intf, GrGLenum format, GrGLenum type) const;
piotaixre4b23142014-10-02 10:57:53 -0700312
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000313 // tracks configs that have been verified to pass the FBO completeness when
314 // used as a color attachment
315 VerifiedColorConfigs fVerifiedColorConfigs;
316
317 SkTArray<StencilFormat, true> fStencilFormats;
318 // tracks configs that have been verified to pass the FBO completeness when
319 // used as a color attachment when a particular stencil format is used
320 // as a stencil attachment.
321 SkTArray<VerifiedColorConfigs, true> fStencilVerifiedColorConfigs;
322
323 int fMaxFragmentUniformVectors;
bsalomon@google.com60da4172012-06-01 19:25:00 +0000324 int fMaxVertexAttributes;
commit-bot@chromium.orga15f7e52013-06-05 23:29:25 +0000325 int fMaxFragmentTextureUnits;
bsalomon@google.com60da4172012-06-01 19:25:00 +0000326
commit-bot@chromium.org52ffbf62014-04-02 16:19:33 +0000327 MSFBOType fMSFBOType;
commit-bot@chromium.org52ffbf62014-04-02 16:19:33 +0000328 InvalidateFBType fInvalidateFBType;
commit-bot@chromium.org160b4782014-05-05 12:32:37 +0000329 MapBufferType fMapBufferType;
commit-bot@chromium.org6e7ddaa2014-05-30 13:55:58 +0000330 LATCAlias fLATCAlias;
bsalomon@google.com6b0cf022013-05-03 13:35:14 +0000331
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000332 bool fRGBA8RenderbufferSupport : 1;
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000333 bool fBGRAIsInternalFormat : 1;
334 bool fTextureSwizzleSupport : 1;
335 bool fUnpackRowLengthSupport : 1;
336 bool fUnpackFlipYSupport : 1;
337 bool fPackRowLengthSupport : 1;
338 bool fPackFlipYSupport : 1;
339 bool fTextureUsageSupport : 1;
340 bool fTexStorageSupport : 1;
robertphillips@google.com443e5a52012-04-30 20:01:21 +0000341 bool fTextureRedSupport : 1;
bsalomon@google.come76b7cc2012-06-18 12:47:06 +0000342 bool fImagingSupport : 1;
robertphillips@google.com1d89c932012-06-27 19:31:41 +0000343 bool fTwoFormatLimit : 1;
bsalomon@google.com706f6682012-10-23 14:53:55 +0000344 bool fFragCoordsConventionSupport : 1;
bsalomon@google.com07631cf2013-03-05 14:14:58 +0000345 bool fVertexArrayObjectSupport : 1;
jvanverth3f801cb2014-12-16 09:49:38 -0800346 bool fES2CompatibilitySupport : 1;
cdalton0edea2c2015-05-21 08:27:44 -0700347 bool fMultisampleDisableSupport : 1;
bsalomon@google.com96966a52013-02-21 16:34:21 +0000348 bool fUseNonVBOVertexAndIndexDynamicData : 1;
bsalomon@google.com2b1b8c02013-02-28 22:06:02 +0000349 bool fIsCoreProfile : 1;
robertphillips@google.com56ce48a2013-10-31 21:44:25 +0000350 bool fFullClearIsFree : 1;
vbuzinov08b4d292015-04-01 06:29:49 -0700351 bool fFBMixedSamplesSupport : 1;
joshualitt58162332014-08-01 06:44:53 -0700352
mtklein2aa1f7e2015-02-20 12:35:32 -0800353 struct ReadPixelsSupportedFormat {
354 GrGLenum fFormat;
355 GrGLenum fType;
356 GrGLenum fFboFormat;
piotaixre4b23142014-10-02 10:57:53 -0700357
mtklein2aa1f7e2015-02-20 12:35:32 -0800358 bool operator==(const ReadPixelsSupportedFormat& rhs) const {
359 return fFormat == rhs.fFormat
360 && fType == rhs.fType
361 && fFboFormat == rhs.fFboFormat;
piotaixre4b23142014-10-02 10:57:53 -0700362 }
piotaixre4b23142014-10-02 10:57:53 -0700363 };
mtklein02f46cf2015-03-20 13:48:42 -0700364 mutable SkTHashMap<ReadPixelsSupportedFormat, bool> fReadPixelsSupportedCache;
piotaixre4b23142014-10-02 10:57:53 -0700365
bsalomon4b91f762015-05-19 09:29:46 -0700366 typedef GrCaps INHERITED;
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000367};
368
jvanverthe9c0fc62015-04-29 11:18:05 -0700369
370class GrGLSLCaps : public GrShaderCaps {
371public:
372 SK_DECLARE_INST_COUNT(GrGLSLCaps)
373
374 /**
cdalton8917d622015-05-06 13:40:21 -0700375 * Indicates how GLSL must interact with advanced blend equations. The KHR extension requires
376 * special layout qualifiers in the fragment shader.
377 */
378 enum AdvBlendEqInteraction {
379 kNotSupported_AdvBlendEqInteraction, //<! No _blend_equation_advanced extension
380 kAutomatic_AdvBlendEqInteraction, //<! No interaction required
381 kGeneralEnable_AdvBlendEqInteraction, //<! layout(blend_support_all_equations) out
382 kSpecificEnables_AdvBlendEqInteraction, //<! Specific layout qualifiers per equation
383
384 kLast_AdvBlendEqInteraction = kSpecificEnables_AdvBlendEqInteraction
385 };
386
387 /**
jvanverthe9c0fc62015-04-29 11:18:05 -0700388 * Initializes the GrGLSLCaps to the set of features supported in the current
389 * OpenGL context accessible via ctxInfo.
390 */
bsalomon424cc262015-05-22 10:37:30 -0700391 GrGLSLCaps(const GrGLContextInfo&, const GrGLInterface*, const GrGLCaps&);
jvanverthe9c0fc62015-04-29 11:18:05 -0700392
393 /**
394 * Some helper functions for encapsulating various extensions to read FB Buffer on openglES
395 *
396 * TODO(joshualitt) On desktop opengl 4.2+ we can achieve something similar to this effect
397 */
398 bool fbFetchSupport() const { return fFBFetchSupport; }
399
400 bool fbFetchNeedsCustomOutput() const { return fFBFetchNeedsCustomOutput; }
401
402 const char* fbFetchColorName() const { return fFBFetchColorName; }
403
404 const char* fbFetchExtensionString() const { return fFBFetchExtensionString; }
405
406 bool dropsTileOnZeroDivide() const { return fDropsTileOnZeroDivide; }
407
cdalton8917d622015-05-06 13:40:21 -0700408 AdvBlendEqInteraction advBlendEqInteraction() const { return fAdvBlendEqInteraction; }
409
410 bool mustEnableAdvBlendEqs() const {
411 return fAdvBlendEqInteraction >= kGeneralEnable_AdvBlendEqInteraction;
412 }
413
414 bool mustEnableSpecificAdvBlendEqs() const {
415 return fAdvBlendEqInteraction == kSpecificEnables_AdvBlendEqInteraction;
416 }
417
jvanverthe9c0fc62015-04-29 11:18:05 -0700418 /**
419 * Returns a string containing the caps info.
420 */
421 SkString dump() const override;
422
423private:
bsalomon424cc262015-05-22 10:37:30 -0700424 void init(const GrGLContextInfo&, const GrGLInterface*, const GrGLCaps&);
425
jvanverthe9c0fc62015-04-29 11:18:05 -0700426 // Must be called after fGeometryShaderSupport is initialized.
427 void initShaderPrecisionTable(const GrGLContextInfo&, const GrGLInterface*);
428
429 bool fDropsTileOnZeroDivide : 1;
430 bool fFBFetchSupport : 1;
431 bool fFBFetchNeedsCustomOutput : 1;
432
433 const char* fFBFetchColorName;
434 const char* fFBFetchExtensionString;
435
cdalton8917d622015-05-06 13:40:21 -0700436 AdvBlendEqInteraction fAdvBlendEqInteraction;
437
jvanverthe9c0fc62015-04-29 11:18:05 -0700438 typedef GrShaderCaps INHERITED;
439};
440
jvanverthcfc18862015-04-28 08:48:20 -0700441
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000442#endif