blob: fca7bf2d2fdcb0d0462b5c4769e2487cb0599c7c [file] [log] [blame]
twiz@google.com59a190b2011-03-14 21:23:01 +00001/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00002 * Copyright 2011 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.
twiz@google.com59a190b2011-03-14 21:23:01 +00006 */
7
8
tomhudson@google.com6bf38b52012-02-14 15:11:59 +00009#include "gl/GrGLInterface.h"
bsalomon@google.com1744f972013-02-26 21:46:32 +000010#include "gl/GrGLExtensions.h"
11#include "gl/GrGLUtil.h"
twiz@google.com59a190b2011-03-14 21:23:01 +000012
13#include <stdio.h>
14
bsalomon@google.com56bfc5a2011-09-01 13:28:16 +000015#if GR_GL_PER_GL_FUNC_CALLBACK
16namespace {
17void GrGLDefaultInterfaceCallback(const GrGLInterface*) {}
18}
19#endif
20
commit-bot@chromium.orga3baf3b2014-02-21 18:45:30 +000021const GrGLInterface* GrGLInterfaceAddTestDebugMarker(const GrGLInterface* interface,
22 GrGLInsertEventMarkerProc insertEventMarkerFn,
23 GrGLPushGroupMarkerProc pushGroupMarkerFn,
24 GrGLPopGroupMarkerProc popGroupMarkerFn) {
25 GrGLInterface* newInterface = GrGLInterface::NewClone(interface);
26
27 if (!newInterface->fExtensions.has("GL_EXT_debug_marker")) {
28 newInterface->fExtensions.add("GL_EXT_debug_marker");
29 }
30
commit-bot@chromium.orgf5355612014-02-28 20:28:50 +000031 newInterface->fFunctions.fInsertEventMarker = insertEventMarkerFn;
32 newInterface->fFunctions.fPushGroupMarker = pushGroupMarkerFn;
33 newInterface->fFunctions.fPopGroupMarker = popGroupMarkerFn;
commit-bot@chromium.orga3baf3b2014-02-21 18:45:30 +000034
35 return newInterface;
36}
37
commit-bot@chromium.orgd8ed8512014-01-24 20:49:44 +000038const GrGLInterface* GrGLInterfaceRemoveNVPR(const GrGLInterface* interface) {
39 GrGLInterface* newInterface = GrGLInterface::NewClone(interface);
40
41 newInterface->fExtensions.remove("GL_NV_path_rendering");
commit-bot@chromium.orgf5355612014-02-28 20:28:50 +000042 newInterface->fFunctions.fPathCommands = NULL;
commit-bot@chromium.orgf5355612014-02-28 20:28:50 +000043 newInterface->fFunctions.fPathParameteri = NULL;
commit-bot@chromium.orgf5355612014-02-28 20:28:50 +000044 newInterface->fFunctions.fPathParameterf = NULL;
commit-bot@chromium.orgf5355612014-02-28 20:28:50 +000045 newInterface->fFunctions.fGenPaths = NULL;
46 newInterface->fFunctions.fDeletePaths = NULL;
cdalton8dd90cb2014-07-17 09:28:36 -070047 newInterface->fFunctions.fIsPath = NULL;
commit-bot@chromium.orgf5355612014-02-28 20:28:50 +000048 newInterface->fFunctions.fPathStencilFunc = NULL;
commit-bot@chromium.orgf5355612014-02-28 20:28:50 +000049 newInterface->fFunctions.fStencilFillPath = NULL;
50 newInterface->fFunctions.fStencilStrokePath = NULL;
51 newInterface->fFunctions.fStencilFillPathInstanced = NULL;
52 newInterface->fFunctions.fStencilStrokePathInstanced = NULL;
commit-bot@chromium.orgf5355612014-02-28 20:28:50 +000053 newInterface->fFunctions.fCoverFillPath = NULL;
54 newInterface->fFunctions.fCoverStrokePath = NULL;
55 newInterface->fFunctions.fCoverFillPathInstanced = NULL;
56 newInterface->fFunctions.fCoverStrokePathInstanced = NULL;
cdaltonc7103a12014-08-11 14:05:05 -070057 newInterface->fFunctions.fStencilThenCoverFillPath = NULL;
58 newInterface->fFunctions.fStencilThenCoverStrokePath = NULL;
59 newInterface->fFunctions.fStencilThenCoverFillPathInstanced = NULL;
60 newInterface->fFunctions.fStencilThenCoverStrokePathInstanced = NULL;
kkinnunen32b9a3b2014-07-02 22:56:35 -070061 newInterface->fFunctions.fProgramPathFragmentInputGen = NULL;
kkinnunen6bb6d402015-07-14 10:59:23 -070062 newInterface->fFunctions.fBindFragmentInputLocation = NULL;
commit-bot@chromium.orgd8ed8512014-01-24 20:49:44 +000063 return newInterface;
64}
65
commit-bot@chromium.orgf5355612014-02-28 20:28:50 +000066GrGLInterface::GrGLInterface() {
commit-bot@chromium.org9e90aed2014-01-16 16:35:09 +000067 fStandard = kNone_GrGLStandard;
bsalomon@google.com0b77d682011-08-19 13:28:54 +000068
bsalomon@google.com56bfc5a2011-09-01 13:28:16 +000069#if GR_GL_PER_GL_FUNC_CALLBACK
70 fCallback = GrGLDefaultInterfaceCallback;
71 fCallbackData = 0;
72#endif
bsalomon@google.com0b77d682011-08-19 13:28:54 +000073}
74
commit-bot@chromium.orgd8ed8512014-01-24 20:49:44 +000075GrGLInterface* GrGLInterface::NewClone(const GrGLInterface* interface) {
bsalomon49f085d2014-09-05 13:34:00 -070076 SkASSERT(interface);
commit-bot@chromium.orgd8ed8512014-01-24 20:49:44 +000077
halcanary385fe4d2015-08-26 13:07:48 -070078 GrGLInterface* clone = new GrGLInterface;
commit-bot@chromium.orgd8ed8512014-01-24 20:49:44 +000079 clone->fStandard = interface->fStandard;
80 clone->fExtensions = interface->fExtensions;
81 clone->fFunctions = interface->fFunctions;
82#if GR_GL_PER_GL_FUNC_CALLBACK
83 clone->fCallback = interface->fCallback;
84 clone->fCallbackData = interface->fCallbackData;
85#endif
86 return clone;
87}
88
commit-bot@chromium.orge83b9b72014-05-01 19:21:41 +000089#ifdef SK_DEBUG
90 static int kIsDebug = 1;
91#else
92 static int kIsDebug = 0;
93#endif
94
95#define RETURN_FALSE_INTERFACE \
96 if (kIsDebug) { SkDebugf("%s:%d GrGLInterface::validate() failed.\n", __FILE__, __LINE__); } \
97 return false;
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +000098
commit-bot@chromium.org9e90aed2014-01-16 16:35:09 +000099bool GrGLInterface::validate() const {
bsalomon@google.com0b77d682011-08-19 13:28:54 +0000100
commit-bot@chromium.org9e90aed2014-01-16 16:35:09 +0000101 if (kNone_GrGLStandard == fStandard) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000102 RETURN_FALSE_INTERFACE
bsalomon@google.com1dcf5062011-11-14 19:29:53 +0000103 }
skia.committer@gmail.com12eea2b2013-02-27 07:10:10 +0000104
commit-bot@chromium.org90313cc2014-01-17 15:05:38 +0000105 if (!fExtensions.isInitialized()) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000106 RETURN_FALSE_INTERFACE
bsalomon@google.com1744f972013-02-26 21:46:32 +0000107 }
bsalomon@google.com1dcf5062011-11-14 19:29:53 +0000108
109 // functions that are always required
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000110 if (NULL == fFunctions.fActiveTexture ||
111 NULL == fFunctions.fAttachShader ||
112 NULL == fFunctions.fBindAttribLocation ||
113 NULL == fFunctions.fBindBuffer ||
114 NULL == fFunctions.fBindTexture ||
cdaltonbae6f6c2015-04-22 10:39:03 -0700115 NULL == fFunctions.fBlendColor || // -> GL >= 1.4 or extension, ES >= 2.0
cdaltonbae6f6c2015-04-22 10:39:03 -0700116 NULL == fFunctions.fBlendEquation || // -> GL >= 1.4 or extension, ES >= 2.0
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000117 NULL == fFunctions.fBlendFunc ||
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000118 NULL == fFunctions.fBufferData ||
119 NULL == fFunctions.fBufferSubData ||
120 NULL == fFunctions.fClear ||
121 NULL == fFunctions.fClearColor ||
122 NULL == fFunctions.fClearStencil ||
123 NULL == fFunctions.fColorMask ||
124 NULL == fFunctions.fCompileShader ||
125 NULL == fFunctions.fCopyTexSubImage2D ||
126 NULL == fFunctions.fCreateProgram ||
127 NULL == fFunctions.fCreateShader ||
128 NULL == fFunctions.fCullFace ||
129 NULL == fFunctions.fDeleteBuffers ||
130 NULL == fFunctions.fDeleteProgram ||
131 NULL == fFunctions.fDeleteShader ||
132 NULL == fFunctions.fDeleteTextures ||
133 NULL == fFunctions.fDepthMask ||
134 NULL == fFunctions.fDisable ||
135 NULL == fFunctions.fDisableVertexAttribArray ||
136 NULL == fFunctions.fDrawArrays ||
137 NULL == fFunctions.fDrawElements ||
138 NULL == fFunctions.fEnable ||
139 NULL == fFunctions.fEnableVertexAttribArray ||
140 NULL == fFunctions.fFrontFace ||
141 NULL == fFunctions.fGenBuffers ||
142 NULL == fFunctions.fGenTextures ||
143 NULL == fFunctions.fGetBufferParameteriv ||
144 NULL == fFunctions.fGenerateMipmap ||
145 NULL == fFunctions.fGetError ||
146 NULL == fFunctions.fGetIntegerv ||
147 NULL == fFunctions.fGetProgramInfoLog ||
148 NULL == fFunctions.fGetProgramiv ||
149 NULL == fFunctions.fGetShaderInfoLog ||
150 NULL == fFunctions.fGetShaderiv ||
151 NULL == fFunctions.fGetString ||
152 NULL == fFunctions.fGetUniformLocation ||
bsalomon6dc6f5f2015-06-18 09:12:16 -0700153#if 0 // Not included in Chrome yet
154 NULL == fFunctions.fIsTexture ||
155#endif
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000156 NULL == fFunctions.fLinkProgram ||
157 NULL == fFunctions.fLineWidth ||
158 NULL == fFunctions.fPixelStorei ||
159 NULL == fFunctions.fReadPixels ||
160 NULL == fFunctions.fScissor ||
161 NULL == fFunctions.fShaderSource ||
162 NULL == fFunctions.fStencilFunc ||
163 NULL == fFunctions.fStencilMask ||
164 NULL == fFunctions.fStencilOp ||
165 NULL == fFunctions.fTexImage2D ||
166 NULL == fFunctions.fTexParameteri ||
167 NULL == fFunctions.fTexParameteriv ||
168 NULL == fFunctions.fTexSubImage2D ||
169 NULL == fFunctions.fUniform1f ||
170 NULL == fFunctions.fUniform1i ||
171 NULL == fFunctions.fUniform1fv ||
172 NULL == fFunctions.fUniform1iv ||
173 NULL == fFunctions.fUniform2f ||
174 NULL == fFunctions.fUniform2i ||
175 NULL == fFunctions.fUniform2fv ||
176 NULL == fFunctions.fUniform2iv ||
177 NULL == fFunctions.fUniform3f ||
178 NULL == fFunctions.fUniform3i ||
179 NULL == fFunctions.fUniform3fv ||
180 NULL == fFunctions.fUniform3iv ||
181 NULL == fFunctions.fUniform4f ||
182 NULL == fFunctions.fUniform4i ||
183 NULL == fFunctions.fUniform4fv ||
184 NULL == fFunctions.fUniform4iv ||
185 NULL == fFunctions.fUniformMatrix2fv ||
186 NULL == fFunctions.fUniformMatrix3fv ||
187 NULL == fFunctions.fUniformMatrix4fv ||
188 NULL == fFunctions.fUseProgram ||
egdaniel27c15212014-10-24 15:00:50 -0700189 NULL == fFunctions.fVertexAttrib1f ||
190 NULL == fFunctions.fVertexAttrib2fv ||
191 NULL == fFunctions.fVertexAttrib3fv ||
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000192 NULL == fFunctions.fVertexAttrib4fv ||
193 NULL == fFunctions.fVertexAttribPointer ||
194 NULL == fFunctions.fViewport ||
195 NULL == fFunctions.fBindFramebuffer ||
196 NULL == fFunctions.fBindRenderbuffer ||
197 NULL == fFunctions.fCheckFramebufferStatus ||
198 NULL == fFunctions.fDeleteFramebuffers ||
199 NULL == fFunctions.fDeleteRenderbuffers ||
200 NULL == fFunctions.fFinish ||
201 NULL == fFunctions.fFlush ||
202 NULL == fFunctions.fFramebufferRenderbuffer ||
203 NULL == fFunctions.fFramebufferTexture2D ||
204 NULL == fFunctions.fGetFramebufferAttachmentParameteriv ||
205 NULL == fFunctions.fGetRenderbufferParameteriv ||
206 NULL == fFunctions.fGenFramebuffers ||
207 NULL == fFunctions.fGenRenderbuffers ||
208 NULL == fFunctions.fRenderbufferStorage) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000209 RETURN_FALSE_INTERFACE
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000210 }
211
bsalomon@google.comc82b8892011-09-22 14:10:33 +0000212 GrGLVersion glVer = GrGLGetVersion(this);
commit-bot@chromium.orgf4e67e32014-04-30 01:26:04 +0000213 if (GR_GL_INVALID_VER == glVer) {
214 RETURN_FALSE_INTERFACE
215 }
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000216
217 // Now check that baseline ES/Desktop fns not covered above are present
commit-bot@chromium.org90313cc2014-01-17 15:05:38 +0000218 // and that we have fn pointers for any advertised fExtensions that we will
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000219 // try to use.
220
221 // these functions are part of ES2, we assume they are available
222 // On the desktop we assume they are available if the extension
223 // is present or GL version is high enough.
commit-bot@chromium.org9e90aed2014-01-16 16:35:09 +0000224 if (kGLES_GrGLStandard == fStandard) {
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000225 if (NULL == fFunctions.fStencilFuncSeparate ||
226 NULL == fFunctions.fStencilMaskSeparate ||
227 NULL == fFunctions.fStencilOpSeparate) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000228 RETURN_FALSE_INTERFACE
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000229 }
commit-bot@chromium.org9e90aed2014-01-16 16:35:09 +0000230 } else if (kGL_GrGLStandard == fStandard) {
robertphillips@google.come7884302012-04-18 14:39:58 +0000231
bsalomon@google.comc82b8892011-09-22 14:10:33 +0000232 if (glVer >= GR_GL_VER(2,0)) {
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000233 if (NULL == fFunctions.fStencilFuncSeparate ||
234 NULL == fFunctions.fStencilMaskSeparate ||
235 NULL == fFunctions.fStencilOpSeparate) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000236 RETURN_FALSE_INTERFACE
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000237 }
238 }
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000239 if (glVer >= GR_GL_VER(3,0) && NULL == fFunctions.fBindFragDataLocation) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000240 RETURN_FALSE_INTERFACE
bsalomon@google.combc5cf512011-09-21 16:21:07 +0000241 }
commit-bot@chromium.org90313cc2014-01-17 15:05:38 +0000242 if (glVer >= GR_GL_VER(2,0) || fExtensions.has("GL_ARB_draw_buffers")) {
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000243 if (NULL == fFunctions.fDrawBuffers) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000244 RETURN_FALSE_INTERFACE
bsalomon@google.comd32c5f52011-08-02 19:29:03 +0000245 }
246 }
robertphillips@google.come7884302012-04-18 14:39:58 +0000247
commit-bot@chromium.org90313cc2014-01-17 15:05:38 +0000248 if (glVer >= GR_GL_VER(1,5) || fExtensions.has("GL_ARB_occlusion_query")) {
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000249 if (NULL == fFunctions.fGenQueries ||
250 NULL == fFunctions.fDeleteQueries ||
251 NULL == fFunctions.fBeginQuery ||
252 NULL == fFunctions.fEndQuery ||
253 NULL == fFunctions.fGetQueryiv ||
254 NULL == fFunctions.fGetQueryObjectiv ||
255 NULL == fFunctions.fGetQueryObjectuiv) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000256 RETURN_FALSE_INTERFACE
bsalomon@google.com373a6632011-10-19 20:43:20 +0000257 }
258 }
259 if (glVer >= GR_GL_VER(3,3) ||
commit-bot@chromium.org90313cc2014-01-17 15:05:38 +0000260 fExtensions.has("GL_ARB_timer_query") ||
261 fExtensions.has("GL_EXT_timer_query")) {
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000262 if (NULL == fFunctions.fGetQueryObjecti64v ||
263 NULL == fFunctions.fGetQueryObjectui64v) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000264 RETURN_FALSE_INTERFACE
bsalomon@google.com373a6632011-10-19 20:43:20 +0000265 }
266 }
commit-bot@chromium.org90313cc2014-01-17 15:05:38 +0000267 if (glVer >= GR_GL_VER(3,3) || fExtensions.has("GL_ARB_timer_query")) {
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000268 if (NULL == fFunctions.fQueryCounter) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000269 RETURN_FALSE_INTERFACE
bsalomon@google.com373a6632011-10-19 20:43:20 +0000270 }
271 }
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000272 }
273
274 // optional function on desktop before 1.3
commit-bot@chromium.org9e90aed2014-01-16 16:35:09 +0000275 if (kGL_GrGLStandard != fStandard ||
bsalomon@google.com1744f972013-02-26 21:46:32 +0000276 (glVer >= GR_GL_VER(1,3)) ||
commit-bot@chromium.org90313cc2014-01-17 15:05:38 +0000277 fExtensions.has("GL_ARB_texture_compression")) {
krajcevskie1f5a232014-06-11 16:08:50 -0700278 if (NULL == fFunctions.fCompressedTexImage2D
bsalomonc9aec1e2015-04-24 11:08:25 -0700279#if 0
krajcevskie1f5a232014-06-11 16:08:50 -0700280 || NULL == fFunctions.fCompressedTexSubImage2D
bsalomonc9aec1e2015-04-24 11:08:25 -0700281#endif
krajcevskie1f5a232014-06-11 16:08:50 -0700282 ) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000283 RETURN_FALSE_INTERFACE
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000284 }
285 }
286
bsalomon@google.comd32c5f52011-08-02 19:29:03 +0000287 // part of desktop GL, but not ES
commit-bot@chromium.org9e90aed2014-01-16 16:35:09 +0000288 if (kGL_GrGLStandard == fStandard &&
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000289 (NULL == fFunctions.fGetTexLevelParameteriv ||
290 NULL == fFunctions.fDrawBuffer ||
291 NULL == fFunctions.fReadBuffer)) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000292 RETURN_FALSE_INTERFACE
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000293 }
bsalomon@google.comcee661a2011-07-26 12:32:36 +0000294
bsalomon@google.com280e99f2012-01-05 16:17:38 +0000295 // GL_EXT_texture_storage is part of desktop 4.2
296 // There is a desktop ARB extension and an ES+desktop EXT extension
commit-bot@chromium.org9e90aed2014-01-16 16:35:09 +0000297 if (kGL_GrGLStandard == fStandard) {
bsalomon@google.combaa9ea12012-01-06 19:05:43 +0000298 if (glVer >= GR_GL_VER(4,2) ||
commit-bot@chromium.org90313cc2014-01-17 15:05:38 +0000299 fExtensions.has("GL_ARB_texture_storage") ||
300 fExtensions.has("GL_EXT_texture_storage")) {
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000301 if (NULL == fFunctions.fTexStorage2D) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000302 RETURN_FALSE_INTERFACE
bsalomon@google.combaa9ea12012-01-06 19:05:43 +0000303 }
304 }
commit-bot@chromium.org90313cc2014-01-17 15:05:38 +0000305 } else if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_texture_storage")) {
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000306 if (NULL == fFunctions.fTexStorage2D) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000307 RETURN_FALSE_INTERFACE
bsalomon@google.combaa9ea12012-01-06 19:05:43 +0000308 }
bsalomon@google.com280e99f2012-01-05 16:17:38 +0000309 }
310
cdaltonfd4167d2015-04-21 11:45:56 -0700311 // glTextureBarrier is part of desktop 4.5. There are also ARB and NV extensions.
312 if (kGL_GrGLStandard == fStandard) {
313 if (glVer >= GR_GL_VER(4,5) ||
314 fExtensions.has("GL_ARB_texture_barrier") ||
315 fExtensions.has("GL_NV_texture_barrier")) {
316 if (NULL == fFunctions.fTextureBarrier) {
317 RETURN_FALSE_INTERFACE
318 }
319 }
320 } else if (fExtensions.has("GL_NV_texture_barrier")) {
321 if (NULL == fFunctions.fTextureBarrier) {
322 RETURN_FALSE_INTERFACE
323 }
324 }
325
cdaltonbae6f6c2015-04-22 10:39:03 -0700326 if (fExtensions.has("GL_KHR_blend_equation_advanced") ||
327 fExtensions.has("GL_NV_blend_equation_advanced")) {
328 if (NULL == fFunctions.fBlendBarrier) {
329 RETURN_FALSE_INTERFACE
330 }
331 }
332
commit-bot@chromium.org90313cc2014-01-17 15:05:38 +0000333 if (fExtensions.has("GL_EXT_discard_framebuffer")) {
bsalomonc9aec1e2015-04-24 11:08:25 -0700334// FIXME: Remove this once Chromium is updated to provide this function
335#if 0
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000336 if (NULL == fFunctions.fDiscardFramebuffer) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000337 RETURN_FALSE_INTERFACE
robertphillips@google.coma6ffb582013-04-29 16:50:17 +0000338 }
bsalomonc9aec1e2015-04-24 11:08:25 -0700339#endif
robertphillips@google.coma6ffb582013-04-29 16:50:17 +0000340 }
341
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000342 // FBO MSAA
commit-bot@chromium.org9e90aed2014-01-16 16:35:09 +0000343 if (kGL_GrGLStandard == fStandard) {
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000344 // GL 3.0 and the ARB extension have multisample + blit
commit-bot@chromium.org90313cc2014-01-17 15:05:38 +0000345 if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_ARB_framebuffer_object")) {
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000346 if (NULL == fFunctions.fRenderbufferStorageMultisample ||
347 NULL == fFunctions.fBlitFramebuffer) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000348 RETURN_FALSE_INTERFACE
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000349 }
350 } else {
commit-bot@chromium.org90313cc2014-01-17 15:05:38 +0000351 if (fExtensions.has("GL_EXT_framebuffer_blit") &&
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000352 NULL == fFunctions.fBlitFramebuffer) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000353 RETURN_FALSE_INTERFACE
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000354 }
commit-bot@chromium.org90313cc2014-01-17 15:05:38 +0000355 if (fExtensions.has("GL_EXT_framebuffer_multisample") &&
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000356 NULL == fFunctions.fRenderbufferStorageMultisample) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000357 RETURN_FALSE_INTERFACE
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000358 }
359 }
360 } else {
commit-bot@chromium.org90313cc2014-01-17 15:05:38 +0000361 if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_CHROMIUM_framebuffer_multisample")) {
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000362 if (NULL == fFunctions.fRenderbufferStorageMultisample ||
363 NULL == fFunctions.fBlitFramebuffer) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000364 RETURN_FALSE_INTERFACE
commit-bot@chromium.orga8e5a062013-09-05 23:44:09 +0000365 }
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000366 }
commit-bot@chromium.org90313cc2014-01-17 15:05:38 +0000367 if (fExtensions.has("GL_APPLE_framebuffer_multisample")) {
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000368 if (NULL == fFunctions.fRenderbufferStorageMultisampleES2APPLE ||
369 NULL == fFunctions.fResolveMultisampleFramebuffer) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000370 RETURN_FALSE_INTERFACE
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000371 }
372 }
commit-bot@chromium.org90313cc2014-01-17 15:05:38 +0000373 if (fExtensions.has("GL_IMG_multisampled_render_to_texture") ||
374 fExtensions.has("GL_EXT_multisampled_render_to_texture")) {
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000375 if (NULL == fFunctions.fRenderbufferStorageMultisampleES2EXT ||
376 NULL == fFunctions.fFramebufferTexture2DMultisample) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000377 RETURN_FALSE_INTERFACE
bsalomon@google.comf3a60c02013-03-19 19:06:09 +0000378 }
379 }
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000380 }
381
382 // On ES buffer mapping is an extension. On Desktop
383 // buffer mapping was part of original VBO extension
384 // which we require.
commit-bot@chromium.org90313cc2014-01-17 15:05:38 +0000385 if (kGL_GrGLStandard == fStandard || fExtensions.has("GL_OES_mapbuffer")) {
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000386 if (NULL == fFunctions.fMapBuffer ||
387 NULL == fFunctions.fUnmapBuffer) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000388 RETURN_FALSE_INTERFACE
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000389 }
390 }
391
bsalomon@google.com271cffc2011-05-20 14:13:56 +0000392 // Dual source blending
kkinnunend94708e2015-07-30 22:47:04 -0700393 if (kGL_GrGLStandard == fStandard) {
394 if (glVer >= GR_GL_VER(3,3) || fExtensions.has("GL_ARB_blend_func_extended")) {
395 if (NULL == fFunctions.fBindFragDataLocationIndexed) {
396 RETURN_FALSE_INTERFACE
397 }
398 }
399 } else {
400 if (glVer >= GR_GL_VER(3,0) && fExtensions.has("GL_EXT_blend_func_extended")) {
401 if (NULL == fFunctions.fBindFragDataLocation ||
402 NULL == fFunctions.fBindFragDataLocationIndexed) {
403 RETURN_FALSE_INTERFACE
404 }
bsalomon@google.com271cffc2011-05-20 14:13:56 +0000405 }
406 }
skia.committer@gmail.com12eea2b2013-02-27 07:10:10 +0000407
kkinnunend94708e2015-07-30 22:47:04 -0700408
commit-bot@chromium.org726e6212013-08-23 20:55:46 +0000409 // glGetStringi was added in version 3.0 of both desktop and ES.
410 if (glVer >= GR_GL_VER(3, 0)) {
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000411 if (NULL == fFunctions.fGetStringi) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000412 RETURN_FALSE_INTERFACE
bsalomon@google.com1744f972013-02-26 21:46:32 +0000413 }
414 }
bsalomon@google.com271cffc2011-05-20 14:13:56 +0000415
commit-bot@chromium.org9e90aed2014-01-16 16:35:09 +0000416 if (kGL_GrGLStandard == fStandard) {
commit-bot@chromium.org90313cc2014-01-17 15:05:38 +0000417 if (glVer >= GR_GL_VER(3, 0) || fExtensions.has("GL_ARB_vertex_array_object")) {
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000418 if (NULL == fFunctions.fBindVertexArray ||
419 NULL == fFunctions.fDeleteVertexArrays ||
420 NULL == fFunctions.fGenVertexArrays) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000421 RETURN_FALSE_INTERFACE
bsalomon@google.comecd84842013-03-01 15:36:02 +0000422 }
423 }
424 } else {
commit-bot@chromium.org90313cc2014-01-17 15:05:38 +0000425 if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_OES_vertex_array_object")) {
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000426 if (NULL == fFunctions.fBindVertexArray ||
427 NULL == fFunctions.fDeleteVertexArrays ||
428 NULL == fFunctions.fGenVertexArrays) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000429 RETURN_FALSE_INTERFACE
bsalomon@google.comecd84842013-03-01 15:36:02 +0000430 }
431 }
bsalomon@google.comecd84842013-03-01 15:36:02 +0000432 }
commit-bot@chromium.orga3baf3b2014-02-21 18:45:30 +0000433
commit-bot@chromium.orga3baf3b2014-02-21 18:45:30 +0000434 if (fExtensions.has("GL_EXT_debug_marker")) {
435 if (NULL == fFunctions.fInsertEventMarker ||
436 NULL == fFunctions.fPushGroupMarker ||
437 NULL == fFunctions.fPopGroupMarker) {
commit-bot@chromium.orgadadf7c2014-03-24 19:43:02 +0000438 RETURN_FALSE_INTERFACE
commit-bot@chromium.orga3baf3b2014-02-21 18:45:30 +0000439 }
440 }
bsalomon@google.coma34bb602014-04-01 13:07:29 +0000441
commit-bot@chromium.org160b4782014-05-05 12:32:37 +0000442 if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,3)) ||
443 fExtensions.has("GL_ARB_invalidate_subdata")) {
bsalomon@google.coma34bb602014-04-01 13:07:29 +0000444 if (NULL == fFunctions.fInvalidateBufferData ||
445 NULL == fFunctions.fInvalidateBufferSubData ||
446 NULL == fFunctions.fInvalidateFramebuffer ||
447 NULL == fFunctions.fInvalidateSubFramebuffer ||
448 NULL == fFunctions.fInvalidateTexImage ||
449 NULL == fFunctions.fInvalidateTexSubImage) {
450 RETURN_FALSE_INTERFACE;
451 }
commit-bot@chromium.org160b4782014-05-05 12:32:37 +0000452 } else if (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) {
bsalomon@google.coma34bb602014-04-01 13:07:29 +0000453 // ES 3.0 adds the framebuffer functions but not the others.
454 if (NULL == fFunctions.fInvalidateFramebuffer ||
455 NULL == fFunctions.fInvalidateSubFramebuffer) {
456 RETURN_FALSE_INTERFACE;
457 }
458 }
commit-bot@chromium.orgbeb8b3a2014-04-15 15:37:51 +0000459
460 if (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_CHROMIUM_map_sub")) {
461 if (NULL == fFunctions.fMapBufferSubData ||
462 NULL == fFunctions.fMapTexSubImage2D ||
463 NULL == fFunctions.fUnmapBufferSubData ||
464 NULL == fFunctions.fUnmapTexSubImage2D) {
465 RETURN_FALSE_INTERFACE;
466 }
467 }
bsalomon@google.coma34bb602014-04-01 13:07:29 +0000468
commit-bot@chromium.org160b4782014-05-05 12:32:37 +0000469 // These functions are added to the 3.0 version of both GLES and GL.
470 if (glVer >= GR_GL_VER(3,0) ||
471 (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_EXT_map_buffer_range")) ||
472 (kGL_GrGLStandard == fStandard && fExtensions.has("GL_ARB_map_buffer_range"))) {
473 if (NULL == fFunctions.fMapBufferRange ||
474 NULL == fFunctions.fFlushMappedBufferRange) {
475 RETURN_FALSE_INTERFACE;
476 }
477 }
kkinnunen32b9a3b2014-07-02 22:56:35 -0700478
kkinnunen32b9a3b2014-07-02 22:56:35 -0700479 if ((kGL_GrGLStandard == fStandard &&
480 (glVer >= GR_GL_VER(4,3) || fExtensions.has("GL_ARB_program_interface_query"))) ||
481 (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,1))) {
482 if (NULL == fFunctions.fGetProgramResourceLocation) {
483 RETURN_FALSE_INTERFACE
484 }
485 }
486
bsalomonee64d6e2014-12-03 10:46:08 -0800487 if (kGLES_GrGLStandard == fStandard || glVer >= GR_GL_VER(4,1) ||
488 fExtensions.has("GL_ARB_ES2_compatibility")) {
bsalomonc9aec1e2015-04-24 11:08:25 -0700489#if 0 // Enable this once Chrome gives us the function ptr
bsalomonee64d6e2014-12-03 10:46:08 -0800490 if (NULL == fFunctions.fGetShaderPrecisionFormat) {
491 RETURN_FALSE_INTERFACE
492 }
bsalomonc9aec1e2015-04-24 11:08:25 -0700493#endif
bsalomonee64d6e2014-12-03 10:46:08 -0800494 }
495
kkinnunen6bb6d402015-07-14 10:59:23 -0700496 if (fExtensions.has("GL_NV_path_rendering") || fExtensions.has("GL_CHROMIUM_path_rendering")) {
cdalton626e1ff2015-06-12 13:56:46 -0700497 if (NULL == fFunctions.fMatrixLoadf ||
498 NULL == fFunctions.fMatrixLoadIdentity ||
499 NULL == fFunctions.fPathCommands ||
kkinnunen32b9a3b2014-07-02 22:56:35 -0700500 NULL == fFunctions.fPathParameteri ||
501 NULL == fFunctions.fPathParameterf ||
502 NULL == fFunctions.fGenPaths ||
503 NULL == fFunctions.fDeletePaths ||
cdalton8dd90cb2014-07-17 09:28:36 -0700504 NULL == fFunctions.fIsPath ||
kkinnunen32b9a3b2014-07-02 22:56:35 -0700505 NULL == fFunctions.fPathStencilFunc ||
506 NULL == fFunctions.fStencilFillPath ||
507 NULL == fFunctions.fStencilStrokePath ||
508 NULL == fFunctions.fStencilFillPathInstanced ||
509 NULL == fFunctions.fStencilStrokePathInstanced ||
510 NULL == fFunctions.fCoverFillPath ||
511 NULL == fFunctions.fCoverStrokePath ||
512 NULL == fFunctions.fCoverFillPathInstanced ||
kkinnunencfe62e32015-07-01 02:58:50 -0700513 NULL == fFunctions.fCoverStrokePathInstanced
514#if 0
515 // List of functions that Skia uses, but which have been added since the initial release
516 // of NV_path_rendering driver. We do not want to fail interface validation due to
517 // missing features, we will just not use the extension.
518 // Update this list -> update GrGLCaps::hasPathRenderingSupport too.
519 || NULL == fFunctions.fStencilThenCoverFillPath ||
520 NULL == fFunctions.fStencilThenCoverStrokePath ||
521 NULL == fFunctions.fStencilThenCoverFillPathInstanced ||
522 NULL == fFunctions.fStencilThenCoverStrokePathInstanced ||
523 NULL == fFunctions.fProgramPathFragmentInputGen
524#endif
525 ) {
kkinnunen32b9a3b2014-07-02 22:56:35 -0700526 RETURN_FALSE_INTERFACE
527 }
kkinnunen6bb6d402015-07-14 10:59:23 -0700528 if (fExtensions.has("GL_CHROMIUM_path_rendering")) {
529 if (NULL == fFunctions.fBindFragmentInputLocation) {
530 RETURN_FALSE_INTERFACE
531 }
532 }
kkinnunen32b9a3b2014-07-02 22:56:35 -0700533 }
534
cdalton0edea2c2015-05-21 08:27:44 -0700535 if (fExtensions.has("GL_EXT_raster_multisample")) {
536 if (NULL == fFunctions.fRasterSamples) {
537 RETURN_FALSE_INTERFACE
538 }
539 }
540
vbuzinov08b4d292015-04-01 06:29:49 -0700541 if (fExtensions.has("GL_NV_framebuffer_mixed_samples")) {
542 if (NULL == fFunctions.fCoverageModulation) {
543 RETURN_FALSE_INTERFACE
544 }
545 }
546
cdalton626e1ff2015-06-12 13:56:46 -0700547 if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,1)) ||
548 (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) ||
549 fExtensions.has("GL_ARB_draw_instanced") ||
550 fExtensions.has("GL_EXT_draw_instanced")) {
551 if (NULL == fFunctions.fDrawArraysInstanced ||
552 NULL == fFunctions.fDrawElementsInstanced) {
553 RETURN_FALSE_INTERFACE
554 }
555 }
556
557 if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,2)) ||
558 (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) ||
559 fExtensions.has("GL_ARB_instanced_arrays") ||
560 fExtensions.has("GL_EXT_instanced_arrays")) {
561 if (NULL == fFunctions.fVertexAttribDivisor) {
562 RETURN_FALSE_INTERFACE
563 }
564 }
565
566 if (fExtensions.has("GL_NV_bindless_texture")) {
567 if (NULL == fFunctions.fGetTextureHandle ||
568 NULL == fFunctions.fGetTextureSamplerHandle ||
569 NULL == fFunctions.fMakeTextureHandleResident ||
570 NULL == fFunctions.fMakeTextureHandleNonResident ||
571 NULL == fFunctions.fGetImageHandle ||
572 NULL == fFunctions.fMakeImageHandleResident ||
573 NULL == fFunctions.fMakeImageHandleNonResident ||
574 NULL == fFunctions.fIsTextureHandleResident ||
575 NULL == fFunctions.fIsImageHandleResident ||
576 NULL == fFunctions.fUniformHandleui64 ||
577 NULL == fFunctions.fUniformHandleui64v ||
578 NULL == fFunctions.fProgramUniformHandleui64 ||
579 NULL == fFunctions.fProgramUniformHandleui64v) {
580 RETURN_FALSE_INTERFACE
581 }
582 }
583
584 if (kGL_GrGLStandard == fStandard && fExtensions.has("GL_EXT_direct_state_access")) {
585 if (NULL == fFunctions.fTextureParameteri ||
586 NULL == fFunctions.fTextureParameteriv ||
587 NULL == fFunctions.fTextureParameterf ||
588 NULL == fFunctions.fTextureParameterfv ||
589 NULL == fFunctions.fTextureImage1D ||
590 NULL == fFunctions.fTextureImage2D ||
591 NULL == fFunctions.fTextureSubImage1D ||
592 NULL == fFunctions.fTextureSubImage2D ||
593 NULL == fFunctions.fCopyTextureImage1D ||
594 NULL == fFunctions.fCopyTextureImage2D ||
595 NULL == fFunctions.fCopyTextureSubImage1D ||
596 NULL == fFunctions.fCopyTextureSubImage2D ||
597 NULL == fFunctions.fGetTextureImage ||
598 NULL == fFunctions.fGetTextureParameterfv ||
599 NULL == fFunctions.fGetTextureParameteriv ||
600 NULL == fFunctions.fGetTextureLevelParameterfv ||
601 NULL == fFunctions.fGetTextureLevelParameteriv) {
602 RETURN_FALSE_INTERFACE
603 }
604 if (glVer >= GR_GL_VER(1,2)) {
605 if (NULL == fFunctions.fTextureImage3D ||
606 NULL == fFunctions.fTextureSubImage3D ||
607 NULL == fFunctions.fCopyTextureSubImage3D ||
608 NULL == fFunctions.fCompressedTextureImage3D ||
609 NULL == fFunctions.fCompressedTextureImage2D ||
610 NULL == fFunctions.fCompressedTextureImage1D ||
611 NULL == fFunctions.fCompressedTextureSubImage3D ||
612 NULL == fFunctions.fCompressedTextureSubImage2D ||
613 NULL == fFunctions.fCompressedTextureSubImage1D ||
614 NULL == fFunctions.fGetCompressedTextureImage) {
615 RETURN_FALSE_INTERFACE
616 }
617 }
618 if (glVer >= GR_GL_VER(1,5)) {
619 if (NULL == fFunctions.fNamedBufferData ||
620 NULL == fFunctions.fNamedBufferSubData ||
621 NULL == fFunctions.fMapNamedBuffer ||
622 NULL == fFunctions.fUnmapNamedBuffer ||
623 NULL == fFunctions.fGetNamedBufferParameteriv ||
624 NULL == fFunctions.fGetNamedBufferPointerv ||
625 NULL == fFunctions.fGetNamedBufferSubData) {
626 RETURN_FALSE_INTERFACE
627 }
628 }
629 if (glVer >= GR_GL_VER(2,0)) {
630 if (NULL == fFunctions.fProgramUniform1f ||
631 NULL == fFunctions.fProgramUniform2f ||
632 NULL == fFunctions.fProgramUniform3f ||
633 NULL == fFunctions.fProgramUniform4f ||
634 NULL == fFunctions.fProgramUniform1i ||
635 NULL == fFunctions.fProgramUniform2i ||
636 NULL == fFunctions.fProgramUniform3i ||
637 NULL == fFunctions.fProgramUniform4i ||
638 NULL == fFunctions.fProgramUniform1fv ||
639 NULL == fFunctions.fProgramUniform2fv ||
640 NULL == fFunctions.fProgramUniform3fv ||
641 NULL == fFunctions.fProgramUniform4fv ||
642 NULL == fFunctions.fProgramUniform1iv ||
643 NULL == fFunctions.fProgramUniform2iv ||
644 NULL == fFunctions.fProgramUniform3iv ||
645 NULL == fFunctions.fProgramUniform4iv ||
646 NULL == fFunctions.fProgramUniformMatrix2fv ||
647 NULL == fFunctions.fProgramUniformMatrix3fv ||
648 NULL == fFunctions.fProgramUniformMatrix4fv) {
649 RETURN_FALSE_INTERFACE
650 }
651 }
652 if (glVer >= GR_GL_VER(2,1)) {
653 if (NULL == fFunctions.fProgramUniformMatrix2x3fv ||
654 NULL == fFunctions.fProgramUniformMatrix3x2fv ||
655 NULL == fFunctions.fProgramUniformMatrix2x4fv ||
656 NULL == fFunctions.fProgramUniformMatrix4x2fv ||
657 NULL == fFunctions.fProgramUniformMatrix3x4fv ||
658 NULL == fFunctions.fProgramUniformMatrix4x3fv) {
659 RETURN_FALSE_INTERFACE
660 }
661 }
662 if (glVer >= GR_GL_VER(3,0)) {
663 if (NULL == fFunctions.fNamedRenderbufferStorage ||
664 NULL == fFunctions.fGetNamedRenderbufferParameteriv ||
665 NULL == fFunctions.fNamedRenderbufferStorageMultisample ||
666 NULL == fFunctions.fCheckNamedFramebufferStatus ||
667 NULL == fFunctions.fNamedFramebufferTexture1D ||
668 NULL == fFunctions.fNamedFramebufferTexture2D ||
669 NULL == fFunctions.fNamedFramebufferTexture3D ||
670 NULL == fFunctions.fNamedFramebufferRenderbuffer ||
671 NULL == fFunctions.fGetNamedFramebufferAttachmentParameteriv ||
672 NULL == fFunctions.fGenerateTextureMipmap ||
673 NULL == fFunctions.fFramebufferDrawBuffer ||
674 NULL == fFunctions.fFramebufferDrawBuffers ||
675 NULL == fFunctions.fFramebufferReadBuffer ||
676 NULL == fFunctions.fGetFramebufferParameteriv ||
677 NULL == fFunctions.fNamedCopyBufferSubData ||
678 NULL == fFunctions.fVertexArrayVertexOffset ||
679 NULL == fFunctions.fVertexArrayColorOffset ||
680 NULL == fFunctions.fVertexArrayEdgeFlagOffset ||
681 NULL == fFunctions.fVertexArrayIndexOffset ||
682 NULL == fFunctions.fVertexArrayNormalOffset ||
683 NULL == fFunctions.fVertexArrayTexCoordOffset ||
684 NULL == fFunctions.fVertexArrayMultiTexCoordOffset ||
685 NULL == fFunctions.fVertexArrayFogCoordOffset ||
686 NULL == fFunctions.fVertexArraySecondaryColorOffset ||
687 NULL == fFunctions.fVertexArrayVertexAttribOffset ||
688 NULL == fFunctions.fVertexArrayVertexAttribIOffset ||
689 NULL == fFunctions.fEnableVertexArray ||
690 NULL == fFunctions.fDisableVertexArray ||
691 NULL == fFunctions.fEnableVertexArrayAttrib ||
692 NULL == fFunctions.fDisableVertexArrayAttrib ||
693 NULL == fFunctions.fGetVertexArrayIntegerv ||
694 NULL == fFunctions.fGetVertexArrayPointerv ||
695 NULL == fFunctions.fGetVertexArrayIntegeri_v ||
696 NULL == fFunctions.fGetVertexArrayPointeri_v ||
697 NULL == fFunctions.fMapNamedBufferRange ||
698 NULL == fFunctions.fFlushMappedNamedBufferRange) {
699 RETURN_FALSE_INTERFACE
700 }
701 }
702 }
703
704 if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,3)) ||
705 fExtensions.has("GL_KHR_debug")) {
706 if (NULL == fFunctions.fDebugMessageControl ||
707 NULL == fFunctions.fDebugMessageInsert ||
708 NULL == fFunctions.fDebugMessageCallback ||
709 NULL == fFunctions.fGetDebugMessageLog ||
710 NULL == fFunctions.fPushDebugGroup ||
711 NULL == fFunctions.fPopDebugGroup ||
712 NULL == fFunctions.fObjectLabel) {
713 RETURN_FALSE_INTERFACE
714 }
715 }
716
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000717 return true;
718}