blob: cd84242292c11cabb5df71291973a270d9cc9407 [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 */
bsalomon424cc262015-05-22 10:37:30 -070094 GrGLCaps(const GrGLContextInfo& ctxInfo, const GrGLInterface* glInterface);
bsalomon@google.comf7fa8062012-02-14 14:09:57 +000095
96 /**
97 * Call to note that a color config has been verified as a valid color
98 * attachment. This may save future calls to glCheckFramebufferStatus
99 * using isConfigVerifiedColorAttachment().
100 */
101 void markConfigAsValidColorAttachment(GrPixelConfig config) {
102 fVerifiedColorConfigs.markVerified(config);
103 }
104
105 /**
106 * Call to check whether a config has been verified as a valid color
107 * attachment.
108 */
109 bool isConfigVerifiedColorAttachment(GrPixelConfig config) const {
110 return fVerifiedColorConfigs.isVerified(config);
111 }
112
113 /**
114 * Call to note that a color config / stencil format pair passed
115 * FBO status check. We may skip calling glCheckFramebufferStatus for
116 * this combination in the future using
117 * isColorConfigAndStencilFormatVerified().
118 */
119 void markColorConfigAndStencilFormatAsVerified(
120 GrPixelConfig config,
egdaniel8dc7c3a2015-04-16 11:22:42 -0700121 const GrGLStencilAttachment::Format& format);
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000122
123 /**
124 * Call to check whether color config / stencil format pair has already
125 * passed FBO status check.
126 */
127 bool isColorConfigAndStencilFormatVerified(
128 GrPixelConfig config,
egdaniel8dc7c3a2015-04-16 11:22:42 -0700129 const GrGLStencilAttachment::Format& format) const;
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000130
131 /**
132 * Reports the type of MSAA FBO support.
133 */
134 MSFBOType msFBOType() const { return fMSFBOType; }
135
136 /**
bsalomon@google.com347c3822013-05-01 20:10:01 +0000137 * Does the supported MSAA FBO extension have MSAA renderbuffers?
138 */
139 bool usesMSAARenderBuffers() const {
140 return kNone_MSFBOType != fMSFBOType &&
141 kES_IMG_MsToTexture_MSFBOType != fMSFBOType &&
142 kES_EXT_MsToTexture_MSFBOType != fMSFBOType;
143 }
144
145 /**
146 * Is the MSAA FBO extension one where the texture is multisampled when bound to an FBO and
147 * then implicitly resolved when read.
148 */
149 bool usesImplicitMSAAResolve() const {
150 return kES_IMG_MsToTexture_MSFBOType == fMSFBOType ||
151 kES_EXT_MsToTexture_MSFBOType == fMSFBOType;
152 }
153
vbuzinov08b4d292015-04-01 06:29:49 -0700154 bool fbMixedSamplesSupport() const { return fFBMixedSamplesSupport; }
155
commit-bot@chromium.org52ffbf62014-04-02 16:19:33 +0000156 InvalidateFBType invalidateFBType() const { return fInvalidateFBType; }
157
commit-bot@chromium.org160b4782014-05-05 12:32:37 +0000158 /// What type of buffer mapping is supported?
159 MapBufferType mapBufferType() const { return fMapBufferType; }
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000160
161 /**
162 * Gets an array of legal stencil formats. These formats are not guaranteed
163 * to be supported by the driver but are legal GLenum names given the GL
164 * version and extensions supported.
165 */
166 const SkTArray<StencilFormat, true>& stencilFormats() const {
167 return fStencilFormats;
168 }
169
170 /// The maximum number of fragment uniform vectors (GLES has min. 16).
171 int maxFragmentUniformVectors() const { return fMaxFragmentUniformVectors; }
172
commit-bot@chromium.orga15f7e52013-06-05 23:29:25 +0000173 /// maximum number of attribute values per vertex
bsalomon@google.com60da4172012-06-01 19:25:00 +0000174 int maxVertexAttributes() const { return fMaxVertexAttributes; }
175
commit-bot@chromium.orga15f7e52013-06-05 23:29:25 +0000176 /// maximum number of texture units accessible in the fragment shader.
177 int maxFragmentTextureUnits() const { return fMaxFragmentTextureUnits; }
178
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000179 /// ES requires an extension to support RGBA8 in RenderBufferStorage
180 bool rgba8RenderbufferSupport() const { return fRGBA8RenderbufferSupport; }
181
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000182 /**
183 * Depending on the ES extensions present the BGRA external format may
184 * correspond either a BGRA or RGBA internalFormat. On desktop GL it is
185 * RGBA.
186 */
187 bool bgraIsInternalFormat() const { return fBGRAIsInternalFormat; }
188
189 /// GL_ARB_texture_swizzle support
190 bool textureSwizzleSupport() const { return fTextureSwizzleSupport; }
191
192 /// Is there support for GL_UNPACK_ROW_LENGTH
193 bool unpackRowLengthSupport() const { return fUnpackRowLengthSupport; }
194
195 /// Is there support for GL_UNPACK_FLIP_Y
196 bool unpackFlipYSupport() const { return fUnpackFlipYSupport; }
197
198 /// Is there support for GL_PACK_ROW_LENGTH
199 bool packRowLengthSupport() const { return fPackRowLengthSupport; }
200
201 /// Is there support for GL_PACK_REVERSE_ROW_ORDER
202 bool packFlipYSupport() const { return fPackFlipYSupport; }
203
204 /// Is there support for texture parameter GL_TEXTURE_USAGE
205 bool textureUsageSupport() const { return fTextureUsageSupport; }
206
207 /// Is there support for glTexStorage
208 bool texStorageSupport() const { return fTexStorageSupport; }
209
robertphillips@google.com443e5a52012-04-30 20:01:21 +0000210 /// Is there support for GL_RED and GL_R8
211 bool textureRedSupport() const { return fTextureRedSupport; }
212
bsalomon@google.come76b7cc2012-06-18 12:47:06 +0000213 /// Is GL_ARB_IMAGING supported
214 bool imagingSupport() const { return fImagingSupport; }
215
bsalomon@google.com706f6682012-10-23 14:53:55 +0000216 /// Is GL_ARB_fragment_coord_conventions supported?
217 bool fragCoordConventionsSupport() const { return fFragCoordsConventionSupport; }
218
bsalomon@google.com07631cf2013-03-05 14:14:58 +0000219 /// Is there support for Vertex Array Objects?
220 bool vertexArrayObjectSupport() const { return fVertexArrayObjectSupport; }
221
jvanverth3f801cb2014-12-16 09:49:38 -0800222 /// Is there support for ES2 compatability?
223 bool ES2CompatibilitySupport() const { return fES2CompatibilitySupport; }
224
cdalton0edea2c2015-05-21 08:27:44 -0700225 /// Can we call glDisable(GL_MULTISAMPLE)?
226 bool multisampleDisableSupport() const { return fMultisampleDisableSupport; }
227
bsalomon@google.com07631cf2013-03-05 14:14:58 +0000228 /// Use indices or vertices in CPU arrays rather than VBOs for dynamic content.
bsalomon@google.com96966a52013-02-21 16:34:21 +0000229 bool useNonVBOVertexAndIndexDynamicData() const {
230 return fUseNonVBOVertexAndIndexDynamicData;
231 }
232
bsalomon@google.com07631cf2013-03-05 14:14:58 +0000233 /// Does ReadPixels support the provided format/type combo?
robertphillips@google.com1d89c932012-06-27 19:31:41 +0000234 bool readPixelsSupported(const GrGLInterface* intf,
rmistry@google.comfbfcd562012-08-23 18:09:54 +0000235 GrGLenum format,
piotaixre4b23142014-10-02 10:57:53 -0700236 GrGLenum type,
237 GrGLenum currFboFormat) const;
skia.committer@gmail.com631cdcb2013-03-01 12:12:55 +0000238
bsalomon@google.com2b1b8c02013-02-28 22:06:02 +0000239 bool isCoreProfile() const { return fIsCoreProfile; }
robertphillips@google.com1d89c932012-06-27 19:31:41 +0000240
commit-bot@chromium.org3628ad92013-08-30 19:43:47 +0000241
robertphillips@google.com56ce48a2013-10-31 21:44:25 +0000242 bool fullClearIsFree() const { return fFullClearIsFree; }
243
commit-bot@chromium.org160b4782014-05-05 12:32:37 +0000244 /**
245 * Returns a string containing the caps info.
246 */
mtklein36352bf2015-03-25 18:17:31 -0700247 SkString dump() const override;
commit-bot@chromium.orgbeb8b3a2014-04-15 15:37:51 +0000248
commit-bot@chromium.org6e7ddaa2014-05-30 13:55:58 +0000249 /**
250 * LATC can appear under one of three possible names. In order to know
251 * which GL internal format to use, we need to keep track of which name
252 * we found LATC under. The default is LATC.
253 */
254 enum LATCAlias {
255 kLATC_LATCAlias,
256 kRGTC_LATCAlias,
257 k3DC_LATCAlias
258 };
259
260 LATCAlias latcAlias() const { return fLATCAlias; }
261
jvanverthe9c0fc62015-04-29 11:18:05 -0700262 GrGLSLCaps* glslCaps() const { return reinterpret_cast<GrGLSLCaps*>(fShaderCaps.get()); }
263
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000264private:
bsalomon424cc262015-05-22 10:37:30 -0700265 void init(const GrGLContextInfo& ctxInfo, const GrGLInterface* glInterface);
266
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000267 /**
268 * Maintains a bit per GrPixelConfig. It is used to avoid redundantly
269 * performing glCheckFrameBufferStatus for the same config.
270 */
271 struct VerifiedColorConfigs {
272 VerifiedColorConfigs() {
273 this->reset();
274 }
275
276 void reset() {
277 for (int i = 0; i < kNumUints; ++i) {
278 fVerifiedColorConfigs[i] = 0;
279 }
280 }
281
bsalomon@google.comb8eb2e82013-03-28 13:46:42 +0000282 static const int kNumUints = (kGrPixelConfigCnt + 31) / 32;
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000283 uint32_t fVerifiedColorConfigs[kNumUints];
284
285 void markVerified(GrPixelConfig config) {
286#if !GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT
287 return;
288#endif
289 int u32Idx = config / 32;
290 int bitIdx = config % 32;
291 fVerifiedColorConfigs[u32Idx] |= 1 << bitIdx;
292 }
293
294 bool isVerified(GrPixelConfig config) const {
295#if !GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT
296 return false;
297#endif
298 int u32Idx = config / 32;
299 int bitIdx = config % 32;
300 return SkToBool(fVerifiedColorConfigs[u32Idx] & (1 << bitIdx));
301 }
302 };
303
commit-bot@chromium.org73880512013-10-14 15:33:45 +0000304 void initFSAASupport(const GrGLContextInfo&, const GrGLInterface*);
305 void initStencilFormats(const GrGLContextInfo&);
commit-bot@chromium.org6b7938f2013-10-15 14:18:16 +0000306 // This must be called after initFSAASupport().
commit-bot@chromium.org73880512013-10-14 15:33:45 +0000307 void initConfigRenderableTable(const GrGLContextInfo&);
commit-bot@chromium.org6e7ddaa2014-05-30 13:55:58 +0000308 void initConfigTexturableTable(const GrGLContextInfo&, const GrGLInterface*);
commit-bot@chromium.org42dc8132014-05-27 19:26:59 +0000309
bsalomon17168df2014-12-09 09:00:49 -0800310 bool doReadPixelsSupported(const GrGLInterface* intf, GrGLenum format, GrGLenum type) const;
piotaixre4b23142014-10-02 10:57:53 -0700311
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000312 // tracks configs that have been verified to pass the FBO completeness when
313 // used as a color attachment
314 VerifiedColorConfigs fVerifiedColorConfigs;
315
316 SkTArray<StencilFormat, true> fStencilFormats;
317 // tracks configs that have been verified to pass the FBO completeness when
318 // used as a color attachment when a particular stencil format is used
319 // as a stencil attachment.
320 SkTArray<VerifiedColorConfigs, true> fStencilVerifiedColorConfigs;
321
322 int fMaxFragmentUniformVectors;
bsalomon@google.com60da4172012-06-01 19:25:00 +0000323 int fMaxVertexAttributes;
commit-bot@chromium.orga15f7e52013-06-05 23:29:25 +0000324 int fMaxFragmentTextureUnits;
bsalomon@google.com60da4172012-06-01 19:25:00 +0000325
commit-bot@chromium.org52ffbf62014-04-02 16:19:33 +0000326 MSFBOType fMSFBOType;
commit-bot@chromium.org52ffbf62014-04-02 16:19:33 +0000327 InvalidateFBType fInvalidateFBType;
commit-bot@chromium.org160b4782014-05-05 12:32:37 +0000328 MapBufferType fMapBufferType;
commit-bot@chromium.org6e7ddaa2014-05-30 13:55:58 +0000329 LATCAlias fLATCAlias;
bsalomon@google.com6b0cf022013-05-03 13:35:14 +0000330
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000331 bool fRGBA8RenderbufferSupport : 1;
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000332 bool fBGRAIsInternalFormat : 1;
333 bool fTextureSwizzleSupport : 1;
334 bool fUnpackRowLengthSupport : 1;
335 bool fUnpackFlipYSupport : 1;
336 bool fPackRowLengthSupport : 1;
337 bool fPackFlipYSupport : 1;
338 bool fTextureUsageSupport : 1;
339 bool fTexStorageSupport : 1;
robertphillips@google.com443e5a52012-04-30 20:01:21 +0000340 bool fTextureRedSupport : 1;
bsalomon@google.come76b7cc2012-06-18 12:47:06 +0000341 bool fImagingSupport : 1;
robertphillips@google.com1d89c932012-06-27 19:31:41 +0000342 bool fTwoFormatLimit : 1;
bsalomon@google.com706f6682012-10-23 14:53:55 +0000343 bool fFragCoordsConventionSupport : 1;
bsalomon@google.com07631cf2013-03-05 14:14:58 +0000344 bool fVertexArrayObjectSupport : 1;
jvanverth3f801cb2014-12-16 09:49:38 -0800345 bool fES2CompatibilitySupport : 1;
cdalton0edea2c2015-05-21 08:27:44 -0700346 bool fMultisampleDisableSupport : 1;
bsalomon@google.com96966a52013-02-21 16:34:21 +0000347 bool fUseNonVBOVertexAndIndexDynamicData : 1;
bsalomon@google.com2b1b8c02013-02-28 22:06:02 +0000348 bool fIsCoreProfile : 1;
robertphillips@google.com56ce48a2013-10-31 21:44:25 +0000349 bool fFullClearIsFree : 1;
vbuzinov08b4d292015-04-01 06:29:49 -0700350 bool fFBMixedSamplesSupport : 1;
joshualitt58162332014-08-01 06:44:53 -0700351
mtklein2aa1f7e2015-02-20 12:35:32 -0800352 struct ReadPixelsSupportedFormat {
353 GrGLenum fFormat;
354 GrGLenum fType;
355 GrGLenum fFboFormat;
piotaixre4b23142014-10-02 10:57:53 -0700356
mtklein2aa1f7e2015-02-20 12:35:32 -0800357 bool operator==(const ReadPixelsSupportedFormat& rhs) const {
358 return fFormat == rhs.fFormat
359 && fType == rhs.fType
360 && fFboFormat == rhs.fFboFormat;
piotaixre4b23142014-10-02 10:57:53 -0700361 }
piotaixre4b23142014-10-02 10:57:53 -0700362 };
mtklein02f46cf2015-03-20 13:48:42 -0700363 mutable SkTHashMap<ReadPixelsSupportedFormat, bool> fReadPixelsSupportedCache;
piotaixre4b23142014-10-02 10:57:53 -0700364
bsalomon4b91f762015-05-19 09:29:46 -0700365 typedef GrCaps INHERITED;
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000366};
367
jvanverthe9c0fc62015-04-29 11:18:05 -0700368
369class GrGLSLCaps : public GrShaderCaps {
370public:
371 SK_DECLARE_INST_COUNT(GrGLSLCaps)
372
373 /**
cdalton8917d622015-05-06 13:40:21 -0700374 * Indicates how GLSL must interact with advanced blend equations. The KHR extension requires
375 * special layout qualifiers in the fragment shader.
376 */
377 enum AdvBlendEqInteraction {
378 kNotSupported_AdvBlendEqInteraction, //<! No _blend_equation_advanced extension
379 kAutomatic_AdvBlendEqInteraction, //<! No interaction required
380 kGeneralEnable_AdvBlendEqInteraction, //<! layout(blend_support_all_equations) out
381 kSpecificEnables_AdvBlendEqInteraction, //<! Specific layout qualifiers per equation
382
383 kLast_AdvBlendEqInteraction = kSpecificEnables_AdvBlendEqInteraction
384 };
385
386 /**
jvanverthe9c0fc62015-04-29 11:18:05 -0700387 * Initializes the GrGLSLCaps to the set of features supported in the current
388 * OpenGL context accessible via ctxInfo.
389 */
bsalomon424cc262015-05-22 10:37:30 -0700390 GrGLSLCaps(const GrGLContextInfo&, const GrGLInterface*, const GrGLCaps&);
jvanverthe9c0fc62015-04-29 11:18:05 -0700391
392 /**
393 * Some helper functions for encapsulating various extensions to read FB Buffer on openglES
394 *
395 * TODO(joshualitt) On desktop opengl 4.2+ we can achieve something similar to this effect
396 */
397 bool fbFetchSupport() const { return fFBFetchSupport; }
398
399 bool fbFetchNeedsCustomOutput() const { return fFBFetchNeedsCustomOutput; }
400
401 const char* fbFetchColorName() const { return fFBFetchColorName; }
402
403 const char* fbFetchExtensionString() const { return fFBFetchExtensionString; }
404
405 bool dropsTileOnZeroDivide() const { return fDropsTileOnZeroDivide; }
406
cdalton8917d622015-05-06 13:40:21 -0700407 AdvBlendEqInteraction advBlendEqInteraction() const { return fAdvBlendEqInteraction; }
408
409 bool mustEnableAdvBlendEqs() const {
410 return fAdvBlendEqInteraction >= kGeneralEnable_AdvBlendEqInteraction;
411 }
412
413 bool mustEnableSpecificAdvBlendEqs() const {
414 return fAdvBlendEqInteraction == kSpecificEnables_AdvBlendEqInteraction;
415 }
416
jvanverthe9c0fc62015-04-29 11:18:05 -0700417 /**
418 * Returns a string containing the caps info.
419 */
420 SkString dump() const override;
421
422private:
bsalomon424cc262015-05-22 10:37:30 -0700423 void init(const GrGLContextInfo&, const GrGLInterface*, const GrGLCaps&);
424
jvanverthe9c0fc62015-04-29 11:18:05 -0700425 // Must be called after fGeometryShaderSupport is initialized.
426 void initShaderPrecisionTable(const GrGLContextInfo&, const GrGLInterface*);
427
428 bool fDropsTileOnZeroDivide : 1;
429 bool fFBFetchSupport : 1;
430 bool fFBFetchNeedsCustomOutput : 1;
431
432 const char* fFBFetchColorName;
433 const char* fFBFetchExtensionString;
434
cdalton8917d622015-05-06 13:40:21 -0700435 AdvBlendEqInteraction fAdvBlendEqInteraction;
436
jvanverthe9c0fc62015-04-29 11:18:05 -0700437 typedef GrShaderCaps INHERITED;
438};
439
jvanverthcfc18862015-04-28 08:48:20 -0700440
bsalomon@google.comf7fa8062012-02-14 14:09:57 +0000441#endif