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. |
6 | * |
7 | * THIS FILE IS AUTOGENERATED |
8 | * Make edits to tools/gpu/gl/interface/templates.go or they will |
9 | * be overwritten. |
10 | */ |
11 | |
12 | #include "include/gpu/gl/GrGLAssembleHelpers.h" |
13 | #include "include/gpu/gl/GrGLAssembleInterface.h" |
14 | #include "src/gpu/gl/GrGLUtil.h" |
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)); |
34 | GrGLVersion glVer = GrGLGetVersionFromString(verStr); |
35 | |
36 | if (glVer < GR_GL_VER(2,0)) { |
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 | |
54 | // Autogenerated content follows |
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); |
121 | GET_PROC(Uniform1fv); |
122 | GET_PROC(Uniform1i); |
123 | GET_PROC(Uniform1iv); |
124 | GET_PROC(Uniform2f); |
125 | GET_PROC(Uniform2fv); |
126 | GET_PROC(Uniform2i); |
127 | GET_PROC(Uniform2iv); |
128 | GET_PROC(Uniform3f); |
129 | GET_PROC(Uniform3fv); |
130 | GET_PROC(Uniform3i); |
131 | GET_PROC(Uniform3iv); |
132 | GET_PROC(Uniform4f); |
133 | GET_PROC(Uniform4fv); |
134 | GET_PROC(Uniform4i); |
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); |
144 | GET_PROC(VertexAttribPointer); |
145 | GET_PROC(Viewport); |
146 | |
147 | if (glVer >= GR_GL_VER(3,0)) { |
148 | GET_PROC(GetStringi); |
149 | } |
150 | |
151 | if (glVer >= GR_GL_VER(3,1)) { |
152 | GET_PROC(MemoryBarrier); |
153 | } |
154 | |
155 | if (glVer >= GR_GL_VER(3,0)) { |
156 | GET_PROC(BindVertexArray); |
157 | GET_PROC(DeleteVertexArrays); |
158 | GET_PROC(GenVertexArrays); |
159 | } else if (extensions.has("GL_OES_vertex_array_object" )) { |
160 | GET_PROC_SUFFIX(BindVertexArray, OES); |
161 | GET_PROC_SUFFIX(DeleteVertexArrays, OES); |
162 | GET_PROC_SUFFIX(GenVertexArrays, OES); |
163 | } |
164 | |
165 | if (glVer >= GR_GL_VER(3,2)) { |
166 | GET_PROC(PatchParameteri); |
167 | } else if (extensions.has("GL_OES_tessellation_shader" )) { |
168 | GET_PROC_SUFFIX(PatchParameteri, OES); |
169 | } |
170 | |
171 | if (glVer >= GR_GL_VER(3,0) && extensions.has("GL_EXT_blend_func_extended" )) { |
172 | GET_PROC_SUFFIX(BindFragDataLocation, EXT); |
173 | } |
174 | |
175 | if (glVer >= GR_GL_VER(3,0) && extensions.has("GL_EXT_blend_func_extended" )) { |
176 | GET_PROC_SUFFIX(BindFragDataLocationIndexed, EXT); |
177 | } |
178 | |
179 | if (extensions.has("GL_KHR_blend_equation_advanced" )) { |
180 | GET_PROC_SUFFIX(BlendBarrier, KHR); |
181 | } else if (extensions.has("GL_NV_blend_equation_advanced" )) { |
182 | GET_PROC_SUFFIX(BlendBarrier, NV); |
183 | } |
184 | |
185 | if (extensions.has("GL_EXT_clear_texture" )) { |
186 | GET_PROC_SUFFIX(ClearTexImage, EXT); |
187 | GET_PROC_SUFFIX(ClearTexSubImage, EXT); |
188 | } |
189 | |
190 | if (glVer >= GR_GL_VER(3,0)) { |
191 | GET_PROC(DrawArraysInstanced); |
192 | GET_PROC(DrawElementsInstanced); |
193 | } else if (extensions.has("GL_EXT_draw_instanced" )) { |
194 | GET_PROC_SUFFIX(DrawArraysInstanced, EXT); |
195 | GET_PROC_SUFFIX(DrawElementsInstanced, EXT); |
196 | } |
197 | |
198 | if (extensions.has("GL_EXT_base_instance" )) { |
199 | GET_PROC_SUFFIX(DrawArraysInstancedBaseInstance, EXT); |
200 | GET_PROC_SUFFIX(DrawElementsInstancedBaseVertexBaseInstance, EXT); |
201 | } else if (extensions.has("GL_ANGLE_base_vertex_base_instance" )) { |
202 | GET_PROC_SUFFIX(DrawArraysInstancedBaseInstance, ANGLE); |
203 | GET_PROC_SUFFIX(DrawElementsInstancedBaseVertexBaseInstance, ANGLE); |
204 | } |
205 | |
206 | if (glVer >= GR_GL_VER(3,0)) { |
207 | GET_PROC(DrawBuffers); |
208 | GET_PROC(ReadBuffer); |
209 | } |
210 | |
211 | if (glVer >= GR_GL_VER(3,1)) { |
212 | GET_PROC(DrawArraysIndirect); |
213 | GET_PROC(DrawElementsIndirect); |
214 | } |
215 | |
216 | if (glVer >= GR_GL_VER(3,0)) { |
217 | GET_PROC(DrawRangeElements); |
218 | } |
219 | |
220 | if (glVer >= GR_GL_VER(3,1)) { |
221 | GET_PROC(GetMultisamplefv); |
222 | } |
223 | |
224 | if (glVer >= GR_GL_VER(3,1)) { |
225 | GET_PROC(GetTexLevelParameteriv); |
226 | } |
227 | |
228 | if (extensions.has("GL_EXT_multi_draw_indirect" )) { |
229 | GET_PROC_SUFFIX(MultiDrawArraysIndirect, EXT); |
230 | GET_PROC_SUFFIX(MultiDrawElementsIndirect, EXT); |
231 | } |
232 | |
233 | if (glVer >= GR_GL_VER(3,2)) { |
234 | GET_PROC(TexBuffer); |
235 | } else if (extensions.has("GL_OES_texture_buffer" )) { |
236 | GET_PROC_SUFFIX(TexBuffer, OES); |
237 | } else if (extensions.has("GL_EXT_texture_buffer" )) { |
238 | GET_PROC_SUFFIX(TexBuffer, EXT); |
239 | } |
240 | |
241 | if (glVer >= GR_GL_VER(3,2)) { |
242 | GET_PROC(TexBufferRange); |
243 | } else if (extensions.has("GL_OES_texture_buffer" )) { |
244 | GET_PROC_SUFFIX(TexBufferRange, OES); |
245 | } else if (extensions.has("GL_EXT_texture_buffer" )) { |
246 | GET_PROC_SUFFIX(TexBufferRange, EXT); |
247 | } |
248 | |
249 | if (glVer >= GR_GL_VER(3,0)) { |
250 | GET_PROC(TexStorage2D); |
251 | } else if (extensions.has("GL_EXT_texture_storage" )) { |
252 | GET_PROC_SUFFIX(TexStorage2D, EXT); |
253 | } |
254 | |
255 | if (extensions.has("GL_NV_texture_barrier" )) { |
256 | GET_PROC_SUFFIX(TextureBarrier, NV); |
257 | } |
258 | |
259 | if (extensions.has("GL_EXT_discard_framebuffer" )) { |
260 | GET_PROC_SUFFIX(DiscardFramebuffer, EXT); |
261 | } |
262 | |
263 | if (extensions.has("GL_QCOM_tiled_rendering" )) { |
264 | GET_PROC_SUFFIX(EndTiling, QCOM); |
265 | GET_PROC_SUFFIX(StartTiling, QCOM); |
266 | } |
267 | |
268 | if (glVer >= GR_GL_VER(3,0)) { |
269 | GET_PROC(VertexAttribDivisor); |
270 | } else if (extensions.has("GL_EXT_instanced_arrays" )) { |
271 | GET_PROC_SUFFIX(VertexAttribDivisor, EXT); |
272 | } |
273 | |
274 | if (glVer >= GR_GL_VER(3,0)) { |
275 | GET_PROC(VertexAttribIPointer); |
276 | } |
277 | |
278 | GET_PROC(BindFramebuffer); |
279 | GET_PROC(BindRenderbuffer); |
280 | GET_PROC(CheckFramebufferStatus); |
281 | GET_PROC(DeleteFramebuffers); |
282 | GET_PROC(DeleteRenderbuffers); |
283 | GET_PROC(FramebufferRenderbuffer); |
284 | GET_PROC(FramebufferTexture2D); |
285 | GET_PROC(GenFramebuffers); |
286 | GET_PROC(GenRenderbuffers); |
287 | GET_PROC(GenerateMipmap); |
288 | GET_PROC(GetFramebufferAttachmentParameteriv); |
289 | GET_PROC(GetRenderbufferParameteriv); |
290 | GET_PROC(RenderbufferStorage); |
291 | |
292 | if (glVer >= GR_GL_VER(3,0)) { |
293 | GET_PROC(BlitFramebuffer); |
294 | } else if (extensions.has("GL_CHROMIUM_framebuffer_multisample" )) { |
295 | GET_PROC_SUFFIX(BlitFramebuffer, CHROMIUM); |
296 | } else if (extensions.has("GL_ANGLE_framebuffer_blit" )) { |
297 | GET_PROC_SUFFIX(BlitFramebuffer, ANGLE); |
298 | } |
299 | |
300 | if (glVer >= GR_GL_VER(3,0)) { |
301 | GET_PROC(RenderbufferStorageMultisample); |
302 | } else if (extensions.has("GL_CHROMIUM_framebuffer_multisample" )) { |
303 | GET_PROC_SUFFIX(RenderbufferStorageMultisample, CHROMIUM); |
304 | } else if (extensions.has("GL_ANGLE_framebuffer_multisample" )) { |
305 | GET_PROC_SUFFIX(RenderbufferStorageMultisample, ANGLE); |
306 | } |
307 | |
308 | if (extensions.has("GL_CHROMIUM_map_sub" )) { |
309 | GET_PROC_SUFFIX(MapBufferSubData, CHROMIUM); |
310 | GET_PROC_SUFFIX(MapTexSubImage2D, CHROMIUM); |
311 | GET_PROC_SUFFIX(UnmapBufferSubData, CHROMIUM); |
312 | GET_PROC_SUFFIX(UnmapTexSubImage2D, CHROMIUM); |
313 | } |
314 | |
315 | if (extensions.has("GL_EXT_multisampled_render_to_texture" )) { |
316 | GET_PROC_SUFFIX(FramebufferTexture2DMultisample, EXT); |
317 | } else if (extensions.has("GL_IMG_multisampled_render_to_texture" )) { |
318 | GET_PROC_SUFFIX(FramebufferTexture2DMultisample, IMG); |
319 | } |
320 | |
321 | if (extensions.has("GL_EXT_multisampled_render_to_texture" )) { |
322 | functions->fRenderbufferStorageMultisampleES2EXT =(GrGLRenderbufferStorageMultisampleFn*)get(ctx, "glRenderbufferStorageMultisampleEXT" ); |
323 | } |
324 | |
325 | if (extensions.has("GL_IMG_multisampled_render_to_texture" )) { |
326 | functions->fRenderbufferStorageMultisampleES2EXT =(GrGLRenderbufferStorageMultisampleFn*)get(ctx, "glRenderbufferStorageMultisampleIMG" ); |
327 | } |
328 | |
329 | if (extensions.has("GL_APPLE_framebuffer_multisample" )) { |
330 | GET_PROC_SUFFIX(ResolveMultisampleFramebuffer, APPLE); |
331 | functions->fRenderbufferStorageMultisampleES2APPLE =(GrGLRenderbufferStorageMultisampleFn*)get(ctx, "glRenderbufferStorageMultisampleAPPLE" ); |
332 | } |
333 | |
334 | if (extensions.has("GL_OES_mapbuffer" )) { |
335 | GET_PROC_SUFFIX(MapBuffer, OES); |
336 | } |
337 | |
338 | if (glVer >= GR_GL_VER(3,0)) { |
339 | GET_PROC(UnmapBuffer); |
340 | } else if (extensions.has("GL_OES_mapbuffer" )) { |
341 | GET_PROC_SUFFIX(UnmapBuffer, OES); |
342 | } |
343 | |
344 | if (glVer >= GR_GL_VER(3,0)) { |
345 | GET_PROC(FlushMappedBufferRange); |
346 | GET_PROC(MapBufferRange); |
347 | } else if (extensions.has("GL_EXT_map_buffer_range" )) { |
348 | GET_PROC_SUFFIX(FlushMappedBufferRange, EXT); |
349 | GET_PROC_SUFFIX(MapBufferRange, EXT); |
350 | } |
351 | |
352 | if (extensions.has("GL_EXT_debug_marker" )) { |
353 | GET_PROC_SUFFIX(InsertEventMarker, EXT); |
354 | GET_PROC_SUFFIX(PopGroupMarker, EXT); |
355 | GET_PROC_SUFFIX(PushGroupMarker, EXT); |
356 | } |
357 | |
358 | if (glVer >= GR_GL_VER(3,1)) { |
359 | GET_PROC(GetProgramResourceLocation); |
360 | } |
361 | |
362 | if (extensions.has("GL_CHROMIUM_path_rendering" )) { |
363 | GET_PROC_SUFFIX(MatrixLoadIdentity, CHROMIUM); |
364 | GET_PROC_SUFFIX(MatrixLoadf, CHROMIUM); |
365 | } else if (extensions.has("GL_NV_path_rendering" )) { |
366 | GET_PROC_SUFFIX(MatrixLoadIdentity, EXT); |
367 | GET_PROC_SUFFIX(MatrixLoadf, EXT); |
368 | } |
369 | |
370 | if (extensions.has("GL_CHROMIUM_path_rendering" )) { |
371 | GET_PROC_SUFFIX(CoverFillPath, CHROMIUM); |
372 | GET_PROC_SUFFIX(CoverFillPathInstanced, CHROMIUM); |
373 | GET_PROC_SUFFIX(CoverStrokePath, CHROMIUM); |
374 | GET_PROC_SUFFIX(CoverStrokePathInstanced, CHROMIUM); |
375 | GET_PROC_SUFFIX(DeletePaths, CHROMIUM); |
376 | GET_PROC_SUFFIX(GenPaths, CHROMIUM); |
377 | GET_PROC_SUFFIX(IsPath, CHROMIUM); |
378 | GET_PROC_SUFFIX(PathCommands, CHROMIUM); |
379 | GET_PROC_SUFFIX(PathParameterf, CHROMIUM); |
380 | GET_PROC_SUFFIX(PathParameteri, CHROMIUM); |
381 | GET_PROC_SUFFIX(PathStencilFunc, CHROMIUM); |
382 | GET_PROC_SUFFIX(ProgramPathFragmentInputGen, CHROMIUM); |
383 | GET_PROC_SUFFIX(StencilFillPath, CHROMIUM); |
384 | GET_PROC_SUFFIX(StencilFillPathInstanced, CHROMIUM); |
385 | GET_PROC_SUFFIX(StencilStrokePath, CHROMIUM); |
386 | GET_PROC_SUFFIX(StencilStrokePathInstanced, CHROMIUM); |
387 | GET_PROC_SUFFIX(StencilThenCoverFillPath, CHROMIUM); |
388 | GET_PROC_SUFFIX(StencilThenCoverFillPathInstanced, CHROMIUM); |
389 | GET_PROC_SUFFIX(StencilThenCoverStrokePath, CHROMIUM); |
390 | GET_PROC_SUFFIX(StencilThenCoverStrokePathInstanced, CHROMIUM); |
391 | } else if (extensions.has("GL_NV_path_rendering" )) { |
392 | GET_PROC_SUFFIX(CoverFillPath, NV); |
393 | GET_PROC_SUFFIX(CoverFillPathInstanced, NV); |
394 | GET_PROC_SUFFIX(CoverStrokePath, NV); |
395 | GET_PROC_SUFFIX(CoverStrokePathInstanced, NV); |
396 | GET_PROC_SUFFIX(DeletePaths, NV); |
397 | GET_PROC_SUFFIX(GenPaths, NV); |
398 | GET_PROC_SUFFIX(IsPath, NV); |
399 | GET_PROC_SUFFIX(PathCommands, NV); |
400 | GET_PROC_SUFFIX(PathParameterf, NV); |
401 | GET_PROC_SUFFIX(PathParameteri, NV); |
402 | GET_PROC_SUFFIX(PathStencilFunc, NV); |
403 | GET_PROC_SUFFIX(ProgramPathFragmentInputGen, NV); |
404 | GET_PROC_SUFFIX(StencilFillPath, NV); |
405 | GET_PROC_SUFFIX(StencilFillPathInstanced, NV); |
406 | GET_PROC_SUFFIX(StencilStrokePath, NV); |
407 | GET_PROC_SUFFIX(StencilStrokePathInstanced, NV); |
408 | GET_PROC_SUFFIX(StencilThenCoverFillPath, NV); |
409 | GET_PROC_SUFFIX(StencilThenCoverFillPathInstanced, NV); |
410 | GET_PROC_SUFFIX(StencilThenCoverStrokePath, NV); |
411 | GET_PROC_SUFFIX(StencilThenCoverStrokePathInstanced, NV); |
412 | } |
413 | |
414 | if (extensions.has("GL_CHROMIUM_path_rendering" )) { |
415 | GET_PROC_SUFFIX(BindFragmentInputLocation, CHROMIUM); |
416 | } |
417 | |
418 | if (extensions.has("GL_CHROMIUM_framebuffer_mixed_samples" )) { |
419 | GET_PROC_SUFFIX(CoverageModulation, CHROMIUM); |
420 | } else if (extensions.has("GL_NV_framebuffer_mixed_samples" )) { |
421 | GET_PROC_SUFFIX(CoverageModulation, NV); |
422 | } |
423 | |
424 | if (extensions.has("GL_KHR_debug" )) { |
425 | GET_PROC_SUFFIX(DebugMessageCallback, KHR); |
426 | GET_PROC_SUFFIX(DebugMessageControl, KHR); |
427 | GET_PROC_SUFFIX(DebugMessageInsert, KHR); |
428 | GET_PROC_SUFFIX(GetDebugMessageLog, KHR); |
429 | GET_PROC_SUFFIX(ObjectLabel, KHR); |
430 | GET_PROC_SUFFIX(PopDebugGroup, KHR); |
431 | GET_PROC_SUFFIX(PushDebugGroup, KHR); |
432 | } |
433 | |
434 | if (extensions.has("GL_CHROMIUM_bind_uniform_location" )) { |
435 | GET_PROC_SUFFIX(BindUniformLocation, CHROMIUM); |
436 | } |
437 | |
438 | if (extensions.has("GL_EXT_window_rectangles" )) { |
439 | GET_PROC_SUFFIX(WindowRectangles, EXT); |
440 | } |
441 | |
442 | if (glVer >= GR_GL_VER(3,0)) { |
443 | GET_PROC(ClientWaitSync); |
444 | GET_PROC(DeleteSync); |
445 | GET_PROC(FenceSync); |
446 | GET_PROC(IsSync); |
447 | GET_PROC(WaitSync); |
448 | } else if (extensions.has("GL_APPLE_sync" )) { |
449 | GET_PROC_SUFFIX(ClientWaitSync, APPLE); |
450 | GET_PROC_SUFFIX(DeleteSync, APPLE); |
451 | GET_PROC_SUFFIX(FenceSync, APPLE); |
452 | GET_PROC_SUFFIX(IsSync, APPLE); |
453 | GET_PROC_SUFFIX(WaitSync, APPLE); |
454 | } |
455 | |
456 | if (glVer >= GR_GL_VER(3,0)) { |
457 | GET_PROC(GetInternalformativ); |
458 | } |
459 | |
460 | if (glVer >= GR_GL_VER(3,0)) { |
461 | GET_PROC(GetProgramBinary); |
462 | GET_PROC(ProgramBinary); |
463 | } else if (extensions.has("GL_OES_get_program_binary" )) { |
464 | GET_PROC_SUFFIX(GetProgramBinary, OES); |
465 | GET_PROC_SUFFIX(ProgramBinary, OES); |
466 | } |
467 | |
468 | if (glVer >= GR_GL_VER(3,0)) { |
469 | GET_PROC(ProgramParameteri); |
470 | } |
471 | |
472 | if (glVer >= GR_GL_VER(3,0)) { |
473 | GET_PROC(BindSampler); |
474 | GET_PROC(DeleteSamplers); |
475 | GET_PROC(GenSamplers); |
476 | GET_PROC(SamplerParameteri); |
477 | GET_PROC(SamplerParameteriv); |
478 | } |
479 | |
480 | if (glVer >= GR_GL_VER(3,0)) { |
481 | #if GR_TEST_UTILS |
482 | GET_PROC(BeginQuery); |
483 | GET_PROC(DeleteQueries); |
484 | GET_PROC(EndQuery); |
485 | GET_PROC(GenQueries); |
486 | GET_PROC(GetQueryObjectuiv); |
487 | GET_PROC(GetQueryiv); |
488 | #endif |
489 | } else if (extensions.has("GL_EXT_occlusion_query_boolean" )) { |
490 | #if GR_TEST_UTILS |
491 | GET_PROC_SUFFIX(BeginQuery, EXT); |
492 | GET_PROC_SUFFIX(DeleteQueries, EXT); |
493 | GET_PROC_SUFFIX(EndQuery, EXT); |
494 | GET_PROC_SUFFIX(GenQueries, EXT); |
495 | GET_PROC_SUFFIX(GetQueryObjectuiv, EXT); |
496 | GET_PROC_SUFFIX(GetQueryiv, EXT); |
497 | #endif |
498 | } |
499 | |
500 | if (glVer >= GR_GL_VER(3,0)) { |
501 | GET_PROC(InvalidateFramebuffer); |
502 | GET_PROC(InvalidateSubFramebuffer); |
503 | } |
504 | |
505 | GET_PROC(GetShaderPrecisionFormat); |
506 | |
507 | if (extensions.has("GL_NV_fence" )) { |
508 | GET_PROC_SUFFIX(DeleteFences, NV); |
509 | GET_PROC_SUFFIX(FinishFence, NV); |
510 | GET_PROC_SUFFIX(GenFences, NV); |
511 | GET_PROC_SUFFIX(SetFence, NV); |
512 | GET_PROC_SUFFIX(TestFence, NV); |
513 | } |
514 | |
515 | |
516 | // End autogenerated content |
517 | // TODO(kjlubick): Do we want a feature that removes the extension if it doesn't have |
518 | // the function? This is common on some low-end GPUs. |
519 | |
520 | if (extensions.has("GL_KHR_debug" )) { |
521 | // In general we have a policy against removing extension strings when the driver does |
522 | // not provide function pointers for an advertised extension. However, because there is a |
523 | // known device that advertises GL_KHR_debug but fails to provide the functions and this is |
524 | // a debugging- only extension we've made an exception. This also can happen when using |
525 | // APITRACE. |
526 | if (!interface->fFunctions.fDebugMessageControl) { |
527 | extensions.remove("GL_KHR_debug" ); |
528 | } |
529 | } |
530 | interface->fStandard = kGLES_GrGLStandard; |
531 | interface->fExtensions.swap(&extensions); |
532 | |
533 | return std::move(interface); |
534 | } |
535 | #endif |
536 | |