1cb93a386Sopenharmony_ci/*
2cb93a386Sopenharmony_ci * Copyright 2019 Google LLC
3cb93a386Sopenharmony_ci *
4cb93a386Sopenharmony_ci * Use of this source code is governed by a BSD-style license that can be
5cb93a386Sopenharmony_ci * found in the LICENSE file.
6cb93a386Sopenharmony_ci *
7cb93a386Sopenharmony_ci * THIS FILE IS AUTOGENERATED
8cb93a386Sopenharmony_ci * Make edits to tools/gpu/gl/interface/templates.go or they will
9cb93a386Sopenharmony_ci * be overwritten.
10cb93a386Sopenharmony_ci */
11cb93a386Sopenharmony_ci
12cb93a386Sopenharmony_ci#include "include/gpu/gl/GrGLAssembleHelpers.h"
13cb93a386Sopenharmony_ci#include "include/gpu/gl/GrGLAssembleInterface.h"
14cb93a386Sopenharmony_ci#include "src/gpu/gl/GrGLUtil.h"
15cb93a386Sopenharmony_ci
16cb93a386Sopenharmony_ci#define GET_PROC(F) functions->f##F = (GrGL##F##Fn*)get(ctx, "gl" #F)
17cb93a386Sopenharmony_ci#define GET_PROC_SUFFIX(F, S) functions->f##F = (GrGL##F##Fn*)get(ctx, "gl" #F #S)
18cb93a386Sopenharmony_ci#define GET_PROC_LOCAL(F) GrGL##F##Fn* F = (GrGL##F##Fn*)get(ctx, "gl" #F)
19cb93a386Sopenharmony_ci
20cb93a386Sopenharmony_ci#define GET_EGL_PROC_SUFFIX(F, S) functions->fEGL##F = (GrEGL##F##Fn*)get(ctx, "egl" #F #S)
21cb93a386Sopenharmony_ci
22cb93a386Sopenharmony_ci#if SK_DISABLE_GL_INTERFACE
23cb93a386Sopenharmony_cisk_sp<const GrGLInterface> GrGLMakeAssembledGLInterface(void *ctx, GrGLGetProc get) {
24cb93a386Sopenharmony_ci    return nullptr;
25cb93a386Sopenharmony_ci}
26cb93a386Sopenharmony_ci#else
27cb93a386Sopenharmony_cisk_sp<const GrGLInterface> GrGLMakeAssembledGLInterface(void *ctx, GrGLGetProc get) {
28cb93a386Sopenharmony_ci    GET_PROC_LOCAL(GetString);
29cb93a386Sopenharmony_ci    GET_PROC_LOCAL(GetStringi);
30cb93a386Sopenharmony_ci    GET_PROC_LOCAL(GetIntegerv);
31cb93a386Sopenharmony_ci
32cb93a386Sopenharmony_ci    // GetStringi may be nullptr depending on the GL version.
33cb93a386Sopenharmony_ci    if (nullptr == GetString || nullptr == GetIntegerv) {
34cb93a386Sopenharmony_ci        return nullptr;
35cb93a386Sopenharmony_ci    }
36cb93a386Sopenharmony_ci
37cb93a386Sopenharmony_ci    const char* versionString = (const char*) GetString(GR_GL_VERSION);
38cb93a386Sopenharmony_ci    GrGLVersion glVer = GrGLGetVersionFromString(versionString);
39cb93a386Sopenharmony_ci
40cb93a386Sopenharmony_ci    if (glVer < GR_GL_VER(2,0) || GR_GL_INVALID_VER == glVer) {
41cb93a386Sopenharmony_ci        // This is our minimum for non-ES GL.
42cb93a386Sopenharmony_ci        return nullptr;
43cb93a386Sopenharmony_ci    }
44cb93a386Sopenharmony_ci
45cb93a386Sopenharmony_ci    GrEGLQueryStringFn* queryString;
46cb93a386Sopenharmony_ci    GrEGLDisplay display;
47cb93a386Sopenharmony_ci    GrGetEGLQueryAndDisplay(&queryString, &display, ctx, get);
48cb93a386Sopenharmony_ci    GrGLExtensions extensions;
49cb93a386Sopenharmony_ci    if (!extensions.init(kGL_GrGLStandard, GetString, GetStringi, GetIntegerv, queryString,
50cb93a386Sopenharmony_ci                         display)) {
51cb93a386Sopenharmony_ci        return nullptr;
52cb93a386Sopenharmony_ci    }
53cb93a386Sopenharmony_ci
54cb93a386Sopenharmony_ci    sk_sp<GrGLInterface> interface(new GrGLInterface());
55cb93a386Sopenharmony_ci    GrGLInterface::Functions* functions = &interface->fFunctions;
56cb93a386Sopenharmony_ci
57cb93a386Sopenharmony_ci    // Autogenerated content follows
58cb93a386Sopenharmony_ci    GET_PROC(ActiveTexture);
59cb93a386Sopenharmony_ci    GET_PROC(AttachShader);
60cb93a386Sopenharmony_ci    GET_PROC(BindAttribLocation);
61cb93a386Sopenharmony_ci    GET_PROC(BindBuffer);
62cb93a386Sopenharmony_ci    GET_PROC(BindTexture);
63cb93a386Sopenharmony_ci    GET_PROC(BlendColor);
64cb93a386Sopenharmony_ci    GET_PROC(BlendEquation);
65cb93a386Sopenharmony_ci    GET_PROC(BlendFunc);
66cb93a386Sopenharmony_ci    GET_PROC(BufferData);
67cb93a386Sopenharmony_ci    GET_PROC(BufferSubData);
68cb93a386Sopenharmony_ci    GET_PROC(Clear);
69cb93a386Sopenharmony_ci    GET_PROC(ClearColor);
70cb93a386Sopenharmony_ci    GET_PROC(ClearStencil);
71cb93a386Sopenharmony_ci    GET_PROC(ColorMask);
72cb93a386Sopenharmony_ci    GET_PROC(CompileShader);
73cb93a386Sopenharmony_ci    GET_PROC(CompressedTexImage2D);
74cb93a386Sopenharmony_ci    GET_PROC(CompressedTexSubImage2D);
75cb93a386Sopenharmony_ci    GET_PROC(CopyTexSubImage2D);
76cb93a386Sopenharmony_ci    GET_PROC(CreateProgram);
77cb93a386Sopenharmony_ci    GET_PROC(CreateShader);
78cb93a386Sopenharmony_ci    GET_PROC(CullFace);
79cb93a386Sopenharmony_ci    GET_PROC(DeleteBuffers);
80cb93a386Sopenharmony_ci    GET_PROC(DeleteProgram);
81cb93a386Sopenharmony_ci    GET_PROC(DeleteShader);
82cb93a386Sopenharmony_ci    GET_PROC(DeleteTextures);
83cb93a386Sopenharmony_ci    GET_PROC(DepthMask);
84cb93a386Sopenharmony_ci    GET_PROC(Disable);
85cb93a386Sopenharmony_ci    GET_PROC(DisableVertexAttribArray);
86cb93a386Sopenharmony_ci    GET_PROC(DrawArrays);
87cb93a386Sopenharmony_ci    GET_PROC(DrawElements);
88cb93a386Sopenharmony_ci    GET_PROC(Enable);
89cb93a386Sopenharmony_ci    GET_PROC(EnableVertexAttribArray);
90cb93a386Sopenharmony_ci    GET_PROC(Finish);
91cb93a386Sopenharmony_ci    GET_PROC(Flush);
92cb93a386Sopenharmony_ci    GET_PROC(FrontFace);
93cb93a386Sopenharmony_ci    GET_PROC(GenBuffers);
94cb93a386Sopenharmony_ci    GET_PROC(GenTextures);
95cb93a386Sopenharmony_ci    GET_PROC(GetBufferParameteriv);
96cb93a386Sopenharmony_ci    GET_PROC(GetError);
97cb93a386Sopenharmony_ci    GET_PROC(GetIntegerv);
98cb93a386Sopenharmony_ci    GET_PROC(GetProgramInfoLog);
99cb93a386Sopenharmony_ci    GET_PROC(GetProgramiv);
100cb93a386Sopenharmony_ci    GET_PROC(GetShaderInfoLog);
101cb93a386Sopenharmony_ci    GET_PROC(GetShaderiv);
102cb93a386Sopenharmony_ci    GET_PROC(GetString);
103cb93a386Sopenharmony_ci    GET_PROC(GetUniformLocation);
104cb93a386Sopenharmony_ci    GET_PROC(IsTexture);
105cb93a386Sopenharmony_ci    GET_PROC(LineWidth);
106cb93a386Sopenharmony_ci    GET_PROC(LinkProgram);
107cb93a386Sopenharmony_ci    GET_PROC(PixelStorei);
108cb93a386Sopenharmony_ci    GET_PROC(ReadPixels);
109cb93a386Sopenharmony_ci    GET_PROC(Scissor);
110cb93a386Sopenharmony_ci    GET_PROC(ShaderSource);
111cb93a386Sopenharmony_ci    GET_PROC(StencilFunc);
112cb93a386Sopenharmony_ci    GET_PROC(StencilFuncSeparate);
113cb93a386Sopenharmony_ci    GET_PROC(StencilMask);
114cb93a386Sopenharmony_ci    GET_PROC(StencilMaskSeparate);
115cb93a386Sopenharmony_ci    GET_PROC(StencilOp);
116cb93a386Sopenharmony_ci    GET_PROC(StencilOpSeparate);
117cb93a386Sopenharmony_ci    GET_PROC(TexImage2D);
118cb93a386Sopenharmony_ci    GET_PROC(TexParameterf);
119cb93a386Sopenharmony_ci    GET_PROC(TexParameterfv);
120cb93a386Sopenharmony_ci    GET_PROC(TexParameteri);
121cb93a386Sopenharmony_ci    GET_PROC(TexParameteriv);
122cb93a386Sopenharmony_ci    GET_PROC(TexSubImage2D);
123cb93a386Sopenharmony_ci    GET_PROC(Uniform1f);
124cb93a386Sopenharmony_ci    GET_PROC(Uniform1fv);
125cb93a386Sopenharmony_ci    GET_PROC(Uniform1i);
126cb93a386Sopenharmony_ci    GET_PROC(Uniform1iv);
127cb93a386Sopenharmony_ci    GET_PROC(Uniform2f);
128cb93a386Sopenharmony_ci    GET_PROC(Uniform2fv);
129cb93a386Sopenharmony_ci    GET_PROC(Uniform2i);
130cb93a386Sopenharmony_ci    GET_PROC(Uniform2iv);
131cb93a386Sopenharmony_ci    GET_PROC(Uniform3f);
132cb93a386Sopenharmony_ci    GET_PROC(Uniform3fv);
133cb93a386Sopenharmony_ci    GET_PROC(Uniform3i);
134cb93a386Sopenharmony_ci    GET_PROC(Uniform3iv);
135cb93a386Sopenharmony_ci    GET_PROC(Uniform4f);
136cb93a386Sopenharmony_ci    GET_PROC(Uniform4fv);
137cb93a386Sopenharmony_ci    GET_PROC(Uniform4i);
138cb93a386Sopenharmony_ci    GET_PROC(Uniform4iv);
139cb93a386Sopenharmony_ci    GET_PROC(UniformMatrix2fv);
140cb93a386Sopenharmony_ci    GET_PROC(UniformMatrix3fv);
141cb93a386Sopenharmony_ci    GET_PROC(UniformMatrix4fv);
142cb93a386Sopenharmony_ci    GET_PROC(UseProgram);
143cb93a386Sopenharmony_ci    GET_PROC(VertexAttrib1f);
144cb93a386Sopenharmony_ci    GET_PROC(VertexAttrib2fv);
145cb93a386Sopenharmony_ci    GET_PROC(VertexAttrib3fv);
146cb93a386Sopenharmony_ci    GET_PROC(VertexAttrib4fv);
147cb93a386Sopenharmony_ci    GET_PROC(VertexAttribPointer);
148cb93a386Sopenharmony_ci    GET_PROC(Viewport);
149cb93a386Sopenharmony_ci
150cb93a386Sopenharmony_ci    GET_PROC(DrawBuffer);
151cb93a386Sopenharmony_ci    GET_PROC(PolygonMode);
152cb93a386Sopenharmony_ci
153cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(3,0)) {
154cb93a386Sopenharmony_ci        GET_PROC(GetStringi);
155cb93a386Sopenharmony_ci    }
156cb93a386Sopenharmony_ci
157cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(4,2)) {
158cb93a386Sopenharmony_ci        GET_PROC(MemoryBarrier);
159cb93a386Sopenharmony_ci    }
160cb93a386Sopenharmony_ci
161cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(3,0)) {
162cb93a386Sopenharmony_ci        GET_PROC(BindVertexArray);
163cb93a386Sopenharmony_ci        GET_PROC(DeleteVertexArrays);
164cb93a386Sopenharmony_ci        GET_PROC(GenVertexArrays);
165cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_vertex_array_object")) {
166cb93a386Sopenharmony_ci        GET_PROC(BindVertexArray);
167cb93a386Sopenharmony_ci        GET_PROC(DeleteVertexArrays);
168cb93a386Sopenharmony_ci        GET_PROC(GenVertexArrays);
169cb93a386Sopenharmony_ci    } else if (extensions.has("GL_APPLE_vertex_array_object")) {
170cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(BindVertexArray, APPLE);
171cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(DeleteVertexArrays, APPLE);
172cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(GenVertexArrays, APPLE);
173cb93a386Sopenharmony_ci    }
174cb93a386Sopenharmony_ci
175cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(4,0)) {
176cb93a386Sopenharmony_ci        GET_PROC(PatchParameteri);
177cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_tessellation_shader")) {
178cb93a386Sopenharmony_ci        GET_PROC(PatchParameteri);
179cb93a386Sopenharmony_ci    }
180cb93a386Sopenharmony_ci
181cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(3,0)) {
182cb93a386Sopenharmony_ci        GET_PROC(BindFragDataLocation);
183cb93a386Sopenharmony_ci    }
184cb93a386Sopenharmony_ci
185cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(3,3)) {
186cb93a386Sopenharmony_ci        GET_PROC(BindFragDataLocationIndexed);
187cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_blend_func_extended")) {
188cb93a386Sopenharmony_ci        GET_PROC(BindFragDataLocationIndexed);
189cb93a386Sopenharmony_ci    }
190cb93a386Sopenharmony_ci
191cb93a386Sopenharmony_ci    if (extensions.has("GL_KHR_blend_equation_advanced")) {
192cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(BlendBarrier, KHR);
193cb93a386Sopenharmony_ci    } else if (extensions.has("GL_NV_blend_equation_advanced")) {
194cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(BlendBarrier, NV);
195cb93a386Sopenharmony_ci    }
196cb93a386Sopenharmony_ci
197cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(4,4)) {
198cb93a386Sopenharmony_ci        GET_PROC(ClearTexImage);
199cb93a386Sopenharmony_ci        GET_PROC(ClearTexSubImage);
200cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_clear_texture")) {
201cb93a386Sopenharmony_ci        GET_PROC(ClearTexImage);
202cb93a386Sopenharmony_ci        GET_PROC(ClearTexSubImage);
203cb93a386Sopenharmony_ci    }
204cb93a386Sopenharmony_ci
205cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(3,1)) {
206cb93a386Sopenharmony_ci        GET_PROC(DrawArraysInstanced);
207cb93a386Sopenharmony_ci        GET_PROC(DrawElementsInstanced);
208cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_draw_instanced")) {
209cb93a386Sopenharmony_ci        GET_PROC(DrawArraysInstanced);
210cb93a386Sopenharmony_ci        GET_PROC(DrawElementsInstanced);
211cb93a386Sopenharmony_ci    } else if (extensions.has("GL_EXT_draw_instanced")) {
212cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(DrawArraysInstanced, EXT);
213cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(DrawElementsInstanced, EXT);
214cb93a386Sopenharmony_ci    }
215cb93a386Sopenharmony_ci
216cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(4,2)) {
217cb93a386Sopenharmony_ci        GET_PROC(DrawArraysInstancedBaseInstance);
218cb93a386Sopenharmony_ci        GET_PROC(DrawElementsInstancedBaseVertexBaseInstance);
219cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_base_instance")) {
220cb93a386Sopenharmony_ci        GET_PROC(DrawArraysInstancedBaseInstance);
221cb93a386Sopenharmony_ci        GET_PROC(DrawElementsInstancedBaseVertexBaseInstance);
222cb93a386Sopenharmony_ci    }
223cb93a386Sopenharmony_ci
224cb93a386Sopenharmony_ci    GET_PROC(DrawBuffers);
225cb93a386Sopenharmony_ci    GET_PROC(ReadBuffer);
226cb93a386Sopenharmony_ci
227cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(4,0)) {
228cb93a386Sopenharmony_ci        GET_PROC(DrawArraysIndirect);
229cb93a386Sopenharmony_ci        GET_PROC(DrawElementsIndirect);
230cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_draw_indirect")) {
231cb93a386Sopenharmony_ci        GET_PROC(DrawArraysIndirect);
232cb93a386Sopenharmony_ci        GET_PROC(DrawElementsIndirect);
233cb93a386Sopenharmony_ci    }
234cb93a386Sopenharmony_ci
235cb93a386Sopenharmony_ci    GET_PROC(DrawRangeElements);
236cb93a386Sopenharmony_ci
237cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(3,2)) {
238cb93a386Sopenharmony_ci        GET_PROC(GetMultisamplefv);
239cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_texture_multisample")) {
240cb93a386Sopenharmony_ci        GET_PROC(GetMultisamplefv);
241cb93a386Sopenharmony_ci    }
242cb93a386Sopenharmony_ci
243cb93a386Sopenharmony_ci    GET_PROC(GetTexLevelParameteriv);
244cb93a386Sopenharmony_ci
245cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(4,3)) {
246cb93a386Sopenharmony_ci        GET_PROC(MultiDrawArraysIndirect);
247cb93a386Sopenharmony_ci        GET_PROC(MultiDrawElementsIndirect);
248cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_multi_draw_indirect")) {
249cb93a386Sopenharmony_ci        GET_PROC(MultiDrawArraysIndirect);
250cb93a386Sopenharmony_ci        GET_PROC(MultiDrawElementsIndirect);
251cb93a386Sopenharmony_ci    }
252cb93a386Sopenharmony_ci
253cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(3,1)) {
254cb93a386Sopenharmony_ci        GET_PROC(TexBuffer);
255cb93a386Sopenharmony_ci    }
256cb93a386Sopenharmony_ci
257cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(4,3)) {
258cb93a386Sopenharmony_ci        GET_PROC(TexBufferRange);
259cb93a386Sopenharmony_ci    }
260cb93a386Sopenharmony_ci
261cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(4,2)) {
262cb93a386Sopenharmony_ci        GET_PROC(TexStorage2D);
263cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_texture_storage")) {
264cb93a386Sopenharmony_ci        GET_PROC(TexStorage2D);
265cb93a386Sopenharmony_ci    } else if (extensions.has("GL_EXT_texture_storage")) {
266cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(TexStorage2D, EXT);
267cb93a386Sopenharmony_ci    }
268cb93a386Sopenharmony_ci
269cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(4,5)) {
270cb93a386Sopenharmony_ci        GET_PROC(TextureBarrier);
271cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_texture_barrier")) {
272cb93a386Sopenharmony_ci        GET_PROC(TextureBarrier);
273cb93a386Sopenharmony_ci    } else if (extensions.has("GL_NV_texture_barrier")) {
274cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(TextureBarrier, NV);
275cb93a386Sopenharmony_ci    }
276cb93a386Sopenharmony_ci
277cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(3,2)) {
278cb93a386Sopenharmony_ci        GET_PROC(VertexAttribDivisor);
279cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_instanced_arrays")) {
280cb93a386Sopenharmony_ci        GET_PROC(VertexAttribDivisor);
281cb93a386Sopenharmony_ci    }
282cb93a386Sopenharmony_ci
283cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(3,0)) {
284cb93a386Sopenharmony_ci        GET_PROC(VertexAttribIPointer);
285cb93a386Sopenharmony_ci    }
286cb93a386Sopenharmony_ci
287cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(3,0)) {
288cb93a386Sopenharmony_ci        GET_PROC(BindFramebuffer);
289cb93a386Sopenharmony_ci        GET_PROC(BindRenderbuffer);
290cb93a386Sopenharmony_ci        GET_PROC(CheckFramebufferStatus);
291cb93a386Sopenharmony_ci        GET_PROC(DeleteFramebuffers);
292cb93a386Sopenharmony_ci        GET_PROC(DeleteRenderbuffers);
293cb93a386Sopenharmony_ci        GET_PROC(FramebufferRenderbuffer);
294cb93a386Sopenharmony_ci        GET_PROC(FramebufferTexture2D);
295cb93a386Sopenharmony_ci        GET_PROC(GenFramebuffers);
296cb93a386Sopenharmony_ci        GET_PROC(GenRenderbuffers);
297cb93a386Sopenharmony_ci        GET_PROC(GenerateMipmap);
298cb93a386Sopenharmony_ci        GET_PROC(GetFramebufferAttachmentParameteriv);
299cb93a386Sopenharmony_ci        GET_PROC(GetRenderbufferParameteriv);
300cb93a386Sopenharmony_ci        GET_PROC(RenderbufferStorage);
301cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_framebuffer_object")) {
302cb93a386Sopenharmony_ci        GET_PROC(BindFramebuffer);
303cb93a386Sopenharmony_ci        GET_PROC(BindRenderbuffer);
304cb93a386Sopenharmony_ci        GET_PROC(CheckFramebufferStatus);
305cb93a386Sopenharmony_ci        GET_PROC(DeleteFramebuffers);
306cb93a386Sopenharmony_ci        GET_PROC(DeleteRenderbuffers);
307cb93a386Sopenharmony_ci        GET_PROC(FramebufferRenderbuffer);
308cb93a386Sopenharmony_ci        GET_PROC(FramebufferTexture2D);
309cb93a386Sopenharmony_ci        GET_PROC(GenFramebuffers);
310cb93a386Sopenharmony_ci        GET_PROC(GenRenderbuffers);
311cb93a386Sopenharmony_ci        GET_PROC(GenerateMipmap);
312cb93a386Sopenharmony_ci        GET_PROC(GetFramebufferAttachmentParameteriv);
313cb93a386Sopenharmony_ci        GET_PROC(GetRenderbufferParameteriv);
314cb93a386Sopenharmony_ci        GET_PROC(RenderbufferStorage);
315cb93a386Sopenharmony_ci    } else if (extensions.has("GL_EXT_framebuffer_object")) {
316cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(BindFramebuffer, EXT);
317cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(BindRenderbuffer, EXT);
318cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(CheckFramebufferStatus, EXT);
319cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(DeleteFramebuffers, EXT);
320cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(DeleteRenderbuffers, EXT);
321cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(FramebufferRenderbuffer, EXT);
322cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(FramebufferTexture2D, EXT);
323cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(GenFramebuffers, EXT);
324cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(GenRenderbuffers, EXT);
325cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(GenerateMipmap, EXT);
326cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(GetFramebufferAttachmentParameteriv, EXT);
327cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(GetRenderbufferParameteriv, EXT);
328cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(RenderbufferStorage, EXT);
329cb93a386Sopenharmony_ci    }
330cb93a386Sopenharmony_ci
331cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(3,0)) {
332cb93a386Sopenharmony_ci        GET_PROC(BlitFramebuffer);
333cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_framebuffer_object")) {
334cb93a386Sopenharmony_ci        GET_PROC(BlitFramebuffer);
335cb93a386Sopenharmony_ci    } else if (extensions.has("GL_EXT_framebuffer_blit")) {
336cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(BlitFramebuffer, EXT);
337cb93a386Sopenharmony_ci    }
338cb93a386Sopenharmony_ci
339cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(3,0)) {
340cb93a386Sopenharmony_ci        GET_PROC(RenderbufferStorageMultisample);
341cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_framebuffer_object")) {
342cb93a386Sopenharmony_ci        GET_PROC(RenderbufferStorageMultisample);
343cb93a386Sopenharmony_ci    } else if (extensions.has("GL_EXT_framebuffer_multisample")) {
344cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(RenderbufferStorageMultisample, EXT);
345cb93a386Sopenharmony_ci    }
346cb93a386Sopenharmony_ci
347cb93a386Sopenharmony_ci    GET_PROC(MapBuffer);
348cb93a386Sopenharmony_ci
349cb93a386Sopenharmony_ci    GET_PROC(UnmapBuffer);
350cb93a386Sopenharmony_ci
351cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(3,0)) {
352cb93a386Sopenharmony_ci        GET_PROC(FlushMappedBufferRange);
353cb93a386Sopenharmony_ci        GET_PROC(MapBufferRange);
354cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_map_buffer_range")) {
355cb93a386Sopenharmony_ci        GET_PROC(FlushMappedBufferRange);
356cb93a386Sopenharmony_ci        GET_PROC(MapBufferRange);
357cb93a386Sopenharmony_ci    }
358cb93a386Sopenharmony_ci
359cb93a386Sopenharmony_ci    if (extensions.has("GL_EXT_debug_marker")) {
360cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(InsertEventMarker, EXT);
361cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(PopGroupMarker, EXT);
362cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(PushGroupMarker, EXT);
363cb93a386Sopenharmony_ci    }
364cb93a386Sopenharmony_ci
365cb93a386Sopenharmony_ci    if (extensions.has("GL_NV_framebuffer_mixed_samples")) {
366cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(CoverageModulation, NV);
367cb93a386Sopenharmony_ci    }
368cb93a386Sopenharmony_ci
369cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(4,3)) {
370cb93a386Sopenharmony_ci        GET_PROC(DebugMessageCallback);
371cb93a386Sopenharmony_ci        GET_PROC(DebugMessageControl);
372cb93a386Sopenharmony_ci        GET_PROC(DebugMessageInsert);
373cb93a386Sopenharmony_ci        GET_PROC(GetDebugMessageLog);
374cb93a386Sopenharmony_ci        GET_PROC(ObjectLabel);
375cb93a386Sopenharmony_ci        GET_PROC(PopDebugGroup);
376cb93a386Sopenharmony_ci        GET_PROC(PushDebugGroup);
377cb93a386Sopenharmony_ci    } else if (extensions.has("GL_KHR_debug")) {
378cb93a386Sopenharmony_ci        GET_PROC(DebugMessageCallback);
379cb93a386Sopenharmony_ci        GET_PROC(DebugMessageControl);
380cb93a386Sopenharmony_ci        GET_PROC(DebugMessageInsert);
381cb93a386Sopenharmony_ci        GET_PROC(GetDebugMessageLog);
382cb93a386Sopenharmony_ci        GET_PROC(ObjectLabel);
383cb93a386Sopenharmony_ci        GET_PROC(PopDebugGroup);
384cb93a386Sopenharmony_ci        GET_PROC(PushDebugGroup);
385cb93a386Sopenharmony_ci    }
386cb93a386Sopenharmony_ci
387cb93a386Sopenharmony_ci    if (extensions.has("GL_EXT_window_rectangles")) {
388cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(WindowRectangles, EXT);
389cb93a386Sopenharmony_ci    }
390cb93a386Sopenharmony_ci
391cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(3,2)) {
392cb93a386Sopenharmony_ci        GET_PROC(ClientWaitSync);
393cb93a386Sopenharmony_ci        GET_PROC(DeleteSync);
394cb93a386Sopenharmony_ci        GET_PROC(FenceSync);
395cb93a386Sopenharmony_ci        GET_PROC(IsSync);
396cb93a386Sopenharmony_ci        GET_PROC(WaitSync);
397cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_sync")) {
398cb93a386Sopenharmony_ci        GET_PROC(ClientWaitSync);
399cb93a386Sopenharmony_ci        GET_PROC(DeleteSync);
400cb93a386Sopenharmony_ci        GET_PROC(FenceSync);
401cb93a386Sopenharmony_ci        GET_PROC(IsSync);
402cb93a386Sopenharmony_ci        GET_PROC(WaitSync);
403cb93a386Sopenharmony_ci    }
404cb93a386Sopenharmony_ci
405cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(4,2)) {
406cb93a386Sopenharmony_ci        GET_PROC(GetInternalformativ);
407cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_internalformat_query")) {
408cb93a386Sopenharmony_ci        GET_PROC(GetInternalformativ);
409cb93a386Sopenharmony_ci    }
410cb93a386Sopenharmony_ci
411cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(4,1)) {
412cb93a386Sopenharmony_ci        GET_PROC(GetProgramBinary);
413cb93a386Sopenharmony_ci        GET_PROC(ProgramBinary);
414cb93a386Sopenharmony_ci    }
415cb93a386Sopenharmony_ci
416cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(4,1)) {
417cb93a386Sopenharmony_ci        GET_PROC(ProgramParameteri);
418cb93a386Sopenharmony_ci    }
419cb93a386Sopenharmony_ci
420cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(3,2)) {
421cb93a386Sopenharmony_ci        GET_PROC(BindSampler);
422cb93a386Sopenharmony_ci        GET_PROC(DeleteSamplers);
423cb93a386Sopenharmony_ci        GET_PROC(GenSamplers);
424cb93a386Sopenharmony_ci        GET_PROC(SamplerParameteri);
425cb93a386Sopenharmony_ci        GET_PROC(SamplerParameteriv);
426cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_sampler_objects")) {
427cb93a386Sopenharmony_ci        GET_PROC(BindSampler);
428cb93a386Sopenharmony_ci        GET_PROC(DeleteSamplers);
429cb93a386Sopenharmony_ci        GET_PROC(GenSamplers);
430cb93a386Sopenharmony_ci        GET_PROC(SamplerParameteri);
431cb93a386Sopenharmony_ci        GET_PROC(SamplerParameteriv);
432cb93a386Sopenharmony_ci    }
433cb93a386Sopenharmony_ci
434cb93a386Sopenharmony_ci    GET_PROC(GetQueryObjectiv);
435cb93a386Sopenharmony_ci
436cb93a386Sopenharmony_ci#if GR_TEST_UTILS
437cb93a386Sopenharmony_ci    GET_PROC(BeginQuery);
438cb93a386Sopenharmony_ci    GET_PROC(DeleteQueries);
439cb93a386Sopenharmony_ci    GET_PROC(EndQuery);
440cb93a386Sopenharmony_ci    GET_PROC(GenQueries);
441cb93a386Sopenharmony_ci    GET_PROC(GetQueryObjectuiv);
442cb93a386Sopenharmony_ci    GET_PROC(GetQueryiv);
443cb93a386Sopenharmony_ci#endif
444cb93a386Sopenharmony_ci
445cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(3,3)) {
446cb93a386Sopenharmony_ci        GET_PROC(GetQueryObjecti64v);
447cb93a386Sopenharmony_ci        GET_PROC(GetQueryObjectui64v);
448cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_timer_query")) {
449cb93a386Sopenharmony_ci        GET_PROC(GetQueryObjecti64v);
450cb93a386Sopenharmony_ci        GET_PROC(GetQueryObjectui64v);
451cb93a386Sopenharmony_ci    } else if (extensions.has("GL_EXT_timer_query")) {
452cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(GetQueryObjecti64v, EXT);
453cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(GetQueryObjectui64v, EXT);
454cb93a386Sopenharmony_ci    }
455cb93a386Sopenharmony_ci
456cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(3,3)) {
457cb93a386Sopenharmony_ci        GET_PROC(QueryCounter);
458cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_timer_query")) {
459cb93a386Sopenharmony_ci        GET_PROC(QueryCounter);
460cb93a386Sopenharmony_ci    }
461cb93a386Sopenharmony_ci
462cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(4,3)) {
463cb93a386Sopenharmony_ci        GET_PROC(InvalidateBufferData);
464cb93a386Sopenharmony_ci        GET_PROC(InvalidateBufferSubData);
465cb93a386Sopenharmony_ci        GET_PROC(InvalidateTexImage);
466cb93a386Sopenharmony_ci        GET_PROC(InvalidateTexSubImage);
467cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_invalidate_subdata")) {
468cb93a386Sopenharmony_ci        GET_PROC(InvalidateBufferData);
469cb93a386Sopenharmony_ci        GET_PROC(InvalidateBufferSubData);
470cb93a386Sopenharmony_ci        GET_PROC(InvalidateTexImage);
471cb93a386Sopenharmony_ci        GET_PROC(InvalidateTexSubImage);
472cb93a386Sopenharmony_ci    }
473cb93a386Sopenharmony_ci
474cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(4,3)) {
475cb93a386Sopenharmony_ci        GET_PROC(InvalidateFramebuffer);
476cb93a386Sopenharmony_ci        GET_PROC(InvalidateSubFramebuffer);
477cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_invalidate_subdata")) {
478cb93a386Sopenharmony_ci        GET_PROC(InvalidateFramebuffer);
479cb93a386Sopenharmony_ci        GET_PROC(InvalidateSubFramebuffer);
480cb93a386Sopenharmony_ci    }
481cb93a386Sopenharmony_ci
482cb93a386Sopenharmony_ci    if (glVer >= GR_GL_VER(4,3)) {
483cb93a386Sopenharmony_ci        GET_PROC(GetShaderPrecisionFormat);
484cb93a386Sopenharmony_ci    } else if (extensions.has("GL_ARB_ES2_compatibility")) {
485cb93a386Sopenharmony_ci        GET_PROC(GetShaderPrecisionFormat);
486cb93a386Sopenharmony_ci    }
487cb93a386Sopenharmony_ci
488cb93a386Sopenharmony_ci    if (extensions.has("GL_NV_fence")) {
489cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(DeleteFences, NV);
490cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(FinishFence, NV);
491cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(GenFences, NV);
492cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(SetFence, NV);
493cb93a386Sopenharmony_ci        GET_PROC_SUFFIX(TestFence, NV);
494cb93a386Sopenharmony_ci    }
495cb93a386Sopenharmony_ci
496cb93a386Sopenharmony_ci
497cb93a386Sopenharmony_ci    // End autogenerated content
498cb93a386Sopenharmony_ci    interface->fStandard = kGL_GrGLStandard;
499cb93a386Sopenharmony_ci    interface->fExtensions.swap(&extensions);
500cb93a386Sopenharmony_ci
501cb93a386Sopenharmony_ci    return std::move(interface);
502cb93a386Sopenharmony_ci}
503cb93a386Sopenharmony_ci#endif
504