123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732 |
- /*
- * Copyright 2011 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- *
- * THIS FILE IS AUTOGENERATED
- * Make edits to tools/gpu/gl/interface/templates.go or they will
- * be overwritten.
- */
- #include "include/gpu/gl/GrGLExtensions.h"
- #include "include/gpu/gl/GrGLInterface.h"
- #include "src/gpu/gl/GrGLUtil.h"
- #include <stdio.h>
- GrGLInterface::GrGLInterface() {
- fStandard = kNone_GrGLStandard;
- }
- #define RETURN_FALSE_INTERFACE \
- SkDEBUGF("%s:%d GrGLInterface::validate() failed.\n", __FILE__, __LINE__); \
- return false
- bool GrGLInterface::validate() const {
- if (kNone_GrGLStandard == fStandard) {
- RETURN_FALSE_INTERFACE;
- }
- if (!fExtensions.isInitialized()) {
- RETURN_FALSE_INTERFACE;
- }
- GrGLVersion glVer = GrGLGetVersion(this);
- if (GR_GL_INVALID_VER == glVer) {
- RETURN_FALSE_INTERFACE;
- }
- // Autogenerated content follows
- if (!fFunctions.fActiveTexture ||
- !fFunctions.fAttachShader ||
- !fFunctions.fBindAttribLocation ||
- !fFunctions.fBindBuffer ||
- !fFunctions.fBindTexture ||
- !fFunctions.fBlendColor ||
- !fFunctions.fBlendEquation ||
- !fFunctions.fBlendFunc ||
- !fFunctions.fBufferData ||
- !fFunctions.fBufferSubData ||
- !fFunctions.fClear ||
- !fFunctions.fClearColor ||
- !fFunctions.fClearStencil ||
- !fFunctions.fColorMask ||
- !fFunctions.fCompileShader ||
- !fFunctions.fCompressedTexImage2D ||
- !fFunctions.fCompressedTexSubImage2D ||
- !fFunctions.fCopyTexSubImage2D ||
- !fFunctions.fCreateProgram ||
- !fFunctions.fCreateShader ||
- !fFunctions.fCullFace ||
- !fFunctions.fDeleteBuffers ||
- !fFunctions.fDeleteProgram ||
- !fFunctions.fDeleteShader ||
- !fFunctions.fDeleteTextures ||
- !fFunctions.fDepthMask ||
- !fFunctions.fDisable ||
- !fFunctions.fDisableVertexAttribArray ||
- !fFunctions.fDrawArrays ||
- !fFunctions.fDrawElements ||
- !fFunctions.fEnable ||
- !fFunctions.fEnableVertexAttribArray ||
- !fFunctions.fFinish ||
- !fFunctions.fFlush ||
- !fFunctions.fFrontFace ||
- !fFunctions.fGenBuffers ||
- !fFunctions.fGenTextures ||
- !fFunctions.fGetBufferParameteriv ||
- !fFunctions.fGetError ||
- !fFunctions.fGetIntegerv ||
- !fFunctions.fGetProgramInfoLog ||
- !fFunctions.fGetProgramiv ||
- !fFunctions.fGetShaderInfoLog ||
- !fFunctions.fGetShaderiv ||
- !fFunctions.fGetString ||
- !fFunctions.fGetUniformLocation ||
- !fFunctions.fIsTexture ||
- !fFunctions.fLineWidth ||
- !fFunctions.fLinkProgram ||
- !fFunctions.fPixelStorei ||
- !fFunctions.fReadPixels ||
- !fFunctions.fScissor ||
- !fFunctions.fShaderSource ||
- !fFunctions.fStencilFunc ||
- !fFunctions.fStencilFuncSeparate ||
- !fFunctions.fStencilMask ||
- !fFunctions.fStencilMaskSeparate ||
- !fFunctions.fStencilOp ||
- !fFunctions.fStencilOpSeparate ||
- !fFunctions.fTexImage2D ||
- !fFunctions.fTexParameterf ||
- !fFunctions.fTexParameterfv ||
- !fFunctions.fTexParameteri ||
- !fFunctions.fTexParameteriv ||
- !fFunctions.fTexSubImage2D ||
- !fFunctions.fUniform1f ||
- !fFunctions.fUniform1fv ||
- !fFunctions.fUniform1i ||
- !fFunctions.fUniform1iv ||
- !fFunctions.fUniform2f ||
- !fFunctions.fUniform2fv ||
- !fFunctions.fUniform2i ||
- !fFunctions.fUniform2iv ||
- !fFunctions.fUniform3f ||
- !fFunctions.fUniform3fv ||
- !fFunctions.fUniform3i ||
- !fFunctions.fUniform3iv ||
- !fFunctions.fUniform4f ||
- !fFunctions.fUniform4fv ||
- !fFunctions.fUniform4i ||
- !fFunctions.fUniform4iv ||
- !fFunctions.fUniformMatrix2fv ||
- !fFunctions.fUniformMatrix3fv ||
- !fFunctions.fUniformMatrix4fv ||
- !fFunctions.fUseProgram ||
- !fFunctions.fVertexAttrib1f ||
- !fFunctions.fVertexAttrib2fv ||
- !fFunctions.fVertexAttrib3fv ||
- !fFunctions.fVertexAttrib4fv ||
- !fFunctions.fVertexAttribPointer ||
- !fFunctions.fViewport) {
- RETURN_FALSE_INTERFACE;
- }
- if (GR_IS_GR_GL(fStandard)) {
- if (!fFunctions.fDrawBuffer ||
- !fFunctions.fPolygonMode) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(3,0)))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,0)))) ||
- (GR_IS_GR_WEBGL(fStandard) && (
- (glVer >= GR_GL_VER(2,0))))) {
- if (!fFunctions.fGetStringi) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if (GR_IS_GR_GL(fStandard) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,0)) ||
- fExtensions.has("GL_OES_vertex_array_object"))) ||
- (GR_IS_GR_WEBGL(fStandard) && (
- (glVer >= GR_GL_VER(2,0)) ||
- fExtensions.has("GL_OES_vertex_array_object") ||
- fExtensions.has("OES_vertex_array_object")))) {
- if (!fFunctions.fBindVertexArray ||
- !fFunctions.fDeleteVertexArrays ||
- !fFunctions.fGenVertexArrays) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(3,0)))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,0) && fExtensions.has("GL_EXT_blend_func_extended"))))) {
- if (!fFunctions.fBindFragDataLocation) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(3,3)) ||
- fExtensions.has("GL_ARB_blend_func_extended"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,0) && fExtensions.has("GL_EXT_blend_func_extended"))))) {
- if (!fFunctions.fBindFragDataLocationIndexed) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- fExtensions.has("GL_KHR_blend_equation_advanced") ||
- fExtensions.has("GL_NV_blend_equation_advanced"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- fExtensions.has("GL_KHR_blend_equation_advanced") ||
- fExtensions.has("GL_NV_blend_equation_advanced")))) {
- if (!fFunctions.fBlendBarrier) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(4,4)) ||
- fExtensions.has("GL_ARB_clear_texture"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- fExtensions.has("GL_EXT_clear_texture")))) {
- // all functions were marked optional or test_only
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(3,1)) ||
- fExtensions.has("GL_ARB_draw_instanced") ||
- fExtensions.has("GL_EXT_draw_instanced"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,0)) ||
- fExtensions.has("GL_EXT_draw_instanced"))) ||
- (GR_IS_GR_WEBGL(fStandard) && (
- (glVer >= GR_GL_VER(2,0))))) {
- if (!fFunctions.fDrawArraysInstanced ||
- !fFunctions.fDrawElementsInstanced) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if (GR_IS_GR_GL(fStandard) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,0)))) ||
- (GR_IS_GR_WEBGL(fStandard) && (
- (glVer >= GR_GL_VER(2,0))))) {
- if (!fFunctions.fDrawBuffers ||
- !fFunctions.fReadBuffer) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(4,0)) ||
- fExtensions.has("GL_ARB_draw_indirect"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,1))))) {
- if (!fFunctions.fDrawArraysIndirect ||
- !fFunctions.fDrawElementsIndirect) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if (GR_IS_GR_GL(fStandard) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,0)))) ||
- (GR_IS_GR_WEBGL(fStandard) && (
- (glVer >= GR_GL_VER(2,0))))) {
- if (!fFunctions.fDrawRangeElements) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(3,2)) ||
- fExtensions.has("GL_ARB_texture_multisample"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,1))))) {
- if (!fFunctions.fGetMultisamplefv) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if (GR_IS_GR_GL(fStandard) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,1))))) {
- if (!fFunctions.fGetTexLevelParameteriv) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(4,3)) ||
- fExtensions.has("GL_ARB_multi_draw_indirect"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- fExtensions.has("GL_EXT_multi_draw_indirect")))) {
- if (!fFunctions.fMultiDrawArraysIndirect ||
- !fFunctions.fMultiDrawElementsIndirect) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(3,1)))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,2)) ||
- fExtensions.has("GL_OES_texture_buffer") ||
- fExtensions.has("GL_EXT_texture_buffer")))) {
- if (!fFunctions.fTexBuffer) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(4,3)))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,2)) ||
- fExtensions.has("GL_OES_texture_buffer") ||
- fExtensions.has("GL_EXT_texture_buffer")))) {
- if (!fFunctions.fTexBufferRange) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(4,2)) ||
- fExtensions.has("GL_ARB_texture_storage") ||
- fExtensions.has("GL_EXT_texture_storage"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,0)) ||
- fExtensions.has("GL_EXT_texture_storage"))) ||
- (GR_IS_GR_WEBGL(fStandard) && (
- (glVer >= GR_GL_VER(2,0))))) {
- if (!fFunctions.fTexStorage2D) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(4,5)) ||
- fExtensions.has("GL_ARB_texture_barrier") ||
- fExtensions.has("GL_NV_texture_barrier"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- fExtensions.has("GL_NV_texture_barrier")))) {
- if (!fFunctions.fTextureBarrier) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL_ES(fStandard) && (
- fExtensions.has("GL_EXT_discard_framebuffer")))) {
- if (!fFunctions.fDiscardFramebuffer) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(3,2)) ||
- fExtensions.has("GL_ARB_instanced_arrays"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,0)) ||
- fExtensions.has("GL_EXT_instanced_arrays")))) {
- if (!fFunctions.fVertexAttribDivisor) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(3,0)))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,0)))) ||
- (GR_IS_GR_WEBGL(fStandard) && (
- (glVer >= GR_GL_VER(2,0))))) {
- if (!fFunctions.fVertexAttribIPointer) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(3,0)) ||
- fExtensions.has("GL_ARB_framebuffer_object") ||
- fExtensions.has("GL_EXT_framebuffer_object"))) ||
- GR_IS_GR_GL_ES(fStandard) ||
- GR_IS_GR_WEBGL(fStandard)) {
- if (!fFunctions.fBindFramebuffer ||
- !fFunctions.fBindRenderbuffer ||
- !fFunctions.fCheckFramebufferStatus ||
- !fFunctions.fDeleteFramebuffers ||
- !fFunctions.fDeleteRenderbuffers ||
- !fFunctions.fFramebufferRenderbuffer ||
- !fFunctions.fFramebufferTexture2D ||
- !fFunctions.fGenFramebuffers ||
- !fFunctions.fGenRenderbuffers ||
- !fFunctions.fGenerateMipmap ||
- !fFunctions.fGetFramebufferAttachmentParameteriv ||
- !fFunctions.fGetRenderbufferParameteriv ||
- !fFunctions.fRenderbufferStorage) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(3,0)) ||
- fExtensions.has("GL_ARB_framebuffer_object") ||
- fExtensions.has("GL_EXT_framebuffer_blit"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,0)) ||
- fExtensions.has("GL_CHROMIUM_framebuffer_multisample") ||
- fExtensions.has("GL_ANGLE_framebuffer_blit")))) {
- if (!fFunctions.fBlitFramebuffer) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(3,0)) ||
- fExtensions.has("GL_ARB_framebuffer_object") ||
- fExtensions.has("GL_EXT_framebuffer_multisample"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,0)) ||
- fExtensions.has("GL_CHROMIUM_framebuffer_multisample") ||
- fExtensions.has("GL_ANGLE_framebuffer_multisample"))) ||
- (GR_IS_GR_WEBGL(fStandard) && (
- (glVer >= GR_GL_VER(2,0))))) {
- if (!fFunctions.fRenderbufferStorageMultisample) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL_ES(fStandard) && (
- fExtensions.has("GL_CHROMIUM_map_sub")))) {
- if (!fFunctions.fMapBufferSubData ||
- !fFunctions.fMapTexSubImage2D ||
- !fFunctions.fUnmapBufferSubData ||
- !fFunctions.fUnmapTexSubImage2D) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL_ES(fStandard) && (
- fExtensions.has("GL_EXT_multisampled_render_to_texture") ||
- fExtensions.has("GL_IMG_multisampled_render_to_texture")))) {
- if (!fFunctions.fFramebufferTexture2DMultisample) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL_ES(fStandard) && (
- fExtensions.has("GL_EXT_multisampled_render_to_texture")))) {
- if (!fFunctions.fRenderbufferStorageMultisampleES2EXT) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL_ES(fStandard) && (
- fExtensions.has("GL_IMG_multisampled_render_to_texture")))) {
- if (!fFunctions.fRenderbufferStorageMultisampleES2EXT) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL_ES(fStandard) && (
- fExtensions.has("GL_APPLE_framebuffer_multisample")))) {
- if (!fFunctions.fResolveMultisampleFramebuffer ||
- !fFunctions.fRenderbufferStorageMultisampleES2APPLE) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if (GR_IS_GR_GL(fStandard) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- fExtensions.has("GL_OES_mapbuffer")))) {
- if (!fFunctions.fMapBuffer) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if (GR_IS_GR_GL(fStandard) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,0)) ||
- fExtensions.has("GL_OES_mapbuffer")))) {
- if (!fFunctions.fUnmapBuffer) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(3,0)) ||
- fExtensions.has("GL_ARB_map_buffer_range"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,0)) ||
- fExtensions.has("GL_EXT_map_buffer_range")))) {
- if (!fFunctions.fFlushMappedBufferRange ||
- !fFunctions.fMapBufferRange) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- fExtensions.has("GL_EXT_debug_marker"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- fExtensions.has("GL_EXT_debug_marker")))) {
- if (!fFunctions.fInsertEventMarker ||
- !fFunctions.fPopGroupMarker ||
- !fFunctions.fPushGroupMarker) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(4,3)) ||
- fExtensions.has("GL_ARB_program_interface_query"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,1))))) {
- if (!fFunctions.fGetProgramResourceLocation) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- fExtensions.has("GL_NV_path_rendering"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- fExtensions.has("GL_CHROMIUM_path_rendering") ||
- fExtensions.has("GL_NV_path_rendering")))) {
- if (!fFunctions.fMatrixLoadIdentity ||
- !fFunctions.fMatrixLoadf) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- fExtensions.has("GL_NV_path_rendering"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- fExtensions.has("GL_CHROMIUM_path_rendering") ||
- fExtensions.has("GL_NV_path_rendering")))) {
- if (!fFunctions.fCoverFillPath ||
- !fFunctions.fCoverFillPathInstanced ||
- !fFunctions.fCoverStrokePath ||
- !fFunctions.fCoverStrokePathInstanced ||
- !fFunctions.fDeletePaths ||
- !fFunctions.fGenPaths ||
- !fFunctions.fIsPath ||
- !fFunctions.fPathCommands ||
- !fFunctions.fPathParameterf ||
- !fFunctions.fPathParameteri ||
- !fFunctions.fPathStencilFunc ||
- !fFunctions.fStencilFillPath ||
- !fFunctions.fStencilFillPathInstanced ||
- !fFunctions.fStencilStrokePath ||
- !fFunctions.fStencilStrokePathInstanced) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL_ES(fStandard) && (
- fExtensions.has("GL_CHROMIUM_path_rendering")))) {
- if (!fFunctions.fBindFragmentInputLocation) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- fExtensions.has("GL_NV_framebuffer_mixed_samples"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- fExtensions.has("GL_CHROMIUM_framebuffer_mixed_samples") ||
- fExtensions.has("GL_NV_framebuffer_mixed_samples")))) {
- if (!fFunctions.fCoverageModulation) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(4,3)) ||
- fExtensions.has("GL_KHR_debug"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- fExtensions.has("GL_KHR_debug")))) {
- if (!fFunctions.fDebugMessageCallback ||
- !fFunctions.fDebugMessageControl ||
- !fFunctions.fDebugMessageInsert ||
- !fFunctions.fGetDebugMessageLog ||
- !fFunctions.fObjectLabel ||
- !fFunctions.fPopDebugGroup ||
- !fFunctions.fPushDebugGroup) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL_ES(fStandard) && (
- fExtensions.has("GL_CHROMIUM_bind_uniform_location")))) {
- if (!fFunctions.fBindUniformLocation) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- fExtensions.has("GL_EXT_window_rectangles"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- fExtensions.has("GL_EXT_window_rectangles")))) {
- if (!fFunctions.fWindowRectangles) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(3,2)) ||
- fExtensions.has("GL_ARB_sync"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,0)) ||
- fExtensions.has("GL_APPLE_sync"))) ||
- (GR_IS_GR_WEBGL(fStandard) && (
- (glVer >= GR_GL_VER(2,0))))) {
- if (!fFunctions.fClientWaitSync ||
- !fFunctions.fDeleteSync ||
- !fFunctions.fFenceSync ||
- !fFunctions.fIsSync ||
- !fFunctions.fWaitSync) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(4,2)) ||
- fExtensions.has("GL_ARB_internalformat_query"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,0))))) {
- if (!fFunctions.fGetInternalformativ) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(4,1)))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,0)) ||
- fExtensions.has("GL_OES_get_program_binary")))) {
- if (!fFunctions.fGetProgramBinary ||
- !fFunctions.fProgramBinary) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(4,1)))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,0))))) {
- if (!fFunctions.fProgramParameteri) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(3,2)) ||
- fExtensions.has("GL_ARB_sampler_objects"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,0)))) ||
- (GR_IS_GR_WEBGL(fStandard) && (
- (glVer >= GR_GL_VER(2,0))))) {
- if (!fFunctions.fBindSampler ||
- !fFunctions.fDeleteSamplers ||
- !fFunctions.fGenSamplers ||
- !fFunctions.fSamplerParameteri ||
- !fFunctions.fSamplerParameteriv) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if (GR_IS_GR_GL(fStandard)) {
- if (!fFunctions.fGetQueryObjectiv) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if (GR_IS_GR_GL(fStandard) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,0)) ||
- fExtensions.has("GL_EXT_occlusion_query_boolean")))) {
- #if GR_TEST_UTILS
- if (!fFunctions.fBeginQuery ||
- !fFunctions.fDeleteQueries ||
- !fFunctions.fEndQuery ||
- !fFunctions.fGenQueries ||
- !fFunctions.fGetQueryObjectuiv ||
- !fFunctions.fGetQueryiv) {
- RETURN_FALSE_INTERFACE;
- }
- #endif
- // all functions were marked optional or test_only
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(3,3)) ||
- fExtensions.has("GL_ARB_timer_query") ||
- fExtensions.has("GL_EXT_timer_query")))) {
- if (!fFunctions.fGetQueryObjecti64v ||
- !fFunctions.fGetQueryObjectui64v) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(3,3)) ||
- fExtensions.has("GL_ARB_timer_query")))) {
- if (!fFunctions.fQueryCounter) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(4,3)) ||
- fExtensions.has("GL_ARB_invalidate_subdata")))) {
- if (!fFunctions.fInvalidateBufferData ||
- !fFunctions.fInvalidateBufferSubData ||
- !fFunctions.fInvalidateTexImage ||
- !fFunctions.fInvalidateTexSubImage) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(4,3)) ||
- fExtensions.has("GL_ARB_invalidate_subdata"))) ||
- (GR_IS_GR_GL_ES(fStandard) && (
- (glVer >= GR_GL_VER(3,0)))) ||
- (GR_IS_GR_WEBGL(fStandard) && (
- (glVer >= GR_GL_VER(2,0))))) {
- if (!fFunctions.fInvalidateFramebuffer ||
- !fFunctions.fInvalidateSubFramebuffer) {
- RETURN_FALSE_INTERFACE;
- }
- }
- if ((GR_IS_GR_GL(fStandard) && (
- (glVer >= GR_GL_VER(4,3)) ||
- fExtensions.has("GL_ARB_ES2_compatibility"))) ||
- GR_IS_GR_GL_ES(fStandard) ||
- GR_IS_GR_WEBGL(fStandard)) {
- if (!fFunctions.fGetShaderPrecisionFormat) {
- RETURN_FALSE_INTERFACE;
- }
- }
- // End autogenerated content
- return true;
- }
- #if GR_TEST_UTILS
- void GrGLInterface::abandon() const {
- const_cast<GrGLInterface*>(this)->fFunctions = GrGLInterface::Functions();
- }
- #endif // GR_TEST_UTILS
|