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