blob: db57947885dfb9306c893b5cce0e5542383fde74 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
twiz@google.com59a190b2011-03-14 21:23:01 +00002/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00003 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
twiz@google.com59a190b2011-03-14 21:23:01 +00007 */
8
9
twiz@google.com59a190b2011-03-14 21:23:01 +000010#include "GrTypes.h"
bsalomon@google.comf987d1b2011-04-04 17:13:52 +000011#include "GrGLInterface.h"
12#include "GrGLDefines.h"
twiz@google.com59a190b2011-03-14 21:23:01 +000013
14#include <stdio.h>
15
bsalomon@google.com56bfc5a2011-09-01 13:28:16 +000016#if GR_GL_PER_GL_FUNC_CALLBACK
17namespace {
18void GrGLDefaultInterfaceCallback(const GrGLInterface*) {}
19}
20#endif
21
bsalomon@google.comc82b8892011-09-22 14:10:33 +000022GrGLVersion GrGLGetVersionFromString(const char* versionString) {
bsalomon@google.comedfe1aa2011-09-29 14:40:26 +000023 if (NULL == versionString) {
24 GrAssert(!"NULL GL version string.");
25 return 0;
26 }
27
bsalomon@google.comc82b8892011-09-22 14:10:33 +000028 int major, minor;
twiz@google.com0f31ca72011-03-18 17:38:11 +000029
bsalomon@google.comc82b8892011-09-22 14:10:33 +000030 int n = sscanf(versionString, "%d.%d", &major, &minor);
twiz@google.com0f31ca72011-03-18 17:38:11 +000031 if (2 == n) {
bsalomon@google.comc82b8892011-09-22 14:10:33 +000032 return GR_GL_VER(major, minor);
twiz@google.com59a190b2011-03-14 21:23:01 +000033 }
twiz@google.com0f31ca72011-03-18 17:38:11 +000034
twiz@google.com59a190b2011-03-14 21:23:01 +000035 char profile[2];
twiz@google.com0f31ca72011-03-18 17:38:11 +000036 n = sscanf(versionString, "OpenGL ES-%c%c %d.%d", profile, profile+1,
bsalomon@google.comc82b8892011-09-22 14:10:33 +000037 &major, &minor);
38 if (4 == n) {
39 return GR_GL_VER(major, minor);
40 }
41
42 n = sscanf(versionString, "OpenGL ES %d.%d", &major, &minor);
43 if (2 == n) {
44 return GR_GL_VER(major, minor);
twiz@google.com59a190b2011-03-14 21:23:01 +000045 }
twiz@google.com0f31ca72011-03-18 17:38:11 +000046
bsalomon@google.comc82b8892011-09-22 14:10:33 +000047 return 0;
twiz@google.com59a190b2011-03-14 21:23:01 +000048}
49
bsalomon@google.comedfe1aa2011-09-29 14:40:26 +000050GrGLSLVersion GrGLGetGLSLVersionFromString(const char* versionString) {
51 if (NULL == versionString) {
52 GrAssert(!"NULL GLSL version string.");
53 return 0;
54 }
55
56 int major, minor;
57
58 int n = sscanf(versionString, "%d.%d", &major, &minor);
59 if (2 == n) {
60 return GR_GLSL_VER(major, minor);
61 }
62
63 n = sscanf(versionString, "OpenGL ES GLSL ES %d.%d", &major, &minor);
64 if (2 == n) {
65 return GR_GLSL_VER(major, minor);
66 }
67 return 0;
68}
69
bsalomon@google.comc82b8892011-09-22 14:10:33 +000070bool GrGLHasExtensionFromString(const char* ext, const char* extensionString) {
twiz@google.com59a190b2011-03-14 21:23:01 +000071 int extLength = strlen(ext);
72
73 while (true) {
74 int n = strcspn(extensionString, " ");
75 if (n == extLength && 0 == strncmp(ext, extensionString, n)) {
76 return true;
77 }
78 if (0 == extensionString[n]) {
79 return false;
80 }
81 extensionString += n+1;
82 }
83
84 return false;
85}
86
bsalomon@google.comc82b8892011-09-22 14:10:33 +000087bool GrGLHasExtension(const GrGLInterface* gl, const char* ext) {
bsalomon@google.comdca4aab2011-09-06 19:05:24 +000088 const GrGLubyte* glstr;
89 GR_GL_CALL_RET(gl, glstr, GetString(GR_GL_EXTENSIONS));
bsalomon@google.comc82b8892011-09-22 14:10:33 +000090 return GrGLHasExtensionFromString(ext, (const char*) glstr);
twiz@google.com59a190b2011-03-14 21:23:01 +000091}
92
bsalomon@google.comc82b8892011-09-22 14:10:33 +000093GrGLVersion GrGLGetVersion(const GrGLInterface* gl) {
bsalomon@google.comdca4aab2011-09-06 19:05:24 +000094 const GrGLubyte* v;
95 GR_GL_CALL_RET(gl, v, GetString(GR_GL_VERSION));
bsalomon@google.comc82b8892011-09-22 14:10:33 +000096 return GrGLGetVersionFromString((const char*) v);
bsalomon@google.com2c17fcd2011-07-06 17:47:02 +000097}
98
bsalomon@google.comedfe1aa2011-09-29 14:40:26 +000099GrGLSLVersion GrGLGetGLSLVersion(const GrGLInterface* gl) {
100 const GrGLubyte* v;
101 GR_GL_CALL_RET(gl, v, GetString(GR_GL_SHADING_LANGUAGE_VERSION));
102 return GrGLGetGLSLVersionFromString((const char*) v);
103}
104
bsalomon@google.com0b77d682011-08-19 13:28:54 +0000105GrGLInterface::GrGLInterface() {
106 fBindingsExported = (GrGLBinding)0;
107 fNPOTRenderTargetSupport = kProbe_GrGLCapability;
108 fMinRenderTargetHeight = kProbe_GrGLCapability;
109 fMinRenderTargetWidth = kProbe_GrGLCapability;
110
111 fActiveTexture = NULL;
112 fAttachShader = NULL;
113 fBindAttribLocation = NULL;
114 fBindBuffer = NULL;
bsalomon@google.combc5cf512011-09-21 16:21:07 +0000115 fBindFragDataLocation = NULL;
bsalomon@google.com0b77d682011-08-19 13:28:54 +0000116 fBindTexture = NULL;
117 fBlendColor = NULL;
118 fBlendFunc = NULL;
119 fBufferData = NULL;
120 fBufferSubData = NULL;
121 fClear = NULL;
122 fClearColor = NULL;
123 fClearStencil = NULL;
124 fClientActiveTexture = NULL;
125 fColor4ub = NULL;
126 fColorMask = NULL;
127 fColorPointer = NULL;
128 fCompileShader = NULL;
129 fCompressedTexImage2D = NULL;
130 fCreateProgram = NULL;
131 fCreateShader = NULL;
132 fCullFace = NULL;
133 fDeleteBuffers = NULL;
134 fDeleteProgram = NULL;
135 fDeleteShader = NULL;
136 fDeleteTextures = NULL;
137 fDepthMask = NULL;
138 fDisable = NULL;
139 fDisableClientState = NULL;
140 fDisableVertexAttribArray = NULL;
141 fDrawArrays = NULL;
142 fDrawBuffer = NULL;
143 fDrawBuffers = NULL;
144 fDrawElements = NULL;
145 fEnable = NULL;
146 fEnableClientState = NULL;
147 fEnableVertexAttribArray = NULL;
148 fFrontFace = NULL;
149 fGenBuffers = NULL;
150 fGenTextures = NULL;
151 fGetBufferParameteriv = NULL;
152 fGetError = NULL;
153 fGetIntegerv = NULL;
154 fGetProgramInfoLog = NULL;
155 fGetProgramiv = NULL;
156 fGetShaderInfoLog = NULL;
157 fGetShaderiv = NULL;
158 fGetString = NULL;
159 fGetTexLevelParameteriv = NULL;
160 fGetUniformLocation = NULL;
161 fLineWidth = NULL;
162 fLinkProgram = NULL;
163 fLoadMatrixf = NULL;
164 fMatrixMode = NULL;
165 fPixelStorei = NULL;
166 fPointSize = NULL;
167 fReadBuffer = NULL;
168 fReadPixels = NULL;
169 fScissor = NULL;
170 fShadeModel = NULL;
171 fShaderSource = NULL;
172 fStencilFunc = NULL;
173 fStencilFuncSeparate = NULL;
174 fStencilMask = NULL;
175 fStencilMaskSeparate = NULL;
176 fStencilOp = NULL;
177 fStencilOpSeparate = NULL;
178 fTexCoordPointer = NULL;
179 fTexEnvi = NULL;
180 fTexImage2D = NULL;
181 fTexParameteri = NULL;
182 fTexSubImage2D = NULL;
183 fUniform1f = NULL;
184 fUniform1i = NULL;
185 fUniform1fv = NULL;
186 fUniform1iv = NULL;
187 fUniform2f = NULL;
188 fUniform2i = NULL;
189 fUniform2fv = NULL;
190 fUniform2iv = NULL;
191 fUniform3f = NULL;
192 fUniform3i = NULL;
193 fUniform3fv = NULL;
194 fUniform3iv = NULL;
195 fUniform4f = NULL;
196 fUniform4i = NULL;
197 fUniform4fv = NULL;
198 fUniform4iv = NULL;
199 fUniformMatrix2fv = NULL;
200 fUniformMatrix3fv = NULL;
201 fUniformMatrix4fv = NULL;
202 fUseProgram = NULL;
203 fVertexAttrib4fv = NULL;
204 fVertexAttribPointer = NULL;
205 fVertexPointer = NULL;
206 fViewport = NULL;
207 fBindFramebuffer = NULL;
208 fBindRenderbuffer = NULL;
209 fCheckFramebufferStatus = NULL;
210 fDeleteFramebuffers = NULL;
211 fDeleteRenderbuffers = NULL;
212 fFramebufferRenderbuffer = NULL;
213 fFramebufferTexture2D = NULL;
214 fGenFramebuffers = NULL;
215 fGenRenderbuffers = NULL;
216 fGetFramebufferAttachmentParameteriv = NULL;
217 fGetRenderbufferParameteriv = NULL;
218 fRenderbufferStorage = NULL;
219 fRenderbufferStorageMultisample = NULL;
220 fBlitFramebuffer = NULL;
221 fResolveMultisampleFramebuffer = NULL;
222 fMapBuffer = NULL;
223 fUnmapBuffer = NULL;
224 fBindFragDataLocationIndexed = NULL;
bsalomon@google.com56bfc5a2011-09-01 13:28:16 +0000225
226#if GR_GL_PER_GL_FUNC_CALLBACK
227 fCallback = GrGLDefaultInterfaceCallback;
228 fCallbackData = 0;
229#endif
bsalomon@google.com0b77d682011-08-19 13:28:54 +0000230}
231
232
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000233bool GrGLInterface::validateShaderFunctions() const {
234 // required for GrGpuGLShaders
235 if (NULL == fAttachShader ||
236 NULL == fBindAttribLocation ||
237 NULL == fCompileShader ||
238 NULL == fCreateProgram ||
239 NULL == fCreateShader ||
240 NULL == fDeleteProgram ||
241 NULL == fDeleteShader ||
242 NULL == fDisableVertexAttribArray ||
243 NULL == fEnableVertexAttribArray ||
244 NULL == fGetProgramInfoLog ||
245 NULL == fGetProgramiv ||
246 NULL == fGetShaderInfoLog ||
247 NULL == fGetShaderiv ||
248 NULL == fGetUniformLocation ||
249 NULL == fLinkProgram ||
250 NULL == fShaderSource ||
251 NULL == fUniform1f ||
252 NULL == fUniform1i ||
253 NULL == fUniform1fv ||
254 NULL == fUniform1iv ||
255 NULL == fUniform2f ||
256 NULL == fUniform2i ||
257 NULL == fUniform2fv ||
258 NULL == fUniform2iv ||
259 NULL == fUniform3f ||
260 NULL == fUniform3i ||
261 NULL == fUniform3fv ||
262 NULL == fUniform3iv ||
263 NULL == fUniform4f ||
264 NULL == fUniform4i ||
265 NULL == fUniform4fv ||
266 NULL == fUniform4iv ||
267 NULL == fUniformMatrix2fv ||
268 NULL == fUniformMatrix3fv ||
269 NULL == fUniformMatrix4fv ||
270 NULL == fUseProgram ||
271 NULL == fVertexAttrib4fv ||
272 NULL == fVertexAttribPointer) {
273 return false;
274 }
275 return true;
276}
277
278bool GrGLInterface::validateFixedFunctions() const {
279 if (NULL == fClientActiveTexture ||
280 NULL == fColor4ub ||
281 NULL == fColorPointer ||
282 NULL == fDisableClientState ||
283 NULL == fEnableClientState ||
284 NULL == fLoadMatrixf ||
285 NULL == fMatrixMode ||
286 NULL == fPointSize ||
287 NULL == fShadeModel ||
288 NULL == fTexCoordPointer ||
bsalomon@google.com4b9b6a22011-05-04 15:01:16 +0000289 NULL == fTexEnvi ||
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000290 NULL == fVertexPointer) {
291 return false;
292 }
293 return true;
294}
295
296bool GrGLInterface::validate(GrEngine engine) const {
297
bsalomon@google.com0b77d682011-08-19 13:28:54 +0000298 bool isDesktop = this->supportsDesktop();
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000299
bsalomon@google.com0b77d682011-08-19 13:28:54 +0000300 bool isES = this->supportsES();
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000301
bsalomon@google.com0b77d682011-08-19 13:28:54 +0000302 if (isDesktop == isES) {
303 // must have one, don't support both in same interface
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000304 return false;
305 }
306
307 // functions that are always required
308 if (NULL == fActiveTexture ||
309 NULL == fBindBuffer ||
310 NULL == fBindTexture ||
311 NULL == fBlendFunc ||
312 NULL == fBufferData ||
313 NULL == fBufferSubData ||
314 NULL == fClear ||
315 NULL == fClearColor ||
316 NULL == fClearStencil ||
317 NULL == fColorMask ||
318 NULL == fCullFace ||
319 NULL == fDeleteBuffers ||
320 NULL == fDeleteTextures ||
321 NULL == fDepthMask ||
322 NULL == fDisable ||
323 NULL == fDrawArrays ||
324 NULL == fDrawElements ||
325 NULL == fEnable ||
326 NULL == fFrontFace ||
327 NULL == fGenBuffers ||
328 NULL == fGenTextures ||
329 NULL == fGetBufferParameteriv ||
330 NULL == fGetError ||
331 NULL == fGetIntegerv ||
332 NULL == fGetString ||
333 NULL == fPixelStorei ||
334 NULL == fReadPixels ||
335 NULL == fScissor ||
336 NULL == fStencilFunc ||
337 NULL == fStencilMask ||
338 NULL == fStencilOp ||
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000339 NULL == fTexImage2D ||
340 NULL == fTexParameteri ||
341 NULL == fTexSubImage2D ||
342 NULL == fViewport ||
343 NULL == fBindFramebuffer ||
344 NULL == fBindRenderbuffer ||
345 NULL == fCheckFramebufferStatus ||
346 NULL == fDeleteFramebuffers ||
347 NULL == fDeleteRenderbuffers ||
bsalomon@google.com373a6632011-10-19 20:43:20 +0000348 NULL == fFinish ||
349 NULL == fFlush ||
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000350 NULL == fFramebufferRenderbuffer ||
351 NULL == fFramebufferTexture2D ||
bsalomon@google.comcee661a2011-07-26 12:32:36 +0000352 NULL == fGetFramebufferAttachmentParameteriv ||
353 NULL == fGetRenderbufferParameteriv ||
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000354 NULL == fGenFramebuffers ||
355 NULL == fGenRenderbuffers ||
356 NULL == fRenderbufferStorage) {
357 return false;
358 }
359
360 switch (engine) {
361 case kOpenGL_Shaders_GrEngine:
362 if (kES1_GrGLBinding == fBindingsExported) {
363 return false;
364 }
365 if (!this->validateShaderFunctions()) {
366 return false;
367 }
368 break;
369 case kOpenGL_Fixed_GrEngine:
370 if (kES1_GrGLBinding == fBindingsExported) {
371 return false;
372 }
373 if (!this->validateFixedFunctions()) {
374 return false;
375 }
376 break;
377 default:
378 return false;
379 }
380
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000381 const char* ext;
bsalomon@google.comc82b8892011-09-22 14:10:33 +0000382 GrGLVersion glVer = GrGLGetVersion(this);
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000383 ext = (const char*)fGetString(GR_GL_EXTENSIONS);
384
385 // Now check that baseline ES/Desktop fns not covered above are present
386 // and that we have fn pointers for any advertised extensions that we will
387 // try to use.
388
389 // these functions are part of ES2, we assume they are available
390 // On the desktop we assume they are available if the extension
391 // is present or GL version is high enough.
392 if ((kES2_GrGLBinding & fBindingsExported)) {
393 if (NULL == fBlendColor ||
394 NULL == fStencilFuncSeparate ||
395 NULL == fStencilMaskSeparate ||
396 NULL == fStencilOpSeparate) {
397 return false;
398 }
399 } else if (kDesktop_GrGLBinding == fBindingsExported) {
bsalomon@google.comc82b8892011-09-22 14:10:33 +0000400 if (glVer >= GR_GL_VER(2,0)) {
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000401 if (NULL == fStencilFuncSeparate ||
402 NULL == fStencilMaskSeparate ||
403 NULL == fStencilOpSeparate) {
404 return false;
405 }
406 }
bsalomon@google.comc82b8892011-09-22 14:10:33 +0000407 if (glVer >= GR_GL_VER(3,0) && NULL == fBindFragDataLocation) {
bsalomon@google.combc5cf512011-09-21 16:21:07 +0000408 return false;
409 }
bsalomon@google.comc82b8892011-09-22 14:10:33 +0000410 if (glVer >= GR_GL_VER(2,0) ||
411 GrGLHasExtensionFromString("GL_ARB_draw_buffers", ext)) {
bsalomon@google.comd32c5f52011-08-02 19:29:03 +0000412 if (NULL == fDrawBuffers) {
413 return false;
414 }
415 }
bsalomon@google.comc82b8892011-09-22 14:10:33 +0000416 if (glVer >= GR_GL_VER(1,4) ||
417 GrGLHasExtensionFromString("GL_EXT_blend_color", ext)) {
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000418 if (NULL == fBlendColor) {
419 return false;
420 }
421 }
bsalomon@google.com373a6632011-10-19 20:43:20 +0000422 if (glVer >= GR_GL_VER(1,5) ||
423 GrGLHasExtensionFromString("GL_ARB_occlusion_query", ext)) {
424 if (NULL == fGenQueries ||
425 NULL == fDeleteQueries ||
426 NULL == fBeginQuery ||
427 NULL == fEndQuery ||
428 NULL == fGetQueryiv ||
429 NULL == fGetQueryObjectiv ||
430 NULL == fGetQueryObjectuiv) {
431 return false;
432 }
433 }
434 if (glVer >= GR_GL_VER(3,3) ||
435 GrGLHasExtensionFromString("GL_ARB_timer_query", ext) ||
436 GrGLHasExtensionFromString("GL_EXT_timer_query", ext)) {
437 if (NULL == fGetQueryObjecti64v ||
438 NULL == fGetQueryObjectui64v) {
439 return false;
440 }
441 }
442 if (glVer >= GR_GL_VER(3,3) ||
443 GrGLHasExtensionFromString("GL_ARB_timer_query", ext)) {
444 if (NULL == fQueryCounter) {
445 return false;
446 }
447 }
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000448 }
449
450 // optional function on desktop before 1.3
451 if (kDesktop_GrGLBinding != fBindingsExported ||
bsalomon@google.comc82b8892011-09-22 14:10:33 +0000452 (glVer >= GR_GL_VER(1,3) ||
453 GrGLHasExtensionFromString("GL_ARB_texture_compression", ext))) {
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000454 if (NULL == fCompressedTexImage2D) {
455 return false;
456 }
457 }
458
bsalomon@google.comd32c5f52011-08-02 19:29:03 +0000459 // part of desktop GL, but not ES
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000460 if (kDesktop_GrGLBinding == fBindingsExported &&
bsalomon@google.comcee661a2011-07-26 12:32:36 +0000461 (NULL == fLineWidth ||
bsalomon@google.comd32c5f52011-08-02 19:29:03 +0000462 NULL == fGetTexLevelParameteriv ||
bsalomon@google.comc49d66b2011-08-03 14:22:30 +0000463 NULL == fDrawBuffer ||
464 NULL == fReadBuffer)) {
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000465 return false;
466 }
bsalomon@google.comcee661a2011-07-26 12:32:36 +0000467
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000468 // FBO MSAA
469 if (kDesktop_GrGLBinding == fBindingsExported) {
470 // GL 3.0 and the ARB extension have multisample + blit
bsalomon@google.comc82b8892011-09-22 14:10:33 +0000471 if (glVer >= GR_GL_VER(3,0) || GrGLHasExtensionFromString("GL_ARB_framebuffer_object", ext)) {
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000472 if (NULL == fRenderbufferStorageMultisample ||
473 NULL == fBlitFramebuffer) {
474 return false;
475 }
476 } else {
bsalomon@google.comc82b8892011-09-22 14:10:33 +0000477 if (GrGLHasExtensionFromString("GL_EXT_framebuffer_blit", ext) &&
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000478 NULL == fBlitFramebuffer) {
479 return false;
480 }
bsalomon@google.comc82b8892011-09-22 14:10:33 +0000481 if (GrGLHasExtensionFromString("GL_EXT_framebuffer_multisample", ext) &&
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000482 NULL == fRenderbufferStorageMultisample) {
483 return false;
484 }
485 }
486 } else {
bsalomon@google.comc82b8892011-09-22 14:10:33 +0000487 if (GrGLHasExtensionFromString("GL_CHROMIUM_framebuffer_multisample", ext)) {
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000488 if (NULL == fRenderbufferStorageMultisample ||
489 NULL == fBlitFramebuffer) {
490 return false;
491 }
492 }
bsalomon@google.comc82b8892011-09-22 14:10:33 +0000493 if (GrGLHasExtensionFromString("GL_APPLE_framebuffer_multisample", ext)) {
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000494 if (NULL == fRenderbufferStorageMultisample ||
495 NULL == fResolveMultisampleFramebuffer) {
496 return false;
497 }
498 }
499 }
500
501 // On ES buffer mapping is an extension. On Desktop
502 // buffer mapping was part of original VBO extension
503 // which we require.
504 if (kDesktop_GrGLBinding == fBindingsExported ||
bsalomon@google.comc82b8892011-09-22 14:10:33 +0000505 GrGLHasExtensionFromString("GL_OES_mapbuffer", ext)) {
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000506 if (NULL == fMapBuffer ||
507 NULL == fUnmapBuffer) {
508 return false;
509 }
510 }
511
bsalomon@google.com271cffc2011-05-20 14:13:56 +0000512 // Dual source blending
513 if (kDesktop_GrGLBinding == fBindingsExported &&
bsalomon@google.comc82b8892011-09-22 14:10:33 +0000514 (glVer >= GR_GL_VER(3,3) ||
515 GrGLHasExtensionFromString("GL_ARB_blend_func_extended", ext))) {
bsalomon@google.com271cffc2011-05-20 14:13:56 +0000516 if (NULL == fBindFragDataLocationIndexed) {
517 return false;
518 }
519 }
520
bsalomon@google.combf2a4692011-05-04 12:35:39 +0000521 return true;
522}
523