1 // This file specifies which functions should be attached to GrGLInterface
2 // for a given standard (OpenGL, OpenGL ES, etc). It allows specifing
3 // how and when to attach them (e.g. only if an extension is present).
4 // It is used for both the assemble and validate step.
6 // To regenerate the Assemble/Validate code after editing this file, execute:
8 // make -C tools/gpu/gl/interface generate
10 // Currently it assumes the minimum versions:
15 // http://web.eecs.umich.edu/~sugih/courses/eecs487/common/notes/APITables.xml
16 // is a handy reference comparing GL and GLES API
19 "GL": [{"ext": "<core>"}],
20 "GLES": [{"ext": "<core>"}],
21 "WebGL": [{"ext": "<core>"}],
24 "ActiveTexture", "AttachShader", "BindAttribLocation", "BindBuffer",
25 "BindTexture", "BlendColor", "BlendEquation", "BlendFunc",
26 "BufferData", "BufferSubData", "Clear", "ClearColor",
27 "ClearStencil", "ColorMask", "CompileShader", "CompressedTexImage2D",
28 "CompressedTexSubImage2D", "CopyTexSubImage2D", "CreateProgram", "CreateShader",
29 "CullFace", "DeleteBuffers", "DeleteProgram",
30 "DeleteShader", "DeleteTextures", "DepthMask", "Disable",
31 "DisableVertexAttribArray", "DrawArrays", "DrawElements", "Enable",
32 "EnableVertexAttribArray", "Finish", "Flush",
33 "FrontFace", "GenBuffers",
34 "GenTextures", "GetBufferParameteriv", "GetError",
35 "GetFloatv", "GetIntegerv", "GetProgramInfoLog",
36 "GetProgramiv", "GetShaderInfoLog",
37 "GetShaderiv", "GetString",
38 "GetUniformLocation", "IsTexture", "LineWidth", "LinkProgram", "PixelStorei",
39 "ReadPixels", "Scissor", "ShaderSource", "StencilFunc",
40 "StencilFuncSeparate", "StencilMask", "StencilMaskSeparate", "StencilOp",
41 "StencilOpSeparate", "TexImage2D", "TexParameterf", "TexParameterfv", "TexParameteri",
42 "TexParameteriv", "TexSubImage2D", "Uniform1f", "Uniform1fv", "Uniform1i", "Uniform1iv",
43 "Uniform2f", "Uniform2fv", "Uniform2i", "Uniform2iv", "Uniform3f", "Uniform3fv", "Uniform3i",
44 "Uniform3iv", "Uniform4f", "Uniform4fv", "Uniform4i", "Uniform4iv", "UniformMatrix2fv",
45 "UniformMatrix3fv", "UniformMatrix4fv", "UseProgram", "VertexAttrib1f",
46 "VertexAttrib2fv", "VertexAttrib3fv", "VertexAttrib4fv", "VertexAttribPointer",
50 { // GL exclusive core functions
51 "GL": [{"ext": "<core>"}],
55 "DrawBuffer", "PolygonMode",
59 "GL": [{"min_version": [3, 0], "ext": "<core>"}],
60 "GLES": [{"min_version": [3, 0], "ext": "<core>"}],
61 "WebGL": [{"min_version": [2, 0], "ext": "<core>"}],
68 "GL": [{"min_version": [4, 2], "ext": "<core>"}],
69 "GLES": [{"min_version": [3, 1], "ext": "<core>"}],
75 // TODO: Remove 'optional' once Chrome sets this function in the interface.
82 "GL": [{"min_version": [3, 0], "ext": "<core>"},
83 {/* else if */ "ext": "GL_ARB_vertex_array_object"},
84 {/* else if */ "ext": "GL_APPLE_vertex_array_object"}],
85 "GLES": [{"min_version": [3, 0], "ext": "<core>"},
86 {/* else if */ "ext": "GL_OES_vertex_array_object"}],
87 "WebGL": [{"min_version": [2, 0], "ext": "<core>"},
88 {/* else if */ "ext": "GL_OES_vertex_array_object"},
89 {/* else if */ "ext": "OES_vertex_array_object"}],
91 // WebGL uses createVertexArray instead of genVertexArrays, but Emscripten
92 // creates an alias called genVertexArray which papers over this difference.
94 "BindVertexArray", "DeleteVertexArrays", "GenVertexArrays",
99 "GL": [{"min_version": [4, 0], "ext": "<core>"},
100 {/* else if */ "ext": "GL_ARB_tessellation_shader"}],
101 "GLES": [{"min_version": [3, 2], "ext": "<core>"},
102 {/* else if */ "ext": "GL_OES_tessellation_shader"}],
111 "GL": [{"min_version": [3, 0], "ext": "<core>"}],
112 "GLES": [{"min_version": [3, 0], "ext": "GL_EXT_blend_func_extended"}],
116 "BindFragDataLocation",
120 "GL": [{"min_version": [3, 3], "ext": "<core>"},
121 {/* else if */ "ext": "GL_ARB_blend_func_extended"}],
122 "GLES": [{"min_version": [3, 0], "ext": "GL_EXT_blend_func_extended"}],
126 "BindFragDataLocationIndexed",
131 "GL": [{"ext": "GL_KHR_blend_equation_advanced"},
132 {"ext": "GL_NV_blend_equation_advanced"}],
133 "GLES": [{"ext": "GL_KHR_blend_equation_advanced"},
134 {"ext": "GL_NV_blend_equation_advanced"}],
143 "GL": [{"min_version": [4, 4], "ext": "<core>"},
144 {/* else if */ "ext": "GL_ARB_clear_texture"}],
145 "GLES": [{"ext": "GL_EXT_clear_texture", "suffix": "EXT"}],
149 "ClearTexImage", "ClearTexSubImage",
151 // https://bugs.chromium.org/p/skia/issues/detail?id=8913
153 "ClearTexImage", "ClearTexSubImage",
158 "GL": [{"min_version": [3, 1], "ext": "<core>"},
159 {/* else if */ "ext": "GL_ARB_draw_instanced"},
160 {/* else if */ "ext": "GL_EXT_draw_instanced"}],
161 "GLES": [{"min_version": [3, 0], "ext": "<core>"},
162 {/* else if */ "ext": "GL_EXT_draw_instanced"},
163 {/* else if */ "ext": "GL_ANGLE_instanced_arrays"}],
164 "WebGL": [{"min_version": [2, 0], "ext": "<core>"}],
167 "DrawArraysInstanced", "DrawElementsInstanced",
172 "GL": [{"min_version": [4, 2], "ext": "<core>"},
173 {/* else if */ "ext": "GL_ARB_base_instance"}],
174 "GLES": [{"ext": "GL_EXT_base_instance"},
175 {/* else if */ "ext": "GL_ANGLE_base_vertex_base_instance"}],
176 "WebGL": [{"ext": "GL_WEBGL_draw_instanced_base_vertex_base_instance"}],
179 "DrawArraysInstancedBaseInstance", "DrawElementsInstancedBaseVertexBaseInstance"
183 { // ES 3.0 has glDrawBuffers but not glDrawBuffer
184 "GL": [{"ext": "<core>"}],
185 "GLES": [{"min_version": [3, 0], "ext": "<core>"}],
186 "WebGL": [{"min_version": [2, 0], "ext": "<core>"}],
189 "DrawBuffers", "ReadBuffer",
194 "GL": [{"min_version": [4, 0], "ext": "<core>"},
195 {/* else if */ "ext": "GL_ARB_draw_indirect"}],
196 "GLES": [{"min_version": [3, 1], "ext": "<core>"}],
200 "DrawArraysIndirect", "DrawElementsIndirect",
206 "GLES": [{"ext": "GL_ANGLE_base_vertex_base_instance"}],
207 "WebGL": [{"ext": "GL_WEBGL_multi_draw_instanced_base_vertex_base_instance"}],
210 "MultiDrawArraysInstancedBaseInstance", "MultiDrawElementsInstancedBaseVertexBaseInstance",
214 { // glDrawRangeElements was added to ES in 3.0.
215 "GL": [{"ext": "<core>"}],
216 "GLES": [{"min_version": [3, 0], "ext": "<core>"}],
217 "WebGL": [{"min_version": [2, 0], "ext": "<core>"}],
225 "GL": [{"min_version": [3, 2], "ext": "<core>"},
226 {/* else if */ "ext": "GL_ARB_texture_multisample"}],
227 "GLES": [{"min_version": [3, 1], "ext": "<core>"}],
235 // glGetTexLevelParameteriv was added to ES in 3.1.
237 "GL": [{"ext": "<core>"}],
238 "GLES": [{"min_version": [3, 1], "ext": "<core>"}],
242 "GetTexLevelParameteriv",
247 "GL": [{"min_version": [4, 3], "ext": "<core>"},
248 {/* else if */ "ext": "GL_ARB_multi_draw_indirect"}],
249 "GLES": [{"ext": "GL_EXT_multi_draw_indirect"}],
253 "MultiDrawArraysIndirect", "MultiDrawElementsIndirect",
258 "GL": [{"min_version": [3, 1], "ext": "<core>"}],
259 "GLES": [{"min_version": [3, 2], "ext": "<core>"},
260 {/* else if */ "ext": "GL_OES_texture_buffer"},
261 {/* else if */ "ext": "GL_EXT_texture_buffer"}],
269 "GL": [{"min_version": [4, 3], "ext": "<core>"}],
270 "GLES": [{"min_version": [3, 2], "ext": "<core>"},
271 {/* else if */ "ext": "GL_OES_texture_buffer"},
272 {/* else if */ "ext": "GL_EXT_texture_buffer"}],
280 // GL_EXT_texture_storage is part of desktop 4.2
281 // There is a desktop ARB extension and an ES+desktop EXT extension
283 "GL": [{"min_version": [4, 2], "ext": "<core>"},
284 {/* else if */ "ext": "GL_ARB_texture_storage"},
285 {/* else if */ "ext": "GL_EXT_texture_storage"}],
286 "GLES": [{"min_version": [3, 0], "ext": "<core>"},
287 {/* else if */ "ext": "GL_EXT_texture_storage"}],
288 "WebGL": [{"min_version": [2, 0], "ext": "<core>"}],
295 // glTextureBarrier is part of desktop 4.5. There are also ARB and NV extensions.
297 "GL": [{"min_version": [4, 5], "ext": "<core>"},
298 {/* else if */ "ext": "GL_ARB_texture_barrier"},
299 {/* else if */ "ext": "GL_NV_texture_barrier"}],
300 "GLES": [{"ext": "GL_NV_texture_barrier"}],
309 "GL": null, // Not supported
310 "GLES": [{"ext": "GL_EXT_discard_framebuffer"}],
314 "DiscardFramebuffer",
319 "GL": null, // Not supported
320 "GLES": [{"ext": "GL_QCOM_tiled_rendering"}],
324 "StartTiling", "EndTiling",
326 // https://github.com/flutter/flutter/issues/47164
327 // https://github.com/flutter/flutter/issues/47804
329 "StartTiling", "EndTiling",
334 "GL": [{"min_version": [3, 2], "ext": "<core>"},
335 {/* else if */ "ext": "GL_ARB_instanced_arrays"}],
336 "GLES": [{"min_version": [3, 0], "ext": "<core>"},
337 {/* else if */ "ext": "GL_EXT_instanced_arrays"},
338 {/* else if */ "ext": "GL_ANGLE_instanced_arrays"}],
339 "WebGL": [{"min_version": [2, 0], "ext": "<core>"}],
342 "VertexAttribDivisor",
346 "GL": [{"min_version": [3, 0], "ext": "<core>"}],
347 "GLES": [{"min_version": [3, 0], "ext": "<core>"}],
348 "WebGL": [{"min_version": [2, 0], "ext": "<core>"}],
351 "VertexAttribIPointer",
355 // FrameBuffer Object (FBO) related calls
357 "GL": [{"min_version": [3, 0], "ext": "<core>"},
358 {/* else if */ "ext": "GL_ARB_framebuffer_object"},
359 {/* else if */ "ext": "GL_EXT_framebuffer_object"}],
360 "GLES": [{"ext": "<core>"}], // These are all in ES 2.0 and above
361 "WebGL": [{"ext": "<core>"}],
364 "BindFramebuffer", "BindRenderbuffer", "CheckFramebufferStatus",
365 "DeleteFramebuffers", "DeleteRenderbuffers", "FramebufferRenderbuffer",
366 "FramebufferTexture2D", "GenFramebuffers", "GenRenderbuffers", "GenerateMipmap",
367 "GetFramebufferAttachmentParameteriv", "GetRenderbufferParameteriv",
368 "RenderbufferStorage",
372 "GL": [{"min_version": [3, 0], "ext": "<core>"},
373 {/* else if */ "ext": "GL_ARB_framebuffer_object"},
374 {/* else if */ "ext": "GL_EXT_framebuffer_blit"}],
375 "GLES": [{"min_version": [3, 0], "ext": "<core>"},
376 {/* else if */ "ext": "GL_NV_framebuffer_blit"},
377 {/* else if */ "ext": "GL_CHROMIUM_framebuffer_multisample"},
378 {/* else if */ "ext": "GL_ANGLE_framebuffer_blit"}],
379 "WebGL": [{"min_version": [2, 0], "ext": "<core>"}],
386 "GL": [{"min_version": [3, 0], "ext": "<core>"},
387 {/* else if */ "ext": "GL_ARB_framebuffer_object"},
388 {/* else if */ "ext": "GL_EXT_framebuffer_multisample"}],
389 "GLES": [{"min_version": [3, 0], "ext": "<core>"},
390 {/* else if */ "ext": "GL_CHROMIUM_framebuffer_multisample"},
391 {/* else if */ "ext": "GL_ANGLE_framebuffer_multisample"}],
392 "WebGL": [{"min_version": [2, 0], "ext": "<core>"}],
395 "RenderbufferStorageMultisample",
401 "GLES": [{"ext": "GL_CHROMIUM_map_sub"}],
405 "MapBufferSubData", "MapTexSubImage2D", "UnmapBufferSubData",
412 "GLES": [{"ext": "GL_EXT_multisampled_render_to_texture"},
413 {"ext": "GL_IMG_multisampled_render_to_texture"}],
417 "FramebufferTexture2DMultisample",
422 "GLES": [{"ext": "GL_EXT_multisampled_render_to_texture"}],
425 "hardcode_functions" : [
427 "ptr_name": "fRenderbufferStorageMultisampleES2EXT",
428 "cast_name": "GrGLRenderbufferStorageMultisampleFn",
429 "get_name": "glRenderbufferStorageMultisampleEXT",
435 "GLES": [{"ext": "GL_IMG_multisampled_render_to_texture"}],
438 "hardcode_functions" : [
440 "ptr_name": "fRenderbufferStorageMultisampleES2EXT",
441 "cast_name": "GrGLRenderbufferStorageMultisampleFn",
442 "get_name": "glRenderbufferStorageMultisampleIMG",
448 "GLES": [{"ext": "GL_APPLE_framebuffer_multisample"}],
451 "functions" : ["ResolveMultisampleFramebuffer"],
452 "hardcode_functions" : [
454 "ptr_name": "fRenderbufferStorageMultisampleES2APPLE",
455 "cast_name": "GrGLRenderbufferStorageMultisampleFn",
456 "get_name": "glRenderbufferStorageMultisampleAPPLE",
461 // There are several APIs for buffer mapping:
462 // ES2 + GL_OES_mapbuffer: MapBufferOES and UnmapBufferOES
463 // ES2 + GL_EXT_map_buffer_range: Adds MapBufferRangeEXT and FlushMappedBufferRangeEXT
464 // ES3: MapBufferRange, FlushMappedBufferRange, and UnmapBuffer are core (so no suffix).
466 // MapBuffer is not part of ES3, but implementations may still report the OES versions of
467 // MapBuffer and UnmapBuffer, per the older GL_OES_mapbuffer extension. Some implementations
468 // let us mix the newer MapBufferRange with the older UnmapBufferOES, but we've hit others that
469 // don't permit it. Note that in GrGLBuffer, we choose which API to use based on version and
470 // extensions. This code is written so that we never mix OES and non-OES functions.
472 "GL": [{"ext": "<core>"}],
473 "GLES": [{"ext": "GL_OES_mapbuffer"}],
481 "GL": [{"ext": "<core>"}],
482 "GLES": [{"min_version": [3, 0], "ext": "<core>"},
483 {/* else if */ "ext": "GL_OES_mapbuffer"}],
484 "WebGL": null, // explicitly removed https://www.khronos.org/registry/webgl/specs/2.0/#5.14
491 "GL": [{"min_version": [3, 0], "ext": "<core>"},
492 {/* else if */ "ext": "GL_ARB_map_buffer_range"}],
493 "GLES": [{"min_version": [3, 0], "ext": "<core>"},
494 {/* else if */ "ext": "GL_EXT_map_buffer_range"}],
495 "WebGL": null, // explicitly removed https://www.khronos.org/registry/webgl/specs/2.0/#5.14
498 // These functions are added to the 3.0 version of both GLES and GL.
499 "MapBufferRange", "FlushMappedBufferRange",
504 "GL": [{"ext": "GL_EXT_debug_marker"}],
505 "GLES": [{"ext": "GL_EXT_debug_marker"}],
509 "InsertEventMarker", "PushGroupMarker", "PopGroupMarker"
514 "GL": [{"ext": "GL_NV_framebuffer_mixed_samples"}],
515 "GLES": [{"ext": "GL_CHROMIUM_framebuffer_mixed_samples"},
516 {"ext": "GL_NV_framebuffer_mixed_samples"}],
520 "CoverageModulation",
525 "GL": [{"min_version": [4, 3], "ext": "<core>"},
526 {/* else if */ "ext": "GL_KHR_debug", "suffix": ""}],
527 "GLES": [{"ext": "GL_KHR_debug"}],
530 // In OpenGL (but not ES), KHR_debug defines these methods to have no suffix.
532 "DebugMessageControl", "DebugMessageInsert", "DebugMessageCallback",
533 "GetDebugMessageLog", "PushDebugGroup", "PopDebugGroup", "ObjectLabel",
539 "GLES": [{"ext": "GL_CHROMIUM_bind_uniform_location"}],
543 "BindUniformLocation",
548 "GL": [{"ext": "GL_EXT_window_rectangles"}],
549 "GLES": [{"ext": "GL_EXT_window_rectangles"}],
558 "GL": [{"min_version": [3, 2], "ext": "<core>"},
559 {/* else if */ "ext": "GL_ARB_sync"}],
560 "GLES": [{"min_version": [3, 0], "ext": "<core>"},
561 {/* else if */ "ext": "GL_APPLE_sync"}],
562 "WebGL": [{"min_version": [2, 0], "ext": "<core>"}],
565 "ClientWaitSync", "DeleteSync", "FenceSync",
570 { // getInternalformativ was added in GL 4.2, ES 3.0, and with
571 // extension ARB_internalformat_query
572 "GL": [{"min_version": [4, 2], "ext": "<core>"},
573 {/* else if */ "ext": "GL_ARB_internalformat_query"}],
574 "GLES": [{"min_version": [3, 0], "ext": "<core>"}],
578 "GetInternalformativ"
582 // GetProgramBinary and ProgramBinary are available with an ES2 extension...
584 "GL": [{"min_version": [4, 1], "ext": "<core>"}],
585 "GLES": [{"min_version": [3, 0], "ext": "<core>"},
586 {/* else if */ "ext": "GL_OES_get_program_binary"}],
587 "WebGL": null, // explicitly not supported in WebGL 2.0
590 "GetProgramBinary", "ProgramBinary",
594 // ... but the related ProgramParameteri is only in ES3
596 "GL": [{"min_version": [4, 1], "ext": "<core>"}],
597 "GLES": [{"min_version": [3, 0], "ext": "<core>"}],
598 "WebGL": null, // explicitly not supported in WebGL 2.0
606 "GL": [{"min_version": [3, 2], "ext": "<core>"},
607 {/* else if */ "ext": "GL_ARB_sampler_objects"}],
608 "GLES": [{"min_version": [3, 0], "ext": "<core>"}],
609 "WebGL": [{"min_version": [2, 0], "ext": "<core>"}],
612 "BindSampler", "DeleteSamplers", "GenSamplers",
613 "SamplerParameterf", "SamplerParameteri", "SamplerParameteriv",
618 "GL": [{"ext": "<core>"}],
619 "GLES": null, // not in ES
627 "GL": [{"ext": "<core>"}],
628 "GLES": [{"min_version": [3, 0], "ext": "<core>"},
629 {/* else if */ "ext": "GL_EXT_occlusion_query_boolean"}],
632 // We only use these in our test tools
634 "GenQueries", "DeleteQueries", "BeginQuery", "EndQuery",
635 "GetQueryObjectuiv", "GetQueryiv",
639 "GL": [{"min_version": [3, 3], "ext": "<core>"},
640 {/* else if */ "ext": "GL_ARB_timer_query"},
641 {/* else if */ "ext": "GL_EXT_timer_query"}],
646 "GetQueryObjecti64v", "GetQueryObjectui64v",
650 "GL": [{"min_version": [3, 3], "ext": "<core>"},
651 {/* else if */ "ext": "GL_ARB_timer_query"}],
661 "GL": [{"min_version": [4, 3], "ext": "<core>"},
662 {/* else if */ "ext": "GL_ARB_invalidate_subdata"}],
667 "InvalidateBufferData", "InvalidateBufferSubData", "InvalidateTexImage",
668 "InvalidateTexSubImage",
671 { // ES 3.0 adds the framebuffer functions but not the others.
672 "GL": [{"min_version": [4, 3], "ext": "<core>"},
673 {/* else if */ "ext": "GL_ARB_invalidate_subdata"}],
674 "GLES": [{"min_version": [3, 0], "ext": "<core>"}],
675 "WebGL": [{"min_version": [2, 0], "ext": "<core>"}],
678 "InvalidateFramebuffer", "InvalidateSubFramebuffer",
683 "GL": [{"min_version": [4, 3], "ext": "<core>"},
684 {/* else if */ "ext": "GL_ARB_ES2_compatibility"}],
685 "GLES": [{"ext": "<core>"}],
686 "WebGL": [{"ext": "<core>"}],
689 "GetShaderPrecisionFormat",
694 "GL": [{"ext": "GL_NV_fence"}],
695 "GLES": [{"ext": "GL_NV_fence"}],
699 "DeleteFences", "FinishFence", "GenFences", "SetFence", "TestFence",