Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019 Google LLC |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 6 | * |
| 7 | * THIS FILE IS AUTOGENERATED |
| 8 | * Make edits to tools/gpu/gl/interface/templates.go or they will |
| 9 | * be overwritten. |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 10 | */ |
| 11 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 12 | #include "include/gpu/gl/GrGLAssembleHelpers.h" |
| 13 | #include "include/gpu/gl/GrGLAssembleInterface.h" |
| 14 | #include "src/gpu/gl/GrGLUtil.h" |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 15 | |
| 16 | #define GET_PROC(F) functions->f##F = (GrGL##F##Fn*)get(ctx, "gl" #F) |
| 17 | #define GET_PROC_SUFFIX(F, S) functions->f##F = (GrGL##F##Fn*)get(ctx, "gl" #F #S) |
| 18 | #define GET_PROC_LOCAL(F) GrGL##F##Fn* F = (GrGL##F##Fn*)get(ctx, "gl" #F) |
| 19 | |
| 20 | #define GET_EGL_PROC_SUFFIX(F, S) functions->fEGL##F = (GrEGL##F##Fn*)get(ctx, "egl" #F #S) |
| 21 | |
| 22 | #if SK_DISABLE_GL_ES_INTERFACE |
| 23 | sk_sp<const GrGLInterface> GrGLMakeAssembledGLESInterface(void *ctx, GrGLGetProc get) { |
| 24 | return nullptr; |
| 25 | } |
| 26 | #else |
| 27 | sk_sp<const GrGLInterface> GrGLMakeAssembledGLESInterface(void *ctx, GrGLGetProc get) { |
| 28 | GET_PROC_LOCAL(GetString); |
| 29 | if (nullptr == GetString) { |
| 30 | return nullptr; |
| 31 | } |
| 32 | |
| 33 | const char* verStr = reinterpret_cast<const char*>(GetString(GR_GL_VERSION)); |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 34 | GrGLVersion glVer = GrGLGetVersionFromString(verStr); |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 35 | |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 36 | if (glVer < GR_GL_VER(2,0)) { |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 37 | return nullptr; |
| 38 | } |
| 39 | |
| 40 | GET_PROC_LOCAL(GetIntegerv); |
| 41 | GET_PROC_LOCAL(GetStringi); |
| 42 | GrEGLQueryStringFn* queryString; |
| 43 | GrEGLDisplay display; |
| 44 | GrGetEGLQueryAndDisplay(&queryString, &display, ctx, get); |
| 45 | GrGLExtensions extensions; |
| 46 | if (!extensions.init(kGLES_GrGLStandard, GetString, GetStringi, GetIntegerv, queryString, |
| 47 | display)) { |
| 48 | return nullptr; |
| 49 | } |
| 50 | |
| 51 | sk_sp<GrGLInterface> interface(new GrGLInterface); |
| 52 | GrGLInterface::Functions* functions = &interface->fFunctions; |
| 53 | |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 54 | // Autogenerated content follows |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 55 | GET_PROC(ActiveTexture); |
| 56 | GET_PROC(AttachShader); |
| 57 | GET_PROC(BindAttribLocation); |
| 58 | GET_PROC(BindBuffer); |
| 59 | GET_PROC(BindTexture); |
| 60 | GET_PROC(BlendColor); |
| 61 | GET_PROC(BlendEquation); |
| 62 | GET_PROC(BlendFunc); |
| 63 | GET_PROC(BufferData); |
| 64 | GET_PROC(BufferSubData); |
| 65 | GET_PROC(Clear); |
| 66 | GET_PROC(ClearColor); |
| 67 | GET_PROC(ClearStencil); |
| 68 | GET_PROC(ColorMask); |
| 69 | GET_PROC(CompileShader); |
| 70 | GET_PROC(CompressedTexImage2D); |
| 71 | GET_PROC(CompressedTexSubImage2D); |
| 72 | GET_PROC(CopyTexSubImage2D); |
| 73 | GET_PROC(CreateProgram); |
| 74 | GET_PROC(CreateShader); |
| 75 | GET_PROC(CullFace); |
| 76 | GET_PROC(DeleteBuffers); |
| 77 | GET_PROC(DeleteProgram); |
| 78 | GET_PROC(DeleteShader); |
| 79 | GET_PROC(DeleteTextures); |
| 80 | GET_PROC(DepthMask); |
| 81 | GET_PROC(Disable); |
| 82 | GET_PROC(DisableVertexAttribArray); |
| 83 | GET_PROC(DrawArrays); |
| 84 | GET_PROC(DrawElements); |
| 85 | GET_PROC(Enable); |
| 86 | GET_PROC(EnableVertexAttribArray); |
| 87 | GET_PROC(Finish); |
| 88 | GET_PROC(Flush); |
| 89 | GET_PROC(FrontFace); |
| 90 | GET_PROC(GenBuffers); |
| 91 | GET_PROC(GenTextures); |
| 92 | GET_PROC(GetBufferParameteriv); |
| 93 | GET_PROC(GetError); |
| 94 | GET_PROC(GetIntegerv); |
| 95 | GET_PROC(GetProgramInfoLog); |
| 96 | GET_PROC(GetProgramiv); |
| 97 | GET_PROC(GetShaderInfoLog); |
| 98 | GET_PROC(GetShaderiv); |
| 99 | GET_PROC(GetString); |
| 100 | GET_PROC(GetUniformLocation); |
| 101 | GET_PROC(IsTexture); |
| 102 | GET_PROC(LineWidth); |
| 103 | GET_PROC(LinkProgram); |
| 104 | GET_PROC(PixelStorei); |
| 105 | GET_PROC(ReadPixels); |
| 106 | GET_PROC(Scissor); |
| 107 | GET_PROC(ShaderSource); |
| 108 | GET_PROC(StencilFunc); |
| 109 | GET_PROC(StencilFuncSeparate); |
| 110 | GET_PROC(StencilMask); |
| 111 | GET_PROC(StencilMaskSeparate); |
| 112 | GET_PROC(StencilOp); |
| 113 | GET_PROC(StencilOpSeparate); |
| 114 | GET_PROC(TexImage2D); |
| 115 | GET_PROC(TexParameterf); |
| 116 | GET_PROC(TexParameterfv); |
| 117 | GET_PROC(TexParameteri); |
| 118 | GET_PROC(TexParameteriv); |
| 119 | GET_PROC(TexSubImage2D); |
| 120 | GET_PROC(Uniform1f); |
Kevin Lubick | 573cb87 | 2019-03-25 14:16:12 -0400 | [diff] [blame] | 121 | GET_PROC(Uniform1fv); |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 122 | GET_PROC(Uniform1i); |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 123 | GET_PROC(Uniform1iv); |
| 124 | GET_PROC(Uniform2f); |
Kevin Lubick | 573cb87 | 2019-03-25 14:16:12 -0400 | [diff] [blame] | 125 | GET_PROC(Uniform2fv); |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 126 | GET_PROC(Uniform2i); |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 127 | GET_PROC(Uniform2iv); |
| 128 | GET_PROC(Uniform3f); |
Kevin Lubick | 573cb87 | 2019-03-25 14:16:12 -0400 | [diff] [blame] | 129 | GET_PROC(Uniform3fv); |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 130 | GET_PROC(Uniform3i); |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 131 | GET_PROC(Uniform3iv); |
| 132 | GET_PROC(Uniform4f); |
Kevin Lubick | 573cb87 | 2019-03-25 14:16:12 -0400 | [diff] [blame] | 133 | GET_PROC(Uniform4fv); |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 134 | GET_PROC(Uniform4i); |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 135 | GET_PROC(Uniform4iv); |
| 136 | GET_PROC(UniformMatrix2fv); |
| 137 | GET_PROC(UniformMatrix3fv); |
| 138 | GET_PROC(UniformMatrix4fv); |
| 139 | GET_PROC(UseProgram); |
| 140 | GET_PROC(VertexAttrib1f); |
| 141 | GET_PROC(VertexAttrib2fv); |
| 142 | GET_PROC(VertexAttrib3fv); |
| 143 | GET_PROC(VertexAttrib4fv); |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 144 | GET_PROC(VertexAttribPointer); |
| 145 | GET_PROC(Viewport); |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 146 | |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 147 | if (glVer >= GR_GL_VER(3,0)) { |
| 148 | GET_PROC(GetStringi); |
| 149 | } |
| 150 | |
| 151 | if (glVer >= GR_GL_VER(3,0)) { |
| 152 | GET_PROC(BindVertexArray); |
| 153 | GET_PROC(DeleteVertexArrays); |
| 154 | GET_PROC(GenVertexArrays); |
| 155 | } else if (extensions.has("GL_OES_vertex_array_object")) { |
| 156 | GET_PROC_SUFFIX(BindVertexArray, OES); |
| 157 | GET_PROC_SUFFIX(DeleteVertexArrays, OES); |
| 158 | GET_PROC_SUFFIX(GenVertexArrays, OES); |
| 159 | } |
| 160 | |
| 161 | if (glVer >= GR_GL_VER(3,0) && extensions.has("GL_EXT_blend_func_extended")) { |
| 162 | GET_PROC_SUFFIX(BindFragDataLocation, EXT); |
| 163 | } |
| 164 | |
| 165 | if (glVer >= GR_GL_VER(3,0) && extensions.has("GL_EXT_blend_func_extended")) { |
| 166 | GET_PROC_SUFFIX(BindFragDataLocationIndexed, EXT); |
| 167 | } |
| 168 | |
| 169 | if (extensions.has("GL_KHR_blend_equation_advanced")) { |
| 170 | GET_PROC_SUFFIX(BlendBarrier, KHR); |
| 171 | } else if (extensions.has("GL_NV_blend_equation_advanced")) { |
| 172 | GET_PROC_SUFFIX(BlendBarrier, NV); |
| 173 | } |
| 174 | |
| 175 | if (extensions.has("GL_EXT_clear_texture")) { |
| 176 | GET_PROC_SUFFIX(ClearTexImage, EXT); |
| 177 | GET_PROC_SUFFIX(ClearTexSubImage, EXT); |
| 178 | } |
| 179 | |
| 180 | if (glVer >= GR_GL_VER(3,0)) { |
| 181 | GET_PROC(DrawArraysInstanced); |
| 182 | GET_PROC(DrawElementsInstanced); |
| 183 | } else if (extensions.has("GL_EXT_draw_instanced")) { |
| 184 | GET_PROC_SUFFIX(DrawArraysInstanced, EXT); |
| 185 | GET_PROC_SUFFIX(DrawElementsInstanced, EXT); |
| 186 | } |
| 187 | |
| 188 | if (glVer >= GR_GL_VER(3,0)) { |
| 189 | GET_PROC(DrawBuffers); |
| 190 | GET_PROC(ReadBuffer); |
| 191 | } |
| 192 | |
| 193 | if (glVer >= GR_GL_VER(3,1)) { |
| 194 | GET_PROC(DrawArraysIndirect); |
| 195 | GET_PROC(DrawElementsIndirect); |
| 196 | } |
| 197 | |
| 198 | if (glVer >= GR_GL_VER(3,0)) { |
| 199 | GET_PROC(DrawRangeElements); |
| 200 | } |
| 201 | |
| 202 | if (glVer >= GR_GL_VER(3,1)) { |
| 203 | GET_PROC(GetMultisamplefv); |
| 204 | } |
| 205 | |
| 206 | if (glVer >= GR_GL_VER(3,1)) { |
| 207 | GET_PROC(GetTexLevelParameteriv); |
| 208 | } |
| 209 | |
| 210 | if (extensions.has("GL_EXT_multi_draw_indirect")) { |
| 211 | GET_PROC_SUFFIX(MultiDrawArraysIndirect, EXT); |
| 212 | GET_PROC_SUFFIX(MultiDrawElementsIndirect, EXT); |
| 213 | } |
| 214 | |
| 215 | if (glVer >= GR_GL_VER(3,2)) { |
| 216 | GET_PROC(TexBuffer); |
| 217 | } else if (extensions.has("GL_OES_texture_buffer")) { |
| 218 | GET_PROC_SUFFIX(TexBuffer, OES); |
| 219 | } else if (extensions.has("GL_EXT_texture_buffer")) { |
| 220 | GET_PROC_SUFFIX(TexBuffer, EXT); |
| 221 | } |
| 222 | |
| 223 | if (glVer >= GR_GL_VER(3,2)) { |
| 224 | GET_PROC(TexBufferRange); |
| 225 | } else if (extensions.has("GL_OES_texture_buffer")) { |
| 226 | GET_PROC_SUFFIX(TexBufferRange, OES); |
| 227 | } else if (extensions.has("GL_EXT_texture_buffer")) { |
| 228 | GET_PROC_SUFFIX(TexBufferRange, EXT); |
| 229 | } |
| 230 | |
| 231 | if (glVer >= GR_GL_VER(3,0)) { |
| 232 | GET_PROC(TexStorage2D); |
| 233 | } else if (extensions.has("GL_EXT_texture_storage")) { |
| 234 | GET_PROC_SUFFIX(TexStorage2D, EXT); |
| 235 | } |
| 236 | |
| 237 | if (extensions.has("GL_NV_texture_barrier")) { |
| 238 | GET_PROC_SUFFIX(TextureBarrier, NV); |
| 239 | } |
| 240 | |
| 241 | if (extensions.has("GL_EXT_discard_framebuffer")) { |
| 242 | GET_PROC_SUFFIX(DiscardFramebuffer, EXT); |
| 243 | } |
| 244 | |
| 245 | if (glVer >= GR_GL_VER(3,0)) { |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 246 | GET_PROC(VertexAttribDivisor); |
| 247 | } else if (extensions.has("GL_EXT_instanced_arrays")) { |
| 248 | GET_PROC_SUFFIX(VertexAttribDivisor, EXT); |
| 249 | } |
| 250 | |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 251 | if (glVer >= GR_GL_VER(3,0)) { |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 252 | GET_PROC(VertexAttribIPointer); |
| 253 | } |
| 254 | |
| 255 | GET_PROC(BindFramebuffer); |
| 256 | GET_PROC(BindRenderbuffer); |
| 257 | GET_PROC(CheckFramebufferStatus); |
| 258 | GET_PROC(DeleteFramebuffers); |
| 259 | GET_PROC(DeleteRenderbuffers); |
| 260 | GET_PROC(FramebufferRenderbuffer); |
| 261 | GET_PROC(FramebufferTexture2D); |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 262 | GET_PROC(GenFramebuffers); |
| 263 | GET_PROC(GenRenderbuffers); |
| 264 | GET_PROC(GenerateMipmap); |
| 265 | GET_PROC(GetFramebufferAttachmentParameteriv); |
| 266 | GET_PROC(GetRenderbufferParameteriv); |
| 267 | GET_PROC(RenderbufferStorage); |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 268 | |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 269 | if (glVer >= GR_GL_VER(3,0)) { |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 270 | GET_PROC(BlitFramebuffer); |
| 271 | } else if (extensions.has("GL_CHROMIUM_framebuffer_multisample")) { |
Kevin Lubick | 573cb87 | 2019-03-25 14:16:12 -0400 | [diff] [blame] | 272 | GET_PROC_SUFFIX(BlitFramebuffer, CHROMIUM); |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 273 | } else if (extensions.has("GL_ANGLE_framebuffer_blit")) { |
| 274 | GET_PROC_SUFFIX(BlitFramebuffer, ANGLE); |
| 275 | } |
| 276 | |
| 277 | if (glVer >= GR_GL_VER(3,0)) { |
| 278 | GET_PROC(RenderbufferStorageMultisample); |
| 279 | } else if (extensions.has("GL_CHROMIUM_framebuffer_multisample")) { |
| 280 | GET_PROC_SUFFIX(RenderbufferStorageMultisample, CHROMIUM); |
| 281 | } else if (extensions.has("GL_ANGLE_framebuffer_multisample")) { |
| 282 | GET_PROC_SUFFIX(RenderbufferStorageMultisample, ANGLE); |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 283 | } |
| 284 | |
| 285 | if (extensions.has("GL_CHROMIUM_map_sub")) { |
| 286 | GET_PROC_SUFFIX(MapBufferSubData, CHROMIUM); |
| 287 | GET_PROC_SUFFIX(MapTexSubImage2D, CHROMIUM); |
| 288 | GET_PROC_SUFFIX(UnmapBufferSubData, CHROMIUM); |
| 289 | GET_PROC_SUFFIX(UnmapTexSubImage2D, CHROMIUM); |
| 290 | } |
| 291 | |
| 292 | if (extensions.has("GL_EXT_multisampled_render_to_texture")) { |
| 293 | GET_PROC_SUFFIX(FramebufferTexture2DMultisample, EXT); |
| 294 | } else if (extensions.has("GL_IMG_multisampled_render_to_texture")) { |
| 295 | GET_PROC_SUFFIX(FramebufferTexture2DMultisample, IMG); |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 296 | } |
| 297 | |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 298 | if (extensions.has("GL_EXT_multisampled_render_to_texture")) { |
| 299 | functions->fRenderbufferStorageMultisampleES2EXT =(GrGLRenderbufferStorageMultisampleFn*)get(ctx, "glRenderbufferStorageMultisampleEXT"); |
| 300 | } |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 301 | |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 302 | if (extensions.has("GL_IMG_multisampled_render_to_texture")) { |
| 303 | functions->fRenderbufferStorageMultisampleES2EXT =(GrGLRenderbufferStorageMultisampleFn*)get(ctx, "glRenderbufferStorageMultisampleIMG"); |
| 304 | } |
| 305 | |
| 306 | if (extensions.has("GL_APPLE_framebuffer_multisample")) { |
| 307 | GET_PROC_SUFFIX(ResolveMultisampleFramebuffer, APPLE); |
| 308 | functions->fRenderbufferStorageMultisampleES2APPLE =(GrGLRenderbufferStorageMultisampleFn*)get(ctx, "glRenderbufferStorageMultisampleAPPLE"); |
| 309 | } |
| 310 | |
| 311 | if (extensions.has("GL_OES_mapbuffer")) { |
| 312 | GET_PROC_SUFFIX(MapBuffer, OES); |
| 313 | } |
| 314 | |
| 315 | if (glVer >= GR_GL_VER(3,0)) { |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 316 | GET_PROC(UnmapBuffer); |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 317 | } else if (extensions.has("GL_OES_mapbuffer")) { |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 318 | GET_PROC_SUFFIX(UnmapBuffer, OES); |
| 319 | } |
| 320 | |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 321 | if (glVer >= GR_GL_VER(3,0)) { |
Kevin Lubick | 573cb87 | 2019-03-25 14:16:12 -0400 | [diff] [blame] | 322 | GET_PROC(FlushMappedBufferRange); |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 323 | GET_PROC(MapBufferRange); |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 324 | } else if (extensions.has("GL_EXT_map_buffer_range")) { |
Kevin Lubick | 573cb87 | 2019-03-25 14:16:12 -0400 | [diff] [blame] | 325 | GET_PROC_SUFFIX(FlushMappedBufferRange, EXT); |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 326 | GET_PROC_SUFFIX(MapBufferRange, EXT); |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 327 | } |
| 328 | |
| 329 | if (extensions.has("GL_EXT_debug_marker")) { |
| 330 | GET_PROC_SUFFIX(InsertEventMarker, EXT); |
Kevin Lubick | 573cb87 | 2019-03-25 14:16:12 -0400 | [diff] [blame] | 331 | GET_PROC_SUFFIX(PopGroupMarker, EXT); |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 332 | GET_PROC_SUFFIX(PushGroupMarker, EXT); |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 333 | } |
| 334 | |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 335 | if (glVer >= GR_GL_VER(3,1)) { |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 336 | GET_PROC(GetProgramResourceLocation); |
| 337 | } |
| 338 | |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 339 | if (extensions.has("GL_CHROMIUM_path_rendering")) { |
| 340 | GET_PROC_SUFFIX(MatrixLoadIdentity, CHROMIUM); |
| 341 | GET_PROC_SUFFIX(MatrixLoadf, CHROMIUM); |
| 342 | } else if (extensions.has("GL_NV_path_rendering")) { |
Kevin Lubick | 573cb87 | 2019-03-25 14:16:12 -0400 | [diff] [blame] | 343 | GET_PROC_SUFFIX(MatrixLoadIdentity, EXT); |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 344 | GET_PROC_SUFFIX(MatrixLoadf, EXT); |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 345 | } |
| 346 | |
| 347 | if (extensions.has("GL_CHROMIUM_path_rendering")) { |
Kevin Lubick | 573cb87 | 2019-03-25 14:16:12 -0400 | [diff] [blame] | 348 | GET_PROC_SUFFIX(CoverFillPath, CHROMIUM); |
Kevin Lubick | 573cb87 | 2019-03-25 14:16:12 -0400 | [diff] [blame] | 349 | GET_PROC_SUFFIX(CoverFillPathInstanced, CHROMIUM); |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 350 | GET_PROC_SUFFIX(CoverStrokePath, CHROMIUM); |
Kevin Lubick | 573cb87 | 2019-03-25 14:16:12 -0400 | [diff] [blame] | 351 | GET_PROC_SUFFIX(CoverStrokePathInstanced, CHROMIUM); |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 352 | GET_PROC_SUFFIX(DeletePaths, CHROMIUM); |
| 353 | GET_PROC_SUFFIX(GenPaths, CHROMIUM); |
| 354 | GET_PROC_SUFFIX(IsPath, CHROMIUM); |
| 355 | GET_PROC_SUFFIX(PathCommands, CHROMIUM); |
| 356 | GET_PROC_SUFFIX(PathParameterf, CHROMIUM); |
| 357 | GET_PROC_SUFFIX(PathParameteri, CHROMIUM); |
| 358 | GET_PROC_SUFFIX(PathStencilFunc, CHROMIUM); |
Kevin Lubick | 573cb87 | 2019-03-25 14:16:12 -0400 | [diff] [blame] | 359 | GET_PROC_SUFFIX(ProgramPathFragmentInputGen, CHROMIUM); |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 360 | GET_PROC_SUFFIX(StencilFillPath, CHROMIUM); |
| 361 | GET_PROC_SUFFIX(StencilFillPathInstanced, CHROMIUM); |
| 362 | GET_PROC_SUFFIX(StencilStrokePath, CHROMIUM); |
| 363 | GET_PROC_SUFFIX(StencilStrokePathInstanced, CHROMIUM); |
| 364 | GET_PROC_SUFFIX(StencilThenCoverFillPath, CHROMIUM); |
| 365 | GET_PROC_SUFFIX(StencilThenCoverFillPathInstanced, CHROMIUM); |
| 366 | GET_PROC_SUFFIX(StencilThenCoverStrokePath, CHROMIUM); |
| 367 | GET_PROC_SUFFIX(StencilThenCoverStrokePathInstanced, CHROMIUM); |
| 368 | } else if (extensions.has("GL_NV_path_rendering")) { |
| 369 | GET_PROC_SUFFIX(CoverFillPath, NV); |
| 370 | GET_PROC_SUFFIX(CoverFillPathInstanced, NV); |
| 371 | GET_PROC_SUFFIX(CoverStrokePath, NV); |
| 372 | GET_PROC_SUFFIX(CoverStrokePathInstanced, NV); |
| 373 | GET_PROC_SUFFIX(DeletePaths, NV); |
| 374 | GET_PROC_SUFFIX(GenPaths, NV); |
| 375 | GET_PROC_SUFFIX(IsPath, NV); |
| 376 | GET_PROC_SUFFIX(PathCommands, NV); |
| 377 | GET_PROC_SUFFIX(PathParameterf, NV); |
| 378 | GET_PROC_SUFFIX(PathParameteri, NV); |
| 379 | GET_PROC_SUFFIX(PathStencilFunc, NV); |
| 380 | GET_PROC_SUFFIX(ProgramPathFragmentInputGen, NV); |
| 381 | GET_PROC_SUFFIX(StencilFillPath, NV); |
| 382 | GET_PROC_SUFFIX(StencilFillPathInstanced, NV); |
| 383 | GET_PROC_SUFFIX(StencilStrokePath, NV); |
| 384 | GET_PROC_SUFFIX(StencilStrokePathInstanced, NV); |
| 385 | GET_PROC_SUFFIX(StencilThenCoverFillPath, NV); |
| 386 | GET_PROC_SUFFIX(StencilThenCoverFillPathInstanced, NV); |
| 387 | GET_PROC_SUFFIX(StencilThenCoverStrokePath, NV); |
| 388 | GET_PROC_SUFFIX(StencilThenCoverStrokePathInstanced, NV); |
| 389 | } |
| 390 | |
| 391 | if (extensions.has("GL_CHROMIUM_path_rendering")) { |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 392 | GET_PROC_SUFFIX(BindFragmentInputLocation, CHROMIUM); |
| 393 | } |
| 394 | |
| 395 | if (extensions.has("GL_CHROMIUM_framebuffer_mixed_samples")) { |
| 396 | GET_PROC_SUFFIX(CoverageModulation, CHROMIUM); |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 397 | } else if (extensions.has("GL_NV_framebuffer_mixed_samples")) { |
| 398 | GET_PROC_SUFFIX(CoverageModulation, NV); |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 399 | } |
| 400 | |
| 401 | if (extensions.has("GL_KHR_debug")) { |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 402 | GET_PROC_SUFFIX(DebugMessageCallback, KHR); |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 403 | GET_PROC_SUFFIX(DebugMessageControl, KHR); |
| 404 | GET_PROC_SUFFIX(DebugMessageInsert, KHR); |
| 405 | GET_PROC_SUFFIX(GetDebugMessageLog, KHR); |
Kevin Lubick | 573cb87 | 2019-03-25 14:16:12 -0400 | [diff] [blame] | 406 | GET_PROC_SUFFIX(ObjectLabel, KHR); |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 407 | GET_PROC_SUFFIX(PopDebugGroup, KHR); |
| 408 | GET_PROC_SUFFIX(PushDebugGroup, KHR); |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 409 | } |
| 410 | |
| 411 | if (extensions.has("GL_CHROMIUM_bind_uniform_location")) { |
| 412 | GET_PROC_SUFFIX(BindUniformLocation, CHROMIUM); |
| 413 | } |
| 414 | |
| 415 | if (extensions.has("GL_EXT_window_rectangles")) { |
| 416 | GET_PROC_SUFFIX(WindowRectangles, EXT); |
| 417 | } |
| 418 | |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 419 | if (glVer >= GR_GL_VER(3,0)) { |
| 420 | GET_PROC(ClientWaitSync); |
| 421 | GET_PROC(DeleteSync); |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 422 | GET_PROC(FenceSync); |
| 423 | GET_PROC(IsSync); |
| 424 | GET_PROC(WaitSync); |
| 425 | } else if (extensions.has("GL_APPLE_sync")) { |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 426 | GET_PROC_SUFFIX(ClientWaitSync, APPLE); |
| 427 | GET_PROC_SUFFIX(DeleteSync, APPLE); |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 428 | GET_PROC_SUFFIX(FenceSync, APPLE); |
| 429 | GET_PROC_SUFFIX(IsSync, APPLE); |
| 430 | GET_PROC_SUFFIX(WaitSync, APPLE); |
| 431 | } |
| 432 | |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 433 | if (glVer >= GR_GL_VER(3,0)) { |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 434 | GET_PROC(GetInternalformativ); |
| 435 | } |
| 436 | |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 437 | if (glVer >= GR_GL_VER(3,0)) { |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 438 | GET_PROC(GetProgramBinary); |
| 439 | GET_PROC(ProgramBinary); |
Brian Osman | 064729e | 2019-06-18 17:22:59 -0400 | [diff] [blame] | 440 | } else if (extensions.has("GL_OES_get_program_binary")) { |
| 441 | GET_PROC_SUFFIX(GetProgramBinary, OES); |
| 442 | GET_PROC_SUFFIX(ProgramBinary, OES); |
| 443 | } |
| 444 | |
| 445 | if (glVer >= GR_GL_VER(3,0)) { |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 446 | GET_PROC(ProgramParameteri); |
| 447 | } |
| 448 | |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 449 | if (glVer >= GR_GL_VER(3,0)) { |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 450 | GET_PROC(BindSampler); |
| 451 | GET_PROC(DeleteSamplers); |
| 452 | GET_PROC(GenSamplers); |
| 453 | GET_PROC(SamplerParameteri); |
| 454 | GET_PROC(SamplerParameteriv); |
| 455 | } |
| 456 | |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 457 | if (glVer >= GR_GL_VER(3,0)) { |
Kevin Lubick | 9928c7d | 2019-03-28 11:37:55 -0400 | [diff] [blame] | 458 | #if GR_TEST_UTILS |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 459 | GET_PROC(BeginQuery); |
| 460 | GET_PROC(DeleteQueries); |
| 461 | GET_PROC(EndQuery); |
| 462 | GET_PROC(GenQueries); |
| 463 | GET_PROC(GetQueryObjectuiv); |
| 464 | GET_PROC(GetQueryiv); |
Kevin Lubick | 9928c7d | 2019-03-28 11:37:55 -0400 | [diff] [blame] | 465 | #endif |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 466 | } else if (extensions.has("GL_EXT_occlusion_query_boolean")) { |
Kevin Lubick | 9928c7d | 2019-03-28 11:37:55 -0400 | [diff] [blame] | 467 | #if GR_TEST_UTILS |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 468 | GET_PROC_SUFFIX(BeginQuery, EXT); |
| 469 | GET_PROC_SUFFIX(DeleteQueries, EXT); |
| 470 | GET_PROC_SUFFIX(EndQuery, EXT); |
| 471 | GET_PROC_SUFFIX(GenQueries, EXT); |
| 472 | GET_PROC_SUFFIX(GetQueryObjectuiv, EXT); |
| 473 | GET_PROC_SUFFIX(GetQueryiv, EXT); |
Kevin Lubick | 9928c7d | 2019-03-28 11:37:55 -0400 | [diff] [blame] | 474 | #endif |
Kevin Lubick | 5509dac | 2019-03-25 17:23:55 -0400 | [diff] [blame] | 475 | } |
| 476 | |
| 477 | if (glVer >= GR_GL_VER(3,0)) { |
| 478 | GET_PROC(InvalidateFramebuffer); |
| 479 | GET_PROC(InvalidateSubFramebuffer); |
| 480 | } |
| 481 | |
| 482 | GET_PROC(GetShaderPrecisionFormat); |
| 483 | |
| 484 | |
| 485 | // End autogenerated content |
| 486 | // TODO(kjlubick): Do we want a feature that removes the extension if it doesn't have |
| 487 | // the function? This is common on some low-end GPUs. |
| 488 | |
| 489 | if (extensions.has("GL_KHR_debug")) { |
| 490 | // In general we have a policy against removing extension strings when the driver does |
| 491 | // not provide function pointers for an advertised extension. However, because there is a |
| 492 | // known device that advertises GL_KHR_debug but fails to provide the functions and this is |
| 493 | // a debugging- only extension we've made an exception. This also can happen when using |
| 494 | // APITRACE. |
| 495 | if (!interface->fFunctions.fDebugMessageControl) { |
| 496 | extensions.remove("GL_KHR_debug"); |
| 497 | } |
| 498 | } |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 499 | interface->fStandard = kGLES_GrGLStandard; |
| 500 | interface->fExtensions.swap(&extensions); |
| 501 | |
Brian Salomon | 9c73e3d | 2019-08-15 10:55:49 -0400 | [diff] [blame] | 502 | return interface; |
Kevin Lubick | 93b3dce | 2019-03-25 10:30:30 -0400 | [diff] [blame] | 503 | } |
| 504 | #endif |