twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 1 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 2 | * 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.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | |
tomhudson@google.com | 6bf38b5 | 2012-02-14 15:11:59 +0000 | [diff] [blame] | 9 | #include "gl/GrGLInterface.h" |
bsalomon@google.com | 1744f97 | 2013-02-26 21:46:32 +0000 | [diff] [blame] | 10 | #include "gl/GrGLExtensions.h" |
| 11 | #include "gl/GrGLUtil.h" |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 12 | |
| 13 | #include <stdio.h> |
| 14 | |
commit-bot@chromium.org | a3baf3b | 2014-02-21 18:45:30 +0000 | [diff] [blame] | 15 | const GrGLInterface* GrGLInterfaceAddTestDebugMarker(const GrGLInterface* interface, |
| 16 | GrGLInsertEventMarkerProc insertEventMarkerFn, |
| 17 | GrGLPushGroupMarkerProc pushGroupMarkerFn, |
| 18 | GrGLPopGroupMarkerProc popGroupMarkerFn) { |
| 19 | GrGLInterface* newInterface = GrGLInterface::NewClone(interface); |
| 20 | |
| 21 | if (!newInterface->fExtensions.has("GL_EXT_debug_marker")) { |
| 22 | newInterface->fExtensions.add("GL_EXT_debug_marker"); |
| 23 | } |
| 24 | |
commit-bot@chromium.org | f535561 | 2014-02-28 20:28:50 +0000 | [diff] [blame] | 25 | newInterface->fFunctions.fInsertEventMarker = insertEventMarkerFn; |
| 26 | newInterface->fFunctions.fPushGroupMarker = pushGroupMarkerFn; |
| 27 | newInterface->fFunctions.fPopGroupMarker = popGroupMarkerFn; |
commit-bot@chromium.org | a3baf3b | 2014-02-21 18:45:30 +0000 | [diff] [blame] | 28 | |
| 29 | return newInterface; |
| 30 | } |
| 31 | |
commit-bot@chromium.org | f535561 | 2014-02-28 20:28:50 +0000 | [diff] [blame] | 32 | GrGLInterface::GrGLInterface() { |
commit-bot@chromium.org | 9e90aed | 2014-01-16 16:35:09 +0000 | [diff] [blame] | 33 | fStandard = kNone_GrGLStandard; |
bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 34 | } |
| 35 | |
commit-bot@chromium.org | d8ed851 | 2014-01-24 20:49:44 +0000 | [diff] [blame] | 36 | GrGLInterface* GrGLInterface::NewClone(const GrGLInterface* interface) { |
bsalomon | 49f085d | 2014-09-05 13:34:00 -0700 | [diff] [blame] | 37 | SkASSERT(interface); |
commit-bot@chromium.org | d8ed851 | 2014-01-24 20:49:44 +0000 | [diff] [blame] | 38 | |
halcanary | 385fe4d | 2015-08-26 13:07:48 -0700 | [diff] [blame] | 39 | GrGLInterface* clone = new GrGLInterface; |
commit-bot@chromium.org | d8ed851 | 2014-01-24 20:49:44 +0000 | [diff] [blame] | 40 | clone->fStandard = interface->fStandard; |
| 41 | clone->fExtensions = interface->fExtensions; |
| 42 | clone->fFunctions = interface->fFunctions; |
commit-bot@chromium.org | d8ed851 | 2014-01-24 20:49:44 +0000 | [diff] [blame] | 43 | return clone; |
| 44 | } |
| 45 | |
commit-bot@chromium.org | e83b9b7 | 2014-05-01 19:21:41 +0000 | [diff] [blame] | 46 | #ifdef SK_DEBUG |
| 47 | static int kIsDebug = 1; |
| 48 | #else |
| 49 | static int kIsDebug = 0; |
| 50 | #endif |
| 51 | |
| 52 | #define RETURN_FALSE_INTERFACE \ |
| 53 | if (kIsDebug) { SkDebugf("%s:%d GrGLInterface::validate() failed.\n", __FILE__, __LINE__); } \ |
| 54 | return false; |
commit-bot@chromium.org | adadf7c | 2014-03-24 19:43:02 +0000 | [diff] [blame] | 55 | |
commit-bot@chromium.org | 9e90aed | 2014-01-16 16:35:09 +0000 | [diff] [blame] | 56 | bool GrGLInterface::validate() const { |
bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 57 | |
commit-bot@chromium.org | 9e90aed | 2014-01-16 16:35:09 +0000 | [diff] [blame] | 58 | if (kNone_GrGLStandard == fStandard) { |
commit-bot@chromium.org | adadf7c | 2014-03-24 19:43:02 +0000 | [diff] [blame] | 59 | RETURN_FALSE_INTERFACE |
bsalomon@google.com | 1dcf506 | 2011-11-14 19:29:53 +0000 | [diff] [blame] | 60 | } |
skia.committer@gmail.com | 12eea2b | 2013-02-27 07:10:10 +0000 | [diff] [blame] | 61 | |
commit-bot@chromium.org | 90313cc | 2014-01-17 15:05:38 +0000 | [diff] [blame] | 62 | if (!fExtensions.isInitialized()) { |
commit-bot@chromium.org | adadf7c | 2014-03-24 19:43:02 +0000 | [diff] [blame] | 63 | RETURN_FALSE_INTERFACE |
bsalomon@google.com | 1744f97 | 2013-02-26 21:46:32 +0000 | [diff] [blame] | 64 | } |
bsalomon@google.com | 1dcf506 | 2011-11-14 19:29:53 +0000 | [diff] [blame] | 65 | |
| 66 | // functions that are always required |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 67 | if (!fFunctions.fActiveTexture || |
| 68 | !fFunctions.fAttachShader || |
| 69 | !fFunctions.fBindAttribLocation || |
| 70 | !fFunctions.fBindBuffer || |
| 71 | !fFunctions.fBindTexture || |
| 72 | !fFunctions.fBlendColor || // -> GL >= 1.4 or extension, ES >= 2.0 |
| 73 | !fFunctions.fBlendEquation || // -> GL >= 1.4 or extension, ES >= 2.0 |
| 74 | !fFunctions.fBlendFunc || |
| 75 | !fFunctions.fBufferData || |
| 76 | !fFunctions.fBufferSubData || |
| 77 | !fFunctions.fClear || |
| 78 | !fFunctions.fClearColor || |
| 79 | !fFunctions.fClearStencil || |
| 80 | !fFunctions.fColorMask || |
| 81 | !fFunctions.fCompileShader || |
| 82 | !fFunctions.fCompressedTexImage2D || |
| 83 | !fFunctions.fCompressedTexSubImage2D || |
| 84 | !fFunctions.fCopyTexSubImage2D || |
| 85 | !fFunctions.fCreateProgram || |
| 86 | !fFunctions.fCreateShader || |
| 87 | !fFunctions.fCullFace || |
| 88 | !fFunctions.fDeleteBuffers || |
| 89 | !fFunctions.fDeleteProgram || |
| 90 | !fFunctions.fDeleteShader || |
| 91 | !fFunctions.fDeleteTextures || |
| 92 | !fFunctions.fDepthMask || |
| 93 | !fFunctions.fDisable || |
| 94 | !fFunctions.fDisableVertexAttribArray || |
| 95 | !fFunctions.fDrawArrays || |
| 96 | !fFunctions.fDrawElements || |
| 97 | !fFunctions.fEnable || |
| 98 | !fFunctions.fEnableVertexAttribArray || |
| 99 | !fFunctions.fFrontFace || |
| 100 | !fFunctions.fGenBuffers || |
| 101 | !fFunctions.fGenTextures || |
| 102 | !fFunctions.fGetBufferParameteriv || |
| 103 | !fFunctions.fGenerateMipmap || |
| 104 | !fFunctions.fGetError || |
| 105 | !fFunctions.fGetIntegerv || |
| 106 | !fFunctions.fGetProgramInfoLog || |
| 107 | !fFunctions.fGetProgramiv || |
| 108 | !fFunctions.fGetShaderInfoLog || |
| 109 | !fFunctions.fGetShaderiv || |
| 110 | !fFunctions.fGetString || |
| 111 | !fFunctions.fGetUniformLocation || |
| 112 | !fFunctions.fIsTexture || |
| 113 | !fFunctions.fLinkProgram || |
| 114 | !fFunctions.fLineWidth || |
| 115 | !fFunctions.fPixelStorei || |
| 116 | !fFunctions.fReadPixels || |
| 117 | !fFunctions.fScissor || |
| 118 | !fFunctions.fShaderSource || |
| 119 | !fFunctions.fStencilFunc || |
| 120 | !fFunctions.fStencilFuncSeparate || |
| 121 | !fFunctions.fStencilMask || |
| 122 | !fFunctions.fStencilMaskSeparate || |
| 123 | !fFunctions.fStencilOp || |
| 124 | !fFunctions.fStencilOpSeparate || |
| 125 | !fFunctions.fTexImage2D || |
| 126 | !fFunctions.fTexParameteri || |
| 127 | !fFunctions.fTexParameteriv || |
| 128 | !fFunctions.fTexSubImage2D || |
| 129 | !fFunctions.fUniform1f || |
| 130 | !fFunctions.fUniform1i || |
| 131 | !fFunctions.fUniform1fv || |
| 132 | !fFunctions.fUniform1iv || |
| 133 | !fFunctions.fUniform2f || |
| 134 | !fFunctions.fUniform2i || |
| 135 | !fFunctions.fUniform2fv || |
| 136 | !fFunctions.fUniform2iv || |
| 137 | !fFunctions.fUniform3f || |
| 138 | !fFunctions.fUniform3i || |
| 139 | !fFunctions.fUniform3fv || |
| 140 | !fFunctions.fUniform3iv || |
| 141 | !fFunctions.fUniform4f || |
| 142 | !fFunctions.fUniform4i || |
| 143 | !fFunctions.fUniform4fv || |
| 144 | !fFunctions.fUniform4iv || |
| 145 | !fFunctions.fUniformMatrix2fv || |
| 146 | !fFunctions.fUniformMatrix3fv || |
| 147 | !fFunctions.fUniformMatrix4fv || |
| 148 | !fFunctions.fUseProgram || |
| 149 | !fFunctions.fVertexAttrib1f || |
| 150 | !fFunctions.fVertexAttrib2fv || |
| 151 | !fFunctions.fVertexAttrib3fv || |
| 152 | !fFunctions.fVertexAttrib4fv || |
| 153 | !fFunctions.fVertexAttribPointer || |
| 154 | !fFunctions.fViewport || |
| 155 | !fFunctions.fBindFramebuffer || |
| 156 | !fFunctions.fBindRenderbuffer || |
| 157 | !fFunctions.fCheckFramebufferStatus || |
| 158 | !fFunctions.fDeleteFramebuffers || |
| 159 | !fFunctions.fDeleteRenderbuffers || |
| 160 | !fFunctions.fFinish || |
| 161 | !fFunctions.fFlush || |
| 162 | !fFunctions.fFramebufferRenderbuffer || |
| 163 | !fFunctions.fFramebufferTexture2D || |
| 164 | !fFunctions.fGetFramebufferAttachmentParameteriv || |
| 165 | !fFunctions.fGetRenderbufferParameteriv || |
| 166 | !fFunctions.fGenFramebuffers || |
| 167 | !fFunctions.fGenRenderbuffers || |
| 168 | !fFunctions.fRenderbufferStorage) { |
commit-bot@chromium.org | adadf7c | 2014-03-24 19:43:02 +0000 | [diff] [blame] | 169 | RETURN_FALSE_INTERFACE |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 170 | } |
| 171 | |
bsalomon@google.com | c82b889 | 2011-09-22 14:10:33 +0000 | [diff] [blame] | 172 | GrGLVersion glVer = GrGLGetVersion(this); |
commit-bot@chromium.org | f4e67e3 | 2014-04-30 01:26:04 +0000 | [diff] [blame] | 173 | if (GR_GL_INVALID_VER == glVer) { |
| 174 | RETURN_FALSE_INTERFACE |
| 175 | } |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 176 | |
| 177 | // Now check that baseline ES/Desktop fns not covered above are present |
commit-bot@chromium.org | 90313cc | 2014-01-17 15:05:38 +0000 | [diff] [blame] | 178 | // and that we have fn pointers for any advertised fExtensions that we will |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 179 | // try to use. |
| 180 | |
| 181 | // these functions are part of ES2, we assume they are available |
| 182 | // On the desktop we assume they are available if the extension |
| 183 | // is present or GL version is high enough. |
Brian Salomon | f086167 | 2017-05-08 11:10:10 -0400 | [diff] [blame] | 184 | if (kGL_GrGLStandard == fStandard) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 185 | if (glVer >= GR_GL_VER(3,0) && !fFunctions.fBindFragDataLocation) { |
commit-bot@chromium.org | adadf7c | 2014-03-24 19:43:02 +0000 | [diff] [blame] | 186 | RETURN_FALSE_INTERFACE |
bsalomon@google.com | bc5cf51 | 2011-09-21 16:21:07 +0000 | [diff] [blame] | 187 | } |
robertphillips@google.com | e788430 | 2012-04-18 14:39:58 +0000 | [diff] [blame] | 188 | |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 189 | if (glVer >= GR_GL_VER(3,3) || |
commit-bot@chromium.org | 90313cc | 2014-01-17 15:05:38 +0000 | [diff] [blame] | 190 | fExtensions.has("GL_ARB_timer_query") || |
| 191 | fExtensions.has("GL_EXT_timer_query")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 192 | if (!fFunctions.fGetQueryObjecti64v || |
| 193 | !fFunctions.fGetQueryObjectui64v) { |
commit-bot@chromium.org | adadf7c | 2014-03-24 19:43:02 +0000 | [diff] [blame] | 194 | RETURN_FALSE_INTERFACE |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 195 | } |
| 196 | } |
commit-bot@chromium.org | 90313cc | 2014-01-17 15:05:38 +0000 | [diff] [blame] | 197 | if (glVer >= GR_GL_VER(3,3) || fExtensions.has("GL_ARB_timer_query")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 198 | if (!fFunctions.fQueryCounter) { |
commit-bot@chromium.org | adadf7c | 2014-03-24 19:43:02 +0000 | [diff] [blame] | 199 | RETURN_FALSE_INTERFACE |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 200 | } |
| 201 | } |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 202 | } |
| 203 | |
Brian Salomon | 15b2509 | 2017-05-08 11:10:53 -0400 | [diff] [blame] | 204 | // part of desktop GL, but not ES |
| 205 | if (kGL_GrGLStandard == fStandard && |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 206 | (!fFunctions.fDrawBuffer || |
| 207 | !fFunctions.fPolygonMode)) { |
Brian Salomon | 15b2509 | 2017-05-08 11:10:53 -0400 | [diff] [blame] | 208 | RETURN_FALSE_INTERFACE |
| 209 | } |
| 210 | |
| 211 | // ES 3.0 (or ES 2.0 extended) has glDrawBuffers but not glDrawBuffer |
| 212 | if (kGL_GrGLStandard == fStandard || glVer >= GR_GL_VER(3,0)) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 213 | if (!fFunctions.fDrawBuffers) { |
commit-bot@chromium.org | adadf7c | 2014-03-24 19:43:02 +0000 | [diff] [blame] | 214 | RETURN_FALSE_INTERFACE |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 215 | } |
| 216 | } |
| 217 | |
Brian Salomon | 15b2509 | 2017-05-08 11:10:53 -0400 | [diff] [blame] | 218 | if (kGL_GrGLStandard == fStandard || glVer >= GR_GL_VER(3,0)) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 219 | if (!fFunctions.fReadBuffer) { |
Brian Salomon | 15b2509 | 2017-05-08 11:10:53 -0400 | [diff] [blame] | 220 | RETURN_FALSE_INTERFACE |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | // glGetTexLevelParameteriv was added to ES in 3.1. |
| 225 | if (kGL_GrGLStandard == fStandard || glVer >= GR_GL_VER(3,1)) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 226 | if (!fFunctions.fGetTexLevelParameteriv) { |
Brian Salomon | 15b2509 | 2017-05-08 11:10:53 -0400 | [diff] [blame] | 227 | RETURN_FALSE_INTERFACE |
| 228 | } |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 229 | } |
bsalomon@google.com | cee661a | 2011-07-26 12:32:36 +0000 | [diff] [blame] | 230 | |
bsalomon@google.com | 280e99f | 2012-01-05 16:17:38 +0000 | [diff] [blame] | 231 | // GL_EXT_texture_storage is part of desktop 4.2 |
| 232 | // There is a desktop ARB extension and an ES+desktop EXT extension |
commit-bot@chromium.org | 9e90aed | 2014-01-16 16:35:09 +0000 | [diff] [blame] | 233 | if (kGL_GrGLStandard == fStandard) { |
bsalomon@google.com | baa9ea1 | 2012-01-06 19:05:43 +0000 | [diff] [blame] | 234 | if (glVer >= GR_GL_VER(4,2) || |
commit-bot@chromium.org | 90313cc | 2014-01-17 15:05:38 +0000 | [diff] [blame] | 235 | fExtensions.has("GL_ARB_texture_storage") || |
| 236 | fExtensions.has("GL_EXT_texture_storage")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 237 | if (!fFunctions.fTexStorage2D) { |
commit-bot@chromium.org | adadf7c | 2014-03-24 19:43:02 +0000 | [diff] [blame] | 238 | RETURN_FALSE_INTERFACE |
bsalomon@google.com | baa9ea1 | 2012-01-06 19:05:43 +0000 | [diff] [blame] | 239 | } |
| 240 | } |
commit-bot@chromium.org | 90313cc | 2014-01-17 15:05:38 +0000 | [diff] [blame] | 241 | } else if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_texture_storage")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 242 | if (!fFunctions.fTexStorage2D) { |
kkinnunen | f655e93 | 2016-03-03 07:39:48 -0800 | [diff] [blame] | 243 | RETURN_FALSE_INTERFACE |
bsalomon@google.com | baa9ea1 | 2012-01-06 19:05:43 +0000 | [diff] [blame] | 244 | } |
bsalomon@google.com | 280e99f | 2012-01-05 16:17:38 +0000 | [diff] [blame] | 245 | } |
| 246 | |
cdalton | fd4167d | 2015-04-21 11:45:56 -0700 | [diff] [blame] | 247 | // glTextureBarrier is part of desktop 4.5. There are also ARB and NV extensions. |
| 248 | if (kGL_GrGLStandard == fStandard) { |
| 249 | if (glVer >= GR_GL_VER(4,5) || |
| 250 | fExtensions.has("GL_ARB_texture_barrier") || |
| 251 | fExtensions.has("GL_NV_texture_barrier")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 252 | if (!fFunctions.fTextureBarrier) { |
cdalton | fd4167d | 2015-04-21 11:45:56 -0700 | [diff] [blame] | 253 | RETURN_FALSE_INTERFACE |
| 254 | } |
| 255 | } |
| 256 | } else if (fExtensions.has("GL_NV_texture_barrier")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 257 | if (!fFunctions.fTextureBarrier) { |
cdalton | fd4167d | 2015-04-21 11:45:56 -0700 | [diff] [blame] | 258 | RETURN_FALSE_INTERFACE |
| 259 | } |
| 260 | } |
| 261 | |
cdalton | bae6f6c | 2015-04-22 10:39:03 -0700 | [diff] [blame] | 262 | if (fExtensions.has("GL_KHR_blend_equation_advanced") || |
| 263 | fExtensions.has("GL_NV_blend_equation_advanced")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 264 | if (!fFunctions.fBlendBarrier) { |
cdalton | bae6f6c | 2015-04-22 10:39:03 -0700 | [diff] [blame] | 265 | RETURN_FALSE_INTERFACE |
| 266 | } |
| 267 | } |
| 268 | |
commit-bot@chromium.org | 90313cc | 2014-01-17 15:05:38 +0000 | [diff] [blame] | 269 | if (fExtensions.has("GL_EXT_discard_framebuffer")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 270 | if (!fFunctions.fDiscardFramebuffer) { |
commit-bot@chromium.org | adadf7c | 2014-03-24 19:43:02 +0000 | [diff] [blame] | 271 | RETURN_FALSE_INTERFACE |
robertphillips@google.com | a6ffb58 | 2013-04-29 16:50:17 +0000 | [diff] [blame] | 272 | } |
robertphillips@google.com | a6ffb58 | 2013-04-29 16:50:17 +0000 | [diff] [blame] | 273 | } |
| 274 | |
Brian Salomon | 15b2509 | 2017-05-08 11:10:53 -0400 | [diff] [blame] | 275 | // Required since OpenGL 1.5 and ES 3.0 or with GL_EXT_occlusion_query_boolean |
| 276 | if (kGL_GrGLStandard == fStandard || glVer >= GR_GL_VER(3,0) || |
| 277 | fExtensions.has("GL_EXT_occlusion_query_boolean")) { |
| 278 | #if 0 // Not yet added to chrome's bindings. |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 279 | if (!fFunctions.fGenQueries || |
| 280 | !fFunctions.fDeleteQueries || |
| 281 | !fFunctions.fBeginQuery || |
| 282 | !fFunctions.fEndQuery || |
| 283 | !fFunctions.fGetQueryiv || |
| 284 | !fFunctions.fGetQueryObjectuiv) { |
Brian Salomon | 15b2509 | 2017-05-08 11:10:53 -0400 | [diff] [blame] | 285 | RETURN_FALSE_INTERFACE |
| 286 | } |
| 287 | #endif |
| 288 | } |
| 289 | // glGetQueryObjectiv doesn't exist in ES. |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 290 | if (kGL_GrGLStandard == fStandard && !fFunctions.fGetQueryObjectiv) { |
Brian Salomon | 15b2509 | 2017-05-08 11:10:53 -0400 | [diff] [blame] | 291 | RETURN_FALSE_INTERFACE |
| 292 | } |
| 293 | |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 294 | // FBO MSAA |
commit-bot@chromium.org | 9e90aed | 2014-01-16 16:35:09 +0000 | [diff] [blame] | 295 | if (kGL_GrGLStandard == fStandard) { |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 296 | // GL 3.0 and the ARB extension have multisample + blit |
commit-bot@chromium.org | 90313cc | 2014-01-17 15:05:38 +0000 | [diff] [blame] | 297 | if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_ARB_framebuffer_object")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 298 | if (!fFunctions.fRenderbufferStorageMultisample || |
| 299 | !fFunctions.fBlitFramebuffer) { |
commit-bot@chromium.org | adadf7c | 2014-03-24 19:43:02 +0000 | [diff] [blame] | 300 | RETURN_FALSE_INTERFACE |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 301 | } |
| 302 | } else { |
commit-bot@chromium.org | 90313cc | 2014-01-17 15:05:38 +0000 | [diff] [blame] | 303 | if (fExtensions.has("GL_EXT_framebuffer_blit") && |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 304 | !fFunctions.fBlitFramebuffer) { |
commit-bot@chromium.org | adadf7c | 2014-03-24 19:43:02 +0000 | [diff] [blame] | 305 | RETURN_FALSE_INTERFACE |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 306 | } |
commit-bot@chromium.org | 90313cc | 2014-01-17 15:05:38 +0000 | [diff] [blame] | 307 | if (fExtensions.has("GL_EXT_framebuffer_multisample") && |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 308 | !fFunctions.fRenderbufferStorageMultisample) { |
commit-bot@chromium.org | adadf7c | 2014-03-24 19:43:02 +0000 | [diff] [blame] | 309 | RETURN_FALSE_INTERFACE |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 310 | } |
| 311 | } |
| 312 | } else { |
commit-bot@chromium.org | 90313cc | 2014-01-17 15:05:38 +0000 | [diff] [blame] | 313 | if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_CHROMIUM_framebuffer_multisample")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 314 | if (!fFunctions.fRenderbufferStorageMultisample || |
| 315 | !fFunctions.fBlitFramebuffer) { |
commit-bot@chromium.org | adadf7c | 2014-03-24 19:43:02 +0000 | [diff] [blame] | 316 | RETURN_FALSE_INTERFACE |
commit-bot@chromium.org | a8e5a06 | 2013-09-05 23:44:09 +0000 | [diff] [blame] | 317 | } |
Brian Salomon | c5eceb0 | 2016-10-18 10:21:43 -0400 | [diff] [blame] | 318 | } else { |
| 319 | if (fExtensions.has("GL_ANGLE_framebuffer_multisample") && |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 320 | !fFunctions.fRenderbufferStorageMultisample) { |
Brian Salomon | c5eceb0 | 2016-10-18 10:21:43 -0400 | [diff] [blame] | 321 | RETURN_FALSE_INTERFACE |
| 322 | } |
| 323 | if (fExtensions.has("GL_ANGLE_framebuffer_blit") && |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 324 | !fFunctions.fBlitFramebuffer) { |
Brian Salomon | c5eceb0 | 2016-10-18 10:21:43 -0400 | [diff] [blame] | 325 | RETURN_FALSE_INTERFACE |
| 326 | } |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 327 | } |
commit-bot@chromium.org | 90313cc | 2014-01-17 15:05:38 +0000 | [diff] [blame] | 328 | if (fExtensions.has("GL_APPLE_framebuffer_multisample")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 329 | if (!fFunctions.fRenderbufferStorageMultisampleES2APPLE || |
| 330 | !fFunctions.fResolveMultisampleFramebuffer) { |
commit-bot@chromium.org | adadf7c | 2014-03-24 19:43:02 +0000 | [diff] [blame] | 331 | RETURN_FALSE_INTERFACE |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 332 | } |
| 333 | } |
commit-bot@chromium.org | 90313cc | 2014-01-17 15:05:38 +0000 | [diff] [blame] | 334 | if (fExtensions.has("GL_IMG_multisampled_render_to_texture") || |
| 335 | fExtensions.has("GL_EXT_multisampled_render_to_texture")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 336 | if (!fFunctions.fRenderbufferStorageMultisampleES2EXT || |
| 337 | !fFunctions.fFramebufferTexture2DMultisample) { |
commit-bot@chromium.org | adadf7c | 2014-03-24 19:43:02 +0000 | [diff] [blame] | 338 | RETURN_FALSE_INTERFACE |
bsalomon@google.com | f3a60c0 | 2013-03-19 19:06:09 +0000 | [diff] [blame] | 339 | } |
| 340 | } |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 341 | } |
| 342 | |
| 343 | // On ES buffer mapping is an extension. On Desktop |
| 344 | // buffer mapping was part of original VBO extension |
| 345 | // which we require. |
commit-bot@chromium.org | 90313cc | 2014-01-17 15:05:38 +0000 | [diff] [blame] | 346 | if (kGL_GrGLStandard == fStandard || fExtensions.has("GL_OES_mapbuffer")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 347 | if (!fFunctions.fMapBuffer || |
| 348 | !fFunctions.fUnmapBuffer) { |
commit-bot@chromium.org | adadf7c | 2014-03-24 19:43:02 +0000 | [diff] [blame] | 349 | RETURN_FALSE_INTERFACE |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 350 | } |
| 351 | } |
| 352 | |
bsalomon@google.com | 271cffc | 2011-05-20 14:13:56 +0000 | [diff] [blame] | 353 | // Dual source blending |
kkinnunen | d94708e | 2015-07-30 22:47:04 -0700 | [diff] [blame] | 354 | if (kGL_GrGLStandard == fStandard) { |
| 355 | if (glVer >= GR_GL_VER(3,3) || fExtensions.has("GL_ARB_blend_func_extended")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 356 | if (!fFunctions.fBindFragDataLocationIndexed) { |
kkinnunen | d94708e | 2015-07-30 22:47:04 -0700 | [diff] [blame] | 357 | RETURN_FALSE_INTERFACE |
| 358 | } |
| 359 | } |
| 360 | } else { |
| 361 | if (glVer >= GR_GL_VER(3,0) && fExtensions.has("GL_EXT_blend_func_extended")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 362 | if (!fFunctions.fBindFragDataLocation || |
| 363 | !fFunctions.fBindFragDataLocationIndexed) { |
kkinnunen | d94708e | 2015-07-30 22:47:04 -0700 | [diff] [blame] | 364 | RETURN_FALSE_INTERFACE |
| 365 | } |
bsalomon@google.com | 271cffc | 2011-05-20 14:13:56 +0000 | [diff] [blame] | 366 | } |
| 367 | } |
skia.committer@gmail.com | 12eea2b | 2013-02-27 07:10:10 +0000 | [diff] [blame] | 368 | |
kkinnunen | d94708e | 2015-07-30 22:47:04 -0700 | [diff] [blame] | 369 | |
commit-bot@chromium.org | 726e621 | 2013-08-23 20:55:46 +0000 | [diff] [blame] | 370 | // glGetStringi was added in version 3.0 of both desktop and ES. |
| 371 | if (glVer >= GR_GL_VER(3, 0)) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 372 | if (!fFunctions.fGetStringi) { |
commit-bot@chromium.org | adadf7c | 2014-03-24 19:43:02 +0000 | [diff] [blame] | 373 | RETURN_FALSE_INTERFACE |
bsalomon@google.com | 1744f97 | 2013-02-26 21:46:32 +0000 | [diff] [blame] | 374 | } |
| 375 | } |
bsalomon@google.com | 271cffc | 2011-05-20 14:13:56 +0000 | [diff] [blame] | 376 | |
cdalton | 793dc26 | 2016-02-08 10:11:47 -0800 | [diff] [blame] | 377 | // glVertexAttribIPointer was added in version 3.0 of both desktop and ES. |
| 378 | if (glVer >= GR_GL_VER(3, 0)) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 379 | if (!fFunctions.fVertexAttribIPointer) { |
cdalton | 793dc26 | 2016-02-08 10:11:47 -0800 | [diff] [blame] | 380 | RETURN_FALSE_INTERFACE |
| 381 | } |
| 382 | } |
| 383 | |
commit-bot@chromium.org | 9e90aed | 2014-01-16 16:35:09 +0000 | [diff] [blame] | 384 | if (kGL_GrGLStandard == fStandard) { |
cdalton | c04ce67 | 2016-03-11 14:07:38 -0800 | [diff] [blame] | 385 | if (glVer >= GR_GL_VER(3,1)) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 386 | if (!fFunctions.fTexBuffer) { |
cdalton | c04ce67 | 2016-03-11 14:07:38 -0800 | [diff] [blame] | 387 | RETURN_FALSE_INTERFACE; |
| 388 | } |
| 389 | } |
cdalton | f8a6ce8 | 2016-04-11 13:02:05 -0700 | [diff] [blame] | 390 | if (glVer >= GR_GL_VER(4,3)) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 391 | if (!fFunctions.fTexBufferRange) { |
cdalton | f8a6ce8 | 2016-04-11 13:02:05 -0700 | [diff] [blame] | 392 | RETURN_FALSE_INTERFACE; |
| 393 | } |
| 394 | } |
cdalton | c04ce67 | 2016-03-11 14:07:38 -0800 | [diff] [blame] | 395 | } else { |
| 396 | if (glVer >= GR_GL_VER(3,2) || fExtensions.has("GL_OES_texture_buffer") || |
| 397 | fExtensions.has("GL_EXT_texture_buffer")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 398 | if (!fFunctions.fTexBuffer || |
| 399 | !fFunctions.fTexBufferRange) { |
cdalton | c04ce67 | 2016-03-11 14:07:38 -0800 | [diff] [blame] | 400 | RETURN_FALSE_INTERFACE; |
| 401 | } |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | if (kGL_GrGLStandard == fStandard) { |
commit-bot@chromium.org | 90313cc | 2014-01-17 15:05:38 +0000 | [diff] [blame] | 406 | if (glVer >= GR_GL_VER(3, 0) || fExtensions.has("GL_ARB_vertex_array_object")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 407 | if (!fFunctions.fBindVertexArray || |
| 408 | !fFunctions.fDeleteVertexArrays || |
| 409 | !fFunctions.fGenVertexArrays) { |
commit-bot@chromium.org | adadf7c | 2014-03-24 19:43:02 +0000 | [diff] [blame] | 410 | RETURN_FALSE_INTERFACE |
bsalomon@google.com | ecd8484 | 2013-03-01 15:36:02 +0000 | [diff] [blame] | 411 | } |
| 412 | } |
| 413 | } else { |
commit-bot@chromium.org | 90313cc | 2014-01-17 15:05:38 +0000 | [diff] [blame] | 414 | if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_OES_vertex_array_object")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 415 | if (!fFunctions.fBindVertexArray || |
| 416 | !fFunctions.fDeleteVertexArrays || |
| 417 | !fFunctions.fGenVertexArrays) { |
commit-bot@chromium.org | adadf7c | 2014-03-24 19:43:02 +0000 | [diff] [blame] | 418 | RETURN_FALSE_INTERFACE |
bsalomon@google.com | ecd8484 | 2013-03-01 15:36:02 +0000 | [diff] [blame] | 419 | } |
| 420 | } |
bsalomon@google.com | ecd8484 | 2013-03-01 15:36:02 +0000 | [diff] [blame] | 421 | } |
commit-bot@chromium.org | a3baf3b | 2014-02-21 18:45:30 +0000 | [diff] [blame] | 422 | |
commit-bot@chromium.org | a3baf3b | 2014-02-21 18:45:30 +0000 | [diff] [blame] | 423 | if (fExtensions.has("GL_EXT_debug_marker")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 424 | if (!fFunctions.fInsertEventMarker || |
| 425 | !fFunctions.fPushGroupMarker || |
| 426 | !fFunctions.fPopGroupMarker) { |
commit-bot@chromium.org | adadf7c | 2014-03-24 19:43:02 +0000 | [diff] [blame] | 427 | RETURN_FALSE_INTERFACE |
commit-bot@chromium.org | a3baf3b | 2014-02-21 18:45:30 +0000 | [diff] [blame] | 428 | } |
| 429 | } |
bsalomon@google.com | a34bb60 | 2014-04-01 13:07:29 +0000 | [diff] [blame] | 430 | |
commit-bot@chromium.org | 160b478 | 2014-05-05 12:32:37 +0000 | [diff] [blame] | 431 | if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,3)) || |
| 432 | fExtensions.has("GL_ARB_invalidate_subdata")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 433 | if (!fFunctions.fInvalidateBufferData || |
| 434 | !fFunctions.fInvalidateBufferSubData || |
| 435 | !fFunctions.fInvalidateFramebuffer || |
| 436 | !fFunctions.fInvalidateSubFramebuffer || |
| 437 | !fFunctions.fInvalidateTexImage || |
| 438 | !fFunctions.fInvalidateTexSubImage) { |
bsalomon@google.com | a34bb60 | 2014-04-01 13:07:29 +0000 | [diff] [blame] | 439 | RETURN_FALSE_INTERFACE; |
| 440 | } |
commit-bot@chromium.org | 160b478 | 2014-05-05 12:32:37 +0000 | [diff] [blame] | 441 | } else if (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) { |
bsalomon@google.com | a34bb60 | 2014-04-01 13:07:29 +0000 | [diff] [blame] | 442 | // ES 3.0 adds the framebuffer functions but not the others. |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 443 | if (!fFunctions.fInvalidateFramebuffer || |
| 444 | !fFunctions.fInvalidateSubFramebuffer) { |
bsalomon@google.com | a34bb60 | 2014-04-01 13:07:29 +0000 | [diff] [blame] | 445 | RETURN_FALSE_INTERFACE; |
| 446 | } |
| 447 | } |
commit-bot@chromium.org | beb8b3a | 2014-04-15 15:37:51 +0000 | [diff] [blame] | 448 | |
| 449 | if (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_CHROMIUM_map_sub")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 450 | if (!fFunctions.fMapBufferSubData || |
| 451 | !fFunctions.fMapTexSubImage2D || |
| 452 | !fFunctions.fUnmapBufferSubData || |
| 453 | !fFunctions.fUnmapTexSubImage2D) { |
commit-bot@chromium.org | beb8b3a | 2014-04-15 15:37:51 +0000 | [diff] [blame] | 454 | RETURN_FALSE_INTERFACE; |
| 455 | } |
| 456 | } |
bsalomon@google.com | a34bb60 | 2014-04-01 13:07:29 +0000 | [diff] [blame] | 457 | |
commit-bot@chromium.org | 160b478 | 2014-05-05 12:32:37 +0000 | [diff] [blame] | 458 | // These functions are added to the 3.0 version of both GLES and GL. |
| 459 | if (glVer >= GR_GL_VER(3,0) || |
| 460 | (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_EXT_map_buffer_range")) || |
| 461 | (kGL_GrGLStandard == fStandard && fExtensions.has("GL_ARB_map_buffer_range"))) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 462 | if (!fFunctions.fMapBufferRange || |
| 463 | !fFunctions.fFlushMappedBufferRange) { |
kkinnunen | f655e93 | 2016-03-03 07:39:48 -0800 | [diff] [blame] | 464 | RETURN_FALSE_INTERFACE; |
commit-bot@chromium.org | 160b478 | 2014-05-05 12:32:37 +0000 | [diff] [blame] | 465 | } |
| 466 | } |
kkinnunen | 32b9a3b | 2014-07-02 22:56:35 -0700 | [diff] [blame] | 467 | |
kkinnunen | 32b9a3b | 2014-07-02 22:56:35 -0700 | [diff] [blame] | 468 | if ((kGL_GrGLStandard == fStandard && |
cdalton | eb79eea | 2016-02-26 10:39:34 -0800 | [diff] [blame] | 469 | (glVer >= GR_GL_VER(3,2) || fExtensions.has("GL_ARB_texture_multisample"))) || |
| 470 | (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,1))) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 471 | if (!fFunctions.fGetMultisamplefv) { |
cdalton | eb79eea | 2016-02-26 10:39:34 -0800 | [diff] [blame] | 472 | RETURN_FALSE_INTERFACE |
| 473 | } |
| 474 | } |
| 475 | |
| 476 | if ((kGL_GrGLStandard == fStandard && |
kkinnunen | 32b9a3b | 2014-07-02 22:56:35 -0700 | [diff] [blame] | 477 | (glVer >= GR_GL_VER(4,3) || fExtensions.has("GL_ARB_program_interface_query"))) || |
| 478 | (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,1))) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 479 | if (!fFunctions.fGetProgramResourceLocation) { |
kkinnunen | 32b9a3b | 2014-07-02 22:56:35 -0700 | [diff] [blame] | 480 | RETURN_FALSE_INTERFACE |
| 481 | } |
| 482 | } |
| 483 | |
bsalomon | ee64d6e | 2014-12-03 10:46:08 -0800 | [diff] [blame] | 484 | if (kGLES_GrGLStandard == fStandard || glVer >= GR_GL_VER(4,1) || |
| 485 | fExtensions.has("GL_ARB_ES2_compatibility")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 486 | if (!fFunctions.fGetShaderPrecisionFormat) { |
bsalomon | ee64d6e | 2014-12-03 10:46:08 -0800 | [diff] [blame] | 487 | RETURN_FALSE_INTERFACE |
| 488 | } |
bsalomon | ee64d6e | 2014-12-03 10:46:08 -0800 | [diff] [blame] | 489 | } |
| 490 | |
kkinnunen | 6bb6d40 | 2015-07-14 10:59:23 -0700 | [diff] [blame] | 491 | if (fExtensions.has("GL_NV_path_rendering") || fExtensions.has("GL_CHROMIUM_path_rendering")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 492 | if (!fFunctions.fMatrixLoadf || |
| 493 | !fFunctions.fMatrixLoadIdentity || |
| 494 | !fFunctions.fPathCommands || |
| 495 | !fFunctions.fPathParameteri || |
| 496 | !fFunctions.fPathParameterf || |
| 497 | !fFunctions.fGenPaths || |
| 498 | !fFunctions.fDeletePaths || |
| 499 | !fFunctions.fIsPath || |
| 500 | !fFunctions.fPathStencilFunc || |
| 501 | !fFunctions.fStencilFillPath || |
| 502 | !fFunctions.fStencilStrokePath || |
| 503 | !fFunctions.fStencilFillPathInstanced || |
| 504 | !fFunctions.fStencilStrokePathInstanced || |
| 505 | !fFunctions.fCoverFillPath || |
| 506 | !fFunctions.fCoverStrokePath || |
| 507 | !fFunctions.fCoverFillPathInstanced || |
| 508 | !fFunctions.fCoverStrokePathInstanced |
kkinnunen | cfe62e3 | 2015-07-01 02:58:50 -0700 | [diff] [blame] | 509 | #if 0 |
| 510 | // List of functions that Skia uses, but which have been added since the initial release |
| 511 | // of NV_path_rendering driver. We do not want to fail interface validation due to |
| 512 | // missing features, we will just not use the extension. |
| 513 | // Update this list -> update GrGLCaps::hasPathRenderingSupport too. |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 514 | || !fFunctions.fStencilThenCoverFillPath || |
| 515 | !fFunctions.fStencilThenCoverStrokePath || |
| 516 | !fFunctions.fStencilThenCoverFillPathInstanced || |
| 517 | !fFunctions.fStencilThenCoverStrokePathInstanced || |
| 518 | !fFunctions.fProgramPathFragmentInputGen |
kkinnunen | cfe62e3 | 2015-07-01 02:58:50 -0700 | [diff] [blame] | 519 | #endif |
| 520 | ) { |
kkinnunen | 32b9a3b | 2014-07-02 22:56:35 -0700 | [diff] [blame] | 521 | RETURN_FALSE_INTERFACE |
| 522 | } |
kkinnunen | 6bb6d40 | 2015-07-14 10:59:23 -0700 | [diff] [blame] | 523 | if (fExtensions.has("GL_CHROMIUM_path_rendering")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 524 | if (!fFunctions.fBindFragmentInputLocation) { |
kkinnunen | 6bb6d40 | 2015-07-14 10:59:23 -0700 | [diff] [blame] | 525 | RETURN_FALSE_INTERFACE |
| 526 | } |
| 527 | } |
kkinnunen | 32b9a3b | 2014-07-02 22:56:35 -0700 | [diff] [blame] | 528 | } |
| 529 | |
cdalton | 0edea2c | 2015-05-21 08:27:44 -0700 | [diff] [blame] | 530 | if (fExtensions.has("GL_EXT_raster_multisample")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 531 | if (!fFunctions.fRasterSamples) { |
cdalton | 0edea2c | 2015-05-21 08:27:44 -0700 | [diff] [blame] | 532 | RETURN_FALSE_INTERFACE |
| 533 | } |
| 534 | } |
| 535 | |
kkinnunen | ea40943 | 2015-12-10 01:21:59 -0800 | [diff] [blame] | 536 | if (fExtensions.has("GL_NV_framebuffer_mixed_samples") || |
| 537 | fExtensions.has("GL_CHROMIUM_framebuffer_mixed_samples")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 538 | if (!fFunctions.fCoverageModulation) { |
vbuzinov | 08b4d29 | 2015-04-01 06:29:49 -0700 | [diff] [blame] | 539 | RETURN_FALSE_INTERFACE |
| 540 | } |
| 541 | } |
| 542 | |
hendrikw | b3f1636 | 2015-10-19 06:13:55 -0700 | [diff] [blame] | 543 | if (kGL_GrGLStandard == fStandard) { |
| 544 | if (glVer >= GR_GL_VER(3,1) || |
| 545 | fExtensions.has("GL_EXT_draw_instanced") || fExtensions.has("GL_ARB_draw_instanced")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 546 | if (!fFunctions.fDrawArraysInstanced || |
| 547 | !fFunctions.fDrawElementsInstanced) { |
hendrikw | b3f1636 | 2015-10-19 06:13:55 -0700 | [diff] [blame] | 548 | RETURN_FALSE_INTERFACE |
| 549 | } |
halcanary | 9d524f2 | 2016-03-29 09:03:52 -0700 | [diff] [blame] | 550 | } |
hendrikw | b3f1636 | 2015-10-19 06:13:55 -0700 | [diff] [blame] | 551 | } else if (kGLES_GrGLStandard == fStandard) { |
kkinnunen | f655e93 | 2016-03-03 07:39:48 -0800 | [diff] [blame] | 552 | if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_draw_instanced")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 553 | if (!fFunctions.fDrawArraysInstanced || |
| 554 | !fFunctions.fDrawElementsInstanced) { |
kkinnunen | f655e93 | 2016-03-03 07:39:48 -0800 | [diff] [blame] | 555 | RETURN_FALSE_INTERFACE |
hendrikw | b3f1636 | 2015-10-19 06:13:55 -0700 | [diff] [blame] | 556 | } |
halcanary | 9d524f2 | 2016-03-29 09:03:52 -0700 | [diff] [blame] | 557 | } |
cdalton | 626e1ff | 2015-06-12 13:56:46 -0700 | [diff] [blame] | 558 | } |
| 559 | |
hendrikw | b3f1636 | 2015-10-19 06:13:55 -0700 | [diff] [blame] | 560 | if (kGL_GrGLStandard == fStandard) { |
| 561 | if (glVer >= GR_GL_VER(3,2) || fExtensions.has("GL_ARB_instanced_arrays")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 562 | if (!fFunctions.fVertexAttribDivisor) { |
hendrikw | b3f1636 | 2015-10-19 06:13:55 -0700 | [diff] [blame] | 563 | RETURN_FALSE_INTERFACE |
| 564 | } |
halcanary | 9d524f2 | 2016-03-29 09:03:52 -0700 | [diff] [blame] | 565 | } |
hendrikw | b3f1636 | 2015-10-19 06:13:55 -0700 | [diff] [blame] | 566 | } else if (kGLES_GrGLStandard == fStandard) { |
kkinnunen | f655e93 | 2016-03-03 07:39:48 -0800 | [diff] [blame] | 567 | if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_instanced_arrays")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 568 | if (!fFunctions.fVertexAttribDivisor) { |
kkinnunen | f655e93 | 2016-03-03 07:39:48 -0800 | [diff] [blame] | 569 | RETURN_FALSE_INTERFACE |
hendrikw | b3f1636 | 2015-10-19 06:13:55 -0700 | [diff] [blame] | 570 | } |
halcanary | 9d524f2 | 2016-03-29 09:03:52 -0700 | [diff] [blame] | 571 | } |
cdalton | 626e1ff | 2015-06-12 13:56:46 -0700 | [diff] [blame] | 572 | } |
| 573 | |
csmartdalton | 5cebf8c | 2016-06-03 08:28:47 -0700 | [diff] [blame] | 574 | if ((kGL_GrGLStandard == fStandard && |
| 575 | (glVer >= GR_GL_VER(4,0) || fExtensions.has("GL_ARB_draw_indirect"))) || |
cdalton | 06604b9 | 2016-02-05 10:09:51 -0800 | [diff] [blame] | 576 | (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,1))) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 577 | if (!fFunctions.fDrawArraysIndirect || |
| 578 | !fFunctions.fDrawElementsIndirect) { |
cdalton | 06604b9 | 2016-02-05 10:09:51 -0800 | [diff] [blame] | 579 | RETURN_FALSE_INTERFACE |
| 580 | } |
| 581 | } |
| 582 | |
csmartdalton | 5cebf8c | 2016-06-03 08:28:47 -0700 | [diff] [blame] | 583 | if ((kGL_GrGLStandard == fStandard && |
| 584 | (glVer >= GR_GL_VER(4,3) || fExtensions.has("GL_ARB_multi_draw_indirect"))) || |
cdalton | 06604b9 | 2016-02-05 10:09:51 -0800 | [diff] [blame] | 585 | (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_EXT_multi_draw_indirect"))) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 586 | if (!fFunctions.fMultiDrawArraysIndirect || |
| 587 | !fFunctions.fMultiDrawElementsIndirect) { |
cdalton | 06604b9 | 2016-02-05 10:09:51 -0800 | [diff] [blame] | 588 | RETURN_FALSE_INTERFACE |
| 589 | } |
| 590 | } |
| 591 | |
cdalton | 626e1ff | 2015-06-12 13:56:46 -0700 | [diff] [blame] | 592 | if (fExtensions.has("GL_NV_bindless_texture")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 593 | if (!fFunctions.fGetTextureHandle || |
| 594 | !fFunctions.fGetTextureSamplerHandle || |
| 595 | !fFunctions.fMakeTextureHandleResident || |
| 596 | !fFunctions.fMakeTextureHandleNonResident || |
| 597 | !fFunctions.fGetImageHandle || |
| 598 | !fFunctions.fMakeImageHandleResident || |
| 599 | !fFunctions.fMakeImageHandleNonResident || |
| 600 | !fFunctions.fIsTextureHandleResident || |
| 601 | !fFunctions.fIsImageHandleResident || |
| 602 | !fFunctions.fUniformHandleui64 || |
| 603 | !fFunctions.fUniformHandleui64v || |
| 604 | !fFunctions.fProgramUniformHandleui64 || |
| 605 | !fFunctions.fProgramUniformHandleui64v) { |
cdalton | 626e1ff | 2015-06-12 13:56:46 -0700 | [diff] [blame] | 606 | RETURN_FALSE_INTERFACE |
| 607 | } |
| 608 | } |
| 609 | |
| 610 | if (kGL_GrGLStandard == fStandard && fExtensions.has("GL_EXT_direct_state_access")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 611 | if (!fFunctions.fTextureParameteri || |
| 612 | !fFunctions.fTextureParameteriv || |
| 613 | !fFunctions.fTextureParameterf || |
| 614 | !fFunctions.fTextureParameterfv || |
| 615 | !fFunctions.fTextureImage1D || |
| 616 | !fFunctions.fTextureImage2D || |
| 617 | !fFunctions.fTextureSubImage1D || |
| 618 | !fFunctions.fTextureSubImage2D || |
| 619 | !fFunctions.fCopyTextureImage1D || |
| 620 | !fFunctions.fCopyTextureImage2D || |
| 621 | !fFunctions.fCopyTextureSubImage1D || |
| 622 | !fFunctions.fCopyTextureSubImage2D || |
| 623 | !fFunctions.fGetNamedBufferParameteriv || |
| 624 | !fFunctions.fGetNamedBufferPointerv || |
| 625 | !fFunctions.fGetNamedBufferSubData || |
| 626 | !fFunctions.fGetTextureImage || |
| 627 | !fFunctions.fGetTextureParameterfv || |
| 628 | !fFunctions.fGetTextureParameteriv || |
| 629 | !fFunctions.fGetTextureLevelParameterfv || |
| 630 | !fFunctions.fGetTextureLevelParameteriv || |
| 631 | !fFunctions.fMapNamedBuffer || |
| 632 | !fFunctions.fNamedBufferData || |
| 633 | !fFunctions.fNamedBufferSubData || |
| 634 | !fFunctions.fProgramUniform1f || |
| 635 | !fFunctions.fProgramUniform2f || |
| 636 | !fFunctions.fProgramUniform3f || |
| 637 | !fFunctions.fProgramUniform4f || |
| 638 | !fFunctions.fProgramUniform1i || |
| 639 | !fFunctions.fProgramUniform2i || |
| 640 | !fFunctions.fProgramUniform3i || |
| 641 | !fFunctions.fProgramUniform4i || |
| 642 | !fFunctions.fProgramUniform1fv || |
| 643 | !fFunctions.fProgramUniform2fv || |
| 644 | !fFunctions.fProgramUniform3fv || |
| 645 | !fFunctions.fProgramUniform4fv || |
| 646 | !fFunctions.fProgramUniform1iv || |
| 647 | !fFunctions.fProgramUniform2iv || |
| 648 | !fFunctions.fProgramUniform3iv || |
| 649 | !fFunctions.fProgramUniform4iv || |
| 650 | !fFunctions.fProgramUniformMatrix2fv || |
| 651 | !fFunctions.fProgramUniformMatrix3fv || |
| 652 | !fFunctions.fProgramUniformMatrix4fv || |
| 653 | !fFunctions.fUnmapNamedBuffer) { |
cdalton | 626e1ff | 2015-06-12 13:56:46 -0700 | [diff] [blame] | 654 | RETURN_FALSE_INTERFACE |
| 655 | } |
| 656 | if (glVer >= GR_GL_VER(1,2)) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 657 | if (!fFunctions.fTextureImage3D || |
| 658 | !fFunctions.fTextureSubImage3D || |
| 659 | !fFunctions.fCopyTextureSubImage3D || |
| 660 | !fFunctions.fCompressedTextureImage3D || |
| 661 | !fFunctions.fCompressedTextureImage2D || |
| 662 | !fFunctions.fCompressedTextureImage1D || |
| 663 | !fFunctions.fCompressedTextureSubImage3D || |
| 664 | !fFunctions.fCompressedTextureSubImage2D || |
| 665 | !fFunctions.fCompressedTextureSubImage1D || |
| 666 | !fFunctions.fGetCompressedTextureImage) { |
cdalton | 626e1ff | 2015-06-12 13:56:46 -0700 | [diff] [blame] | 667 | RETURN_FALSE_INTERFACE |
| 668 | } |
| 669 | } |
cdalton | 626e1ff | 2015-06-12 13:56:46 -0700 | [diff] [blame] | 670 | if (glVer >= GR_GL_VER(2,1)) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 671 | if (!fFunctions.fProgramUniformMatrix2x3fv || |
| 672 | !fFunctions.fProgramUniformMatrix3x2fv || |
| 673 | !fFunctions.fProgramUniformMatrix2x4fv || |
| 674 | !fFunctions.fProgramUniformMatrix4x2fv || |
| 675 | !fFunctions.fProgramUniformMatrix3x4fv || |
| 676 | !fFunctions.fProgramUniformMatrix4x3fv) { |
cdalton | 626e1ff | 2015-06-12 13:56:46 -0700 | [diff] [blame] | 677 | RETURN_FALSE_INTERFACE |
| 678 | } |
| 679 | } |
| 680 | if (glVer >= GR_GL_VER(3,0)) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 681 | if (!fFunctions.fNamedRenderbufferStorage || |
| 682 | !fFunctions.fGetNamedRenderbufferParameteriv || |
| 683 | !fFunctions.fNamedRenderbufferStorageMultisample || |
| 684 | !fFunctions.fCheckNamedFramebufferStatus || |
| 685 | !fFunctions.fNamedFramebufferTexture1D || |
| 686 | !fFunctions.fNamedFramebufferTexture2D || |
| 687 | !fFunctions.fNamedFramebufferTexture3D || |
| 688 | !fFunctions.fNamedFramebufferRenderbuffer || |
| 689 | !fFunctions.fGetNamedFramebufferAttachmentParameteriv || |
| 690 | !fFunctions.fGenerateTextureMipmap || |
| 691 | !fFunctions.fFramebufferDrawBuffer || |
| 692 | !fFunctions.fFramebufferDrawBuffers || |
| 693 | !fFunctions.fFramebufferReadBuffer || |
| 694 | !fFunctions.fGetFramebufferParameteriv || |
| 695 | !fFunctions.fNamedCopyBufferSubData || |
| 696 | !fFunctions.fVertexArrayVertexOffset || |
| 697 | !fFunctions.fVertexArrayColorOffset || |
| 698 | !fFunctions.fVertexArrayEdgeFlagOffset || |
| 699 | !fFunctions.fVertexArrayIndexOffset || |
| 700 | !fFunctions.fVertexArrayNormalOffset || |
| 701 | !fFunctions.fVertexArrayTexCoordOffset || |
| 702 | !fFunctions.fVertexArrayMultiTexCoordOffset || |
| 703 | !fFunctions.fVertexArrayFogCoordOffset || |
| 704 | !fFunctions.fVertexArraySecondaryColorOffset || |
| 705 | !fFunctions.fVertexArrayVertexAttribOffset || |
| 706 | !fFunctions.fVertexArrayVertexAttribIOffset || |
| 707 | !fFunctions.fEnableVertexArray || |
| 708 | !fFunctions.fDisableVertexArray || |
| 709 | !fFunctions.fEnableVertexArrayAttrib || |
| 710 | !fFunctions.fDisableVertexArrayAttrib || |
| 711 | !fFunctions.fGetVertexArrayIntegerv || |
| 712 | !fFunctions.fGetVertexArrayPointerv || |
| 713 | !fFunctions.fGetVertexArrayIntegeri_v || |
| 714 | !fFunctions.fGetVertexArrayPointeri_v || |
| 715 | !fFunctions.fMapNamedBufferRange || |
| 716 | !fFunctions.fFlushMappedNamedBufferRange) { |
cdalton | 626e1ff | 2015-06-12 13:56:46 -0700 | [diff] [blame] | 717 | RETURN_FALSE_INTERFACE |
| 718 | } |
| 719 | } |
cdalton | c04ce67 | 2016-03-11 14:07:38 -0800 | [diff] [blame] | 720 | if (glVer >= GR_GL_VER(3,1)) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 721 | if (!fFunctions.fTextureBuffer) { |
cdalton | c04ce67 | 2016-03-11 14:07:38 -0800 | [diff] [blame] | 722 | RETURN_FALSE_INTERFACE; |
| 723 | } |
| 724 | } |
cdalton | 626e1ff | 2015-06-12 13:56:46 -0700 | [diff] [blame] | 725 | } |
| 726 | |
| 727 | if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,3)) || |
| 728 | fExtensions.has("GL_KHR_debug")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 729 | if (!fFunctions.fDebugMessageControl || |
| 730 | !fFunctions.fDebugMessageInsert || |
| 731 | !fFunctions.fDebugMessageCallback || |
| 732 | !fFunctions.fGetDebugMessageLog || |
| 733 | !fFunctions.fPushDebugGroup || |
| 734 | !fFunctions.fPopDebugGroup || |
| 735 | !fFunctions.fObjectLabel) { |
cdalton | 626e1ff | 2015-06-12 13:56:46 -0700 | [diff] [blame] | 736 | RETURN_FALSE_INTERFACE |
| 737 | } |
| 738 | } |
| 739 | |
csmartdalton | 9bc1187 | 2016-08-09 12:42:47 -0700 | [diff] [blame] | 740 | if (fExtensions.has("GL_EXT_window_rectangles")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 741 | if (!fFunctions.fWindowRectangles) { |
csmartdalton | 9bc1187 | 2016-08-09 12:42:47 -0700 | [diff] [blame] | 742 | RETURN_FALSE_INTERFACE |
| 743 | } |
| 744 | } |
| 745 | |
ethannicholas | 28ef445 | 2016-03-25 09:26:03 -0700 | [diff] [blame] | 746 | if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,0)) || |
| 747 | fExtensions.has("GL_ARB_sample_shading")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 748 | if (!fFunctions.fMinSampleShading) { |
ethannicholas | 28ef445 | 2016-03-25 09:26:03 -0700 | [diff] [blame] | 749 | RETURN_FALSE_INTERFACE |
| 750 | } |
bsalomon | 23c4f1a | 2016-07-19 06:21:55 -0700 | [diff] [blame] | 751 | } else if (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_OES_sample_shading")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 752 | if (!fFunctions.fMinSampleShading) { |
ethannicholas | 28ef445 | 2016-03-25 09:26:03 -0700 | [diff] [blame] | 753 | RETURN_FALSE_INTERFACE |
| 754 | } |
| 755 | } |
| 756 | |
jvanverth | 84741b3 | 2016-09-30 08:39:02 -0700 | [diff] [blame] | 757 | if (kGL_GrGLStandard == fStandard) { |
| 758 | if (glVer >= GR_GL_VER(3, 2) || fExtensions.has("GL_ARB_sync")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 759 | if (!fFunctions.fFenceSync || |
Greg Daniel | 6bd729d | 2017-07-31 09:38:23 -0400 | [diff] [blame] | 760 | !fFunctions.fIsSync || |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 761 | !fFunctions.fClientWaitSync || |
| 762 | !fFunctions.fWaitSync || |
| 763 | !fFunctions.fDeleteSync) { |
jvanverth | 84741b3 | 2016-09-30 08:39:02 -0700 | [diff] [blame] | 764 | RETURN_FALSE_INTERFACE |
| 765 | } |
| 766 | } |
| 767 | } else if (kGLES_GrGLStandard == fStandard) { |
Brian Osman | 93a2346 | 2017-06-21 15:13:39 -0400 | [diff] [blame] | 768 | if (glVer >= GR_GL_VER(3, 0) || fExtensions.has("GL_APPLE_sync")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 769 | if (!fFunctions.fFenceSync || |
Greg Daniel | 6bd729d | 2017-07-31 09:38:23 -0400 | [diff] [blame] | 770 | !fFunctions.fIsSync || |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 771 | !fFunctions.fClientWaitSync || |
| 772 | !fFunctions.fWaitSync || |
| 773 | !fFunctions.fDeleteSync) { |
jvanverth | 84741b3 | 2016-09-30 08:39:02 -0700 | [diff] [blame] | 774 | RETURN_FALSE_INTERFACE |
| 775 | } |
| 776 | } |
| 777 | } |
| 778 | |
bsalomon | b1a32ad | 2015-11-16 06:48:44 -0800 | [diff] [blame] | 779 | if (fExtensions.has("EGL_KHR_image") || fExtensions.has("EGL_KHR_image_base")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 780 | if (!fFunctions.fEGLCreateImage || |
| 781 | !fFunctions.fEGLDestroyImage) { |
bsalomon | b1a32ad | 2015-11-16 06:48:44 -0800 | [diff] [blame] | 782 | RETURN_FALSE_INTERFACE |
| 783 | } |
| 784 | } |
| 785 | |
Brian Salomon | 15b2509 | 2017-05-08 11:10:53 -0400 | [diff] [blame] | 786 | // glDrawRangeElements was added to ES in 3.0. |
| 787 | if (kGL_GrGLStandard == fStandard || glVer >= GR_GL_VER(3,0)) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 788 | if (!fFunctions.fDrawRangeElements) { |
bsalomon | fc9527a | 2016-08-29 09:18:39 -0700 | [diff] [blame] | 789 | RETURN_FALSE_INTERFACE; |
| 790 | } |
| 791 | } |
| 792 | |
Brian Salomon | 0b63ceb | 2016-11-15 12:36:29 -0500 | [diff] [blame] | 793 | if (kGL_GrGLStandard == fStandard) { |
| 794 | if (glVer >= GR_GL_VER(4,2) || fExtensions.has("GL_ARB_shader_image_load_store")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 795 | if (!fFunctions.fBindImageTexture || |
| 796 | !fFunctions.fMemoryBarrier) { |
Brian Salomon | 0b63ceb | 2016-11-15 12:36:29 -0500 | [diff] [blame] | 797 | RETURN_FALSE_INTERFACE; |
| 798 | } |
| 799 | } |
| 800 | if (glVer >= GR_GL_VER(4,5) || fExtensions.has("GL_ARB_ES3_1_compatibility")) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 801 | if (!fFunctions.fMemoryBarrierByRegion) { |
Brian Salomon | 0b63ceb | 2016-11-15 12:36:29 -0500 | [diff] [blame] | 802 | RETURN_FALSE_INTERFACE; |
| 803 | } |
| 804 | } |
| 805 | } else if (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,1)) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 806 | if (!fFunctions.fBindImageTexture || |
| 807 | !fFunctions.fMemoryBarrier || |
| 808 | !fFunctions.fMemoryBarrierByRegion) { |
Brian Salomon | 0b63ceb | 2016-11-15 12:36:29 -0500 | [diff] [blame] | 809 | RETURN_FALSE_INTERFACE; |
| 810 | } |
| 811 | } |
| 812 | |
Greg Daniel | 81e7bf8 | 2017-07-19 14:47:42 -0400 | [diff] [blame] | 813 | // getInternalformativ was added in GL 4.2, ES 3.0, and with extension ARB_internalformat_query |
| 814 | if ((kGL_GrGLStandard == fStandard && |
| 815 | (glVer >= GR_GL_VER(4,2) || fExtensions.has("GL_ARB_internalformat_query"))) || |
| 816 | (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0))) { |
Mike Klein | 7634330 | 2017-06-22 13:15:13 -0700 | [diff] [blame] | 817 | if (!fFunctions.fGetInternalformativ) { |
Greg Daniel | 6bd729d | 2017-07-31 09:38:23 -0400 | [diff] [blame] | 818 | RETURN_FALSE_INTERFACE; |
Greg Daniel | 81e7bf8 | 2017-07-19 14:47:42 -0400 | [diff] [blame] | 819 | } |
| 820 | } |
| 821 | |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 822 | return true; |
| 823 | } |