2011-07-28 14:26:00 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2011 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
2011-03-14 21:23:01 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GrGLInterface_DEFINED
|
|
|
|
#define GrGLInterface_DEFINED
|
|
|
|
|
2012-05-07 21:33:56 +00:00
|
|
|
#include "GrGLFunctions.h"
|
2014-01-17 15:05:38 +00:00
|
|
|
#include "GrGLExtensions.h"
|
2013-09-09 13:38:37 +00:00
|
|
|
#include "SkRefCnt.h"
|
2011-03-14 21:23:01 +00:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2011-08-19 13:28:54 +00:00
|
|
|
/**
|
|
|
|
* Rather than depend on platform-specific GL headers and libraries, we require
|
|
|
|
* the client to provide a struct of GL function pointers. This struct can be
|
|
|
|
* specified per-GrContext as a parameter to GrContext::Create. If NULL is
|
2014-01-15 19:32:03 +00:00
|
|
|
* passed to Create then a "default" GL interface is created. If the default is
|
2011-08-19 13:28:54 +00:00
|
|
|
* also NULL GrContext creation will fail.
|
|
|
|
*
|
2011-09-16 18:51:57 +00:00
|
|
|
* The default interface is returned by GrGLDefaultInterface. This function's
|
2012-03-19 14:42:13 +00:00
|
|
|
* implementation is platform-specific. Several have been provided, along with
|
2014-01-15 19:32:03 +00:00
|
|
|
* an implementation that simply returns NULL.
|
2011-09-01 13:28:16 +00:00
|
|
|
*
|
|
|
|
* By defining GR_GL_PER_GL_CALL_IFACE_CALLBACK to 1 the client can specify a
|
|
|
|
* callback function that will be called prior to each GL function call. See
|
|
|
|
* comments in GrGLConfig.h
|
2011-03-14 21:23:01 +00:00
|
|
|
*/
|
2011-08-19 13:28:54 +00:00
|
|
|
|
2015-06-23 20:23:44 +00:00
|
|
|
typedef void(*GrGLFuncPtr)();
|
|
|
|
|
2011-03-14 21:23:01 +00:00
|
|
|
struct GrGLInterface;
|
|
|
|
|
2011-09-16 18:51:57 +00:00
|
|
|
const GrGLInterface* GrGLDefaultInterface();
|
2011-03-14 21:23:01 +00:00
|
|
|
|
2011-10-24 21:17:53 +00:00
|
|
|
/**
|
|
|
|
* Creates a GrGLInterface for a "native" GL context (e.g. WGL on windows,
|
2014-01-15 19:32:03 +00:00
|
|
|
* GLX on linux, AGL on Mac). The interface is only valid for the GL context
|
|
|
|
* that is current when the interface is created.
|
2011-10-24 21:17:53 +00:00
|
|
|
*/
|
2015-09-21 15:22:19 +00:00
|
|
|
SK_API const GrGLInterface* GrGLCreateNativeInterface();
|
2011-10-19 20:43:20 +00:00
|
|
|
|
2016-03-31 01:56:19 +00:00
|
|
|
#if GR_GL_PER_GL_FUNC_CALLBACK
|
|
|
|
typedef void (*GrGLInterfaceCallbackProc)(const GrGLInterface*);
|
|
|
|
typedef intptr_t GrGLInterfaceCallbackData;
|
2015-08-27 17:38:39 +00:00
|
|
|
#endif
|
|
|
|
|
2011-10-27 20:44:19 +00:00
|
|
|
/**
|
|
|
|
* Creates a null GrGLInterface that doesn't draw anything. Used for measuring
|
2016-03-31 01:56:19 +00:00
|
|
|
* CPU overhead. TODO: We would like to move this to tools/gpu/gl/null but currently
|
|
|
|
* Chromium is using it in its unit tests.
|
2011-10-27 20:44:19 +00:00
|
|
|
*/
|
2016-04-20 07:36:53 +00:00
|
|
|
const SK_API GrGLInterface* GrGLCreateNullInterface(bool enableNVPR = false);
|
2011-10-27 20:44:19 +00:00
|
|
|
|
2014-02-21 18:45:30 +00:00
|
|
|
/** Function that returns a new interface identical to "interface" but with support for
|
|
|
|
test version of GL_EXT_debug_marker. */
|
|
|
|
const GrGLInterface* GrGLInterfaceAddTestDebugMarker(const GrGLInterface*,
|
|
|
|
GrGLInsertEventMarkerProc insertEventMarkerFn,
|
|
|
|
GrGLPushGroupMarkerProc pushGroupMarkerFn,
|
|
|
|
GrGLPopGroupMarkerProc popGroupMarkerFn);
|
|
|
|
|
2014-01-24 20:49:44 +00:00
|
|
|
/**
|
2012-05-07 21:45:48 +00:00
|
|
|
* GrContext uses the following interface to make all calls into OpenGL. When a
|
|
|
|
* GrContext is created it is given a GrGLInterface. The interface's function
|
|
|
|
* pointers must be valid for the OpenGL context associated with the GrContext.
|
|
|
|
* On some platforms, such as Windows, function pointers for OpenGL extensions
|
|
|
|
* may vary between OpenGL contexts. So the caller must be careful to use a
|
|
|
|
* GrGLInterface initialized for the correct context. All functions that should
|
|
|
|
* be available based on the OpenGL's version and extension string must be
|
|
|
|
* non-NULL or GrContext creation will fail. This can be tested with the
|
|
|
|
* validate() method when the OpenGL context has been made current.
|
2011-05-04 12:35:39 +00:00
|
|
|
*/
|
2013-09-09 13:38:37 +00:00
|
|
|
struct SK_API GrGLInterface : public SkRefCnt {
|
2012-03-29 21:04:52 +00:00
|
|
|
private:
|
2013-09-09 13:38:37 +00:00
|
|
|
typedef SkRefCnt INHERITED;
|
2012-06-21 20:25:03 +00:00
|
|
|
|
2012-03-29 21:04:52 +00:00
|
|
|
public:
|
2011-08-19 13:28:54 +00:00
|
|
|
GrGLInterface();
|
|
|
|
|
2014-01-24 20:49:44 +00:00
|
|
|
static GrGLInterface* NewClone(const GrGLInterface*);
|
|
|
|
|
2014-01-16 16:35:09 +00:00
|
|
|
// Validates that the GrGLInterface supports its advertised standard. This means the necessary
|
|
|
|
// function pointers have been initialized for both the GL version and any advertised
|
|
|
|
// extensions.
|
|
|
|
bool validate() const;
|
2012-02-10 20:05:18 +00:00
|
|
|
|
2014-01-16 16:35:09 +00:00
|
|
|
// Indicates the type of GL implementation
|
|
|
|
union {
|
|
|
|
GrGLStandard fStandard;
|
|
|
|
GrGLStandard fBindingsExported; // Legacy name, will be remove when Chromium is updated.
|
|
|
|
};
|
2011-03-18 20:41:44 +00:00
|
|
|
|
2014-01-17 15:05:38 +00:00
|
|
|
GrGLExtensions fExtensions;
|
|
|
|
|
2014-02-28 20:28:50 +00:00
|
|
|
bool hasExtension(const char ext[]) const { return fExtensions.has(ext); }
|
2014-01-17 15:05:38 +00:00
|
|
|
|
2014-01-21 16:09:18 +00:00
|
|
|
/**
|
|
|
|
* The function pointers are in a struct so that we can have a compiler generated assignment
|
|
|
|
* operator.
|
|
|
|
*/
|
|
|
|
struct Functions {
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLActiveTextureProc> fActiveTexture;
|
|
|
|
GrGLFunction<GrGLAttachShaderProc> fAttachShader;
|
|
|
|
GrGLFunction<GrGLBeginQueryProc> fBeginQuery;
|
|
|
|
GrGLFunction<GrGLBindAttribLocationProc> fBindAttribLocation;
|
|
|
|
GrGLFunction<GrGLBindBufferProc> fBindBuffer;
|
|
|
|
GrGLFunction<GrGLBindFragDataLocationProc> fBindFragDataLocation;
|
|
|
|
GrGLFunction<GrGLBindFragDataLocationIndexedProc> fBindFragDataLocationIndexed;
|
|
|
|
GrGLFunction<GrGLBindFramebufferProc> fBindFramebuffer;
|
|
|
|
GrGLFunction<GrGLBindRenderbufferProc> fBindRenderbuffer;
|
|
|
|
GrGLFunction<GrGLBindTextureProc> fBindTexture;
|
2016-11-15 17:36:29 +00:00
|
|
|
GrGLFunction<GrGLBindImageTextureProc> fBindImageTexture;
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLBindVertexArrayProc> fBindVertexArray;
|
|
|
|
GrGLFunction<GrGLBlendBarrierProc> fBlendBarrier;
|
|
|
|
GrGLFunction<GrGLBlendColorProc> fBlendColor;
|
|
|
|
GrGLFunction<GrGLBlendEquationProc> fBlendEquation;
|
|
|
|
GrGLFunction<GrGLBlendFuncProc> fBlendFunc;
|
|
|
|
GrGLFunction<GrGLBlitFramebufferProc> fBlitFramebuffer;
|
|
|
|
GrGLFunction<GrGLBufferDataProc> fBufferData;
|
|
|
|
GrGLFunction<GrGLBufferSubDataProc> fBufferSubData;
|
|
|
|
GrGLFunction<GrGLCheckFramebufferStatusProc> fCheckFramebufferStatus;
|
|
|
|
GrGLFunction<GrGLClearProc> fClear;
|
|
|
|
GrGLFunction<GrGLClearColorProc> fClearColor;
|
|
|
|
GrGLFunction<GrGLClearStencilProc> fClearStencil;
|
2017-05-23 20:53:47 +00:00
|
|
|
GrGLFunction<GrGLClearTexImageProc> fClearTexImage;
|
|
|
|
GrGLFunction<GrGLClearTexSubImageProc> fClearTexSubImage;
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLColorMaskProc> fColorMask;
|
|
|
|
GrGLFunction<GrGLCompileShaderProc> fCompileShader;
|
|
|
|
GrGLFunction<GrGLCompressedTexImage2DProc> fCompressedTexImage2D;
|
|
|
|
GrGLFunction<GrGLCompressedTexSubImage2DProc> fCompressedTexSubImage2D;
|
|
|
|
GrGLFunction<GrGLCopyTexSubImage2DProc> fCopyTexSubImage2D;
|
|
|
|
GrGLFunction<GrGLCreateProgramProc> fCreateProgram;
|
|
|
|
GrGLFunction<GrGLCreateShaderProc> fCreateShader;
|
|
|
|
GrGLFunction<GrGLCullFaceProc> fCullFace;
|
|
|
|
GrGLFunction<GrGLDeleteBuffersProc> fDeleteBuffers;
|
|
|
|
GrGLFunction<GrGLDeleteFramebuffersProc> fDeleteFramebuffers;
|
|
|
|
GrGLFunction<GrGLDeleteProgramProc> fDeleteProgram;
|
|
|
|
GrGLFunction<GrGLDeleteQueriesProc> fDeleteQueries;
|
|
|
|
GrGLFunction<GrGLDeleteRenderbuffersProc> fDeleteRenderbuffers;
|
|
|
|
GrGLFunction<GrGLDeleteShaderProc> fDeleteShader;
|
|
|
|
GrGLFunction<GrGLDeleteTexturesProc> fDeleteTextures;
|
|
|
|
GrGLFunction<GrGLDeleteVertexArraysProc> fDeleteVertexArrays;
|
|
|
|
GrGLFunction<GrGLDepthMaskProc> fDepthMask;
|
|
|
|
GrGLFunction<GrGLDisableProc> fDisable;
|
|
|
|
GrGLFunction<GrGLDisableVertexAttribArrayProc> fDisableVertexAttribArray;
|
|
|
|
GrGLFunction<GrGLDrawArraysProc> fDrawArrays;
|
|
|
|
GrGLFunction<GrGLDrawArraysIndirectProc> fDrawArraysIndirect;
|
|
|
|
GrGLFunction<GrGLDrawArraysInstancedProc> fDrawArraysInstanced;
|
|
|
|
GrGLFunction<GrGLDrawBufferProc> fDrawBuffer;
|
|
|
|
GrGLFunction<GrGLDrawBuffersProc> fDrawBuffers;
|
|
|
|
GrGLFunction<GrGLDrawElementsProc> fDrawElements;
|
|
|
|
GrGLFunction<GrGLDrawElementsIndirectProc> fDrawElementsIndirect;
|
|
|
|
GrGLFunction<GrGLDrawElementsInstancedProc> fDrawElementsInstanced;
|
2016-08-29 16:18:39 +00:00
|
|
|
GrGLFunction<GrGLDrawRangeElementsProc> fDrawRangeElements;
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLEnableProc> fEnable;
|
|
|
|
GrGLFunction<GrGLEnableVertexAttribArrayProc> fEnableVertexAttribArray;
|
|
|
|
GrGLFunction<GrGLEndQueryProc> fEndQuery;
|
|
|
|
GrGLFunction<GrGLFinishProc> fFinish;
|
|
|
|
GrGLFunction<GrGLFlushProc> fFlush;
|
|
|
|
GrGLFunction<GrGLFlushMappedBufferRangeProc> fFlushMappedBufferRange;
|
|
|
|
GrGLFunction<GrGLFramebufferRenderbufferProc> fFramebufferRenderbuffer;
|
|
|
|
GrGLFunction<GrGLFramebufferTexture2DProc> fFramebufferTexture2D;
|
|
|
|
GrGLFunction<GrGLFramebufferTexture2DMultisampleProc> fFramebufferTexture2DMultisample;
|
|
|
|
GrGLFunction<GrGLFrontFaceProc> fFrontFace;
|
|
|
|
GrGLFunction<GrGLGenBuffersProc> fGenBuffers;
|
|
|
|
GrGLFunction<GrGLGenFramebuffersProc> fGenFramebuffers;
|
|
|
|
GrGLFunction<GrGLGenerateMipmapProc> fGenerateMipmap;
|
|
|
|
GrGLFunction<GrGLGenQueriesProc> fGenQueries;
|
|
|
|
GrGLFunction<GrGLGenRenderbuffersProc> fGenRenderbuffers;
|
|
|
|
GrGLFunction<GrGLGenTexturesProc> fGenTextures;
|
|
|
|
GrGLFunction<GrGLGenVertexArraysProc> fGenVertexArrays;
|
|
|
|
GrGLFunction<GrGLGetBufferParameterivProc> fGetBufferParameteriv;
|
|
|
|
GrGLFunction<GrGLGetErrorProc> fGetError;
|
|
|
|
GrGLFunction<GrGLGetFramebufferAttachmentParameterivProc> fGetFramebufferAttachmentParameteriv;
|
|
|
|
GrGLFunction<GrGLGetIntegervProc> fGetIntegerv;
|
2016-02-26 18:39:34 +00:00
|
|
|
GrGLFunction<GrGLGetMultisamplefvProc> fGetMultisamplefv;
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLGetQueryObjecti64vProc> fGetQueryObjecti64v;
|
|
|
|
GrGLFunction<GrGLGetQueryObjectivProc> fGetQueryObjectiv;
|
|
|
|
GrGLFunction<GrGLGetQueryObjectui64vProc> fGetQueryObjectui64v;
|
|
|
|
GrGLFunction<GrGLGetQueryObjectuivProc> fGetQueryObjectuiv;
|
|
|
|
GrGLFunction<GrGLGetQueryivProc> fGetQueryiv;
|
|
|
|
GrGLFunction<GrGLGetProgramInfoLogProc> fGetProgramInfoLog;
|
|
|
|
GrGLFunction<GrGLGetProgramivProc> fGetProgramiv;
|
|
|
|
GrGLFunction<GrGLGetRenderbufferParameterivProc> fGetRenderbufferParameteriv;
|
|
|
|
GrGLFunction<GrGLGetShaderInfoLogProc> fGetShaderInfoLog;
|
|
|
|
GrGLFunction<GrGLGetShaderivProc> fGetShaderiv;
|
|
|
|
GrGLFunction<GrGLGetShaderPrecisionFormatProc> fGetShaderPrecisionFormat;
|
|
|
|
GrGLFunction<GrGLGetStringProc> fGetString;
|
|
|
|
GrGLFunction<GrGLGetStringiProc> fGetStringi;
|
|
|
|
GrGLFunction<GrGLGetTexLevelParameterivProc> fGetTexLevelParameteriv;
|
|
|
|
GrGLFunction<GrGLGetUniformLocationProc> fGetUniformLocation;
|
|
|
|
GrGLFunction<GrGLInsertEventMarkerProc> fInsertEventMarker;
|
|
|
|
GrGLFunction<GrGLInvalidateBufferDataProc> fInvalidateBufferData;
|
|
|
|
GrGLFunction<GrGLInvalidateBufferSubDataProc> fInvalidateBufferSubData;
|
|
|
|
GrGLFunction<GrGLInvalidateFramebufferProc> fInvalidateFramebuffer;
|
|
|
|
GrGLFunction<GrGLInvalidateSubFramebufferProc> fInvalidateSubFramebuffer;
|
|
|
|
GrGLFunction<GrGLInvalidateTexImageProc> fInvalidateTexImage;
|
|
|
|
GrGLFunction<GrGLInvalidateTexSubImageProc> fInvalidateTexSubImage;
|
|
|
|
GrGLFunction<GrGLIsTextureProc> fIsTexture;
|
|
|
|
GrGLFunction<GrGLLineWidthProc> fLineWidth;
|
|
|
|
GrGLFunction<GrGLLinkProgramProc> fLinkProgram;
|
|
|
|
GrGLFunction<GrGLMapBufferProc> fMapBuffer;
|
|
|
|
GrGLFunction<GrGLMapBufferRangeProc> fMapBufferRange;
|
|
|
|
GrGLFunction<GrGLMapBufferSubDataProc> fMapBufferSubData;
|
|
|
|
GrGLFunction<GrGLMapTexSubImage2DProc> fMapTexSubImage2D;
|
2016-11-15 17:36:29 +00:00
|
|
|
GrGLFunction<GrGLMemoryBarrierProc> fMemoryBarrier;
|
|
|
|
GrGLFunction<GrGLMemoryBarrierByRegionProc> fMemoryBarrierByRegion;
|
2016-06-03 15:28:47 +00:00
|
|
|
GrGLFunction<GrGLMultiDrawArraysIndirectProc> fMultiDrawArraysIndirect;
|
|
|
|
GrGLFunction<GrGLMultiDrawElementsIndirectProc> fMultiDrawElementsIndirect;
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLPixelStoreiProc> fPixelStorei;
|
2017-03-30 18:28:08 +00:00
|
|
|
GrGLFunction<GrGLPolygonModeProc> fPolygonMode;
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLPopGroupMarkerProc> fPopGroupMarker;
|
|
|
|
GrGLFunction<GrGLPushGroupMarkerProc> fPushGroupMarker;
|
|
|
|
GrGLFunction<GrGLQueryCounterProc> fQueryCounter;
|
|
|
|
GrGLFunction<GrGLRasterSamplesProc> fRasterSamples;
|
|
|
|
GrGLFunction<GrGLReadBufferProc> fReadBuffer;
|
|
|
|
GrGLFunction<GrGLReadPixelsProc> fReadPixels;
|
|
|
|
GrGLFunction<GrGLRenderbufferStorageProc> fRenderbufferStorage;
|
2014-01-21 16:09:18 +00:00
|
|
|
|
|
|
|
// On OpenGL ES there are multiple incompatible extensions that add support for MSAA
|
|
|
|
// and ES3 adds MSAA support to the standard. On an ES3 driver we may still use the
|
|
|
|
// older extensions for performance reasons or due to ES3 driver bugs. We want the function
|
|
|
|
// that creates the GrGLInterface to provide all available functions and internally
|
|
|
|
// we will select among them. They all have a method called glRenderbufferStorageMultisample*.
|
|
|
|
// So we have separate function pointers for GL_IMG/EXT_multisampled_to_texture,
|
|
|
|
// GL_CHROMIUM/ANGLE_framebuffer_multisample/ES3, and GL_APPLE_framebuffer_multisample
|
|
|
|
// variations.
|
|
|
|
//
|
|
|
|
// If a driver supports multiple GL_ARB_framebuffer_multisample-style extensions then we will
|
|
|
|
// assume the function pointers for the standard (or equivalent GL_ARB) version have
|
|
|
|
// been preferred over GL_EXT, GL_CHROMIUM, or GL_ANGLE variations that have reduced
|
|
|
|
// functionality.
|
|
|
|
|
|
|
|
// GL_EXT_multisampled_render_to_texture (preferred) or GL_IMG_multisampled_render_to_texture
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisampleES2EXT;
|
2014-01-21 16:09:18 +00:00
|
|
|
// GL_APPLE_framebuffer_multisample
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisampleES2APPLE;
|
2014-01-21 16:09:18 +00:00
|
|
|
|
|
|
|
// This is used to store the pointer for GL_ARB/EXT/ANGLE/CHROMIUM_framebuffer_multisample or
|
|
|
|
// the standard function in ES3+ or GL 3.0+.
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisample;
|
2014-01-21 16:09:18 +00:00
|
|
|
|
|
|
|
// Pointer to BindUniformLocationCHROMIUM from the GL_CHROMIUM_bind_uniform_location extension.
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLBindUniformLocationProc> fBindUniformLocation;
|
|
|
|
|
|
|
|
GrGLFunction<GrGLResolveMultisampleFramebufferProc> fResolveMultisampleFramebuffer;
|
|
|
|
GrGLFunction<GrGLScissorProc> fScissor;
|
|
|
|
GrGLFunction<GrGLShaderSourceProc> fShaderSource;
|
|
|
|
GrGLFunction<GrGLStencilFuncProc> fStencilFunc;
|
|
|
|
GrGLFunction<GrGLStencilFuncSeparateProc> fStencilFuncSeparate;
|
|
|
|
GrGLFunction<GrGLStencilMaskProc> fStencilMask;
|
|
|
|
GrGLFunction<GrGLStencilMaskSeparateProc> fStencilMaskSeparate;
|
|
|
|
GrGLFunction<GrGLStencilOpProc> fStencilOp;
|
|
|
|
GrGLFunction<GrGLStencilOpSeparateProc> fStencilOpSeparate;
|
2016-03-11 22:07:38 +00:00
|
|
|
GrGLFunction<GrGLTexBufferProc> fTexBuffer;
|
2016-04-11 20:02:05 +00:00
|
|
|
GrGLFunction<GrGLTexBufferRangeProc> fTexBufferRange;
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLTexImage2DProc> fTexImage2D;
|
|
|
|
GrGLFunction<GrGLTexParameteriProc> fTexParameteri;
|
|
|
|
GrGLFunction<GrGLTexParameterivProc> fTexParameteriv;
|
|
|
|
GrGLFunction<GrGLTexSubImage2DProc> fTexSubImage2D;
|
|
|
|
GrGLFunction<GrGLTexStorage2DProc> fTexStorage2D;
|
|
|
|
GrGLFunction<GrGLTextureBarrierProc> fTextureBarrier;
|
|
|
|
GrGLFunction<GrGLDiscardFramebufferProc> fDiscardFramebuffer;
|
|
|
|
GrGLFunction<GrGLUniform1fProc> fUniform1f;
|
|
|
|
GrGLFunction<GrGLUniform1iProc> fUniform1i;
|
|
|
|
GrGLFunction<GrGLUniform1fvProc> fUniform1fv;
|
|
|
|
GrGLFunction<GrGLUniform1ivProc> fUniform1iv;
|
|
|
|
GrGLFunction<GrGLUniform2fProc> fUniform2f;
|
|
|
|
GrGLFunction<GrGLUniform2iProc> fUniform2i;
|
|
|
|
GrGLFunction<GrGLUniform2fvProc> fUniform2fv;
|
|
|
|
GrGLFunction<GrGLUniform2ivProc> fUniform2iv;
|
|
|
|
GrGLFunction<GrGLUniform3fProc> fUniform3f;
|
|
|
|
GrGLFunction<GrGLUniform3iProc> fUniform3i;
|
|
|
|
GrGLFunction<GrGLUniform3fvProc> fUniform3fv;
|
|
|
|
GrGLFunction<GrGLUniform3ivProc> fUniform3iv;
|
|
|
|
GrGLFunction<GrGLUniform4fProc> fUniform4f;
|
|
|
|
GrGLFunction<GrGLUniform4iProc> fUniform4i;
|
|
|
|
GrGLFunction<GrGLUniform4fvProc> fUniform4fv;
|
|
|
|
GrGLFunction<GrGLUniform4ivProc> fUniform4iv;
|
|
|
|
GrGLFunction<GrGLUniformMatrix2fvProc> fUniformMatrix2fv;
|
|
|
|
GrGLFunction<GrGLUniformMatrix3fvProc> fUniformMatrix3fv;
|
|
|
|
GrGLFunction<GrGLUniformMatrix4fvProc> fUniformMatrix4fv;
|
|
|
|
GrGLFunction<GrGLUnmapBufferProc> fUnmapBuffer;
|
|
|
|
GrGLFunction<GrGLUnmapBufferSubDataProc> fUnmapBufferSubData;
|
|
|
|
GrGLFunction<GrGLUnmapTexSubImage2DProc> fUnmapTexSubImage2D;
|
|
|
|
GrGLFunction<GrGLUseProgramProc> fUseProgram;
|
|
|
|
GrGLFunction<GrGLVertexAttrib1fProc> fVertexAttrib1f;
|
|
|
|
GrGLFunction<GrGLVertexAttrib2fvProc> fVertexAttrib2fv;
|
|
|
|
GrGLFunction<GrGLVertexAttrib3fvProc> fVertexAttrib3fv;
|
|
|
|
GrGLFunction<GrGLVertexAttrib4fvProc> fVertexAttrib4fv;
|
|
|
|
GrGLFunction<GrGLVertexAttribDivisorProc> fVertexAttribDivisor;
|
2016-02-08 18:11:47 +00:00
|
|
|
GrGLFunction<GrGLVertexAttribIPointerProc> fVertexAttribIPointer;
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLVertexAttribPointerProc> fVertexAttribPointer;
|
|
|
|
GrGLFunction<GrGLViewportProc> fViewport;
|
2014-01-21 16:09:18 +00:00
|
|
|
|
2015-06-12 20:56:46 +00:00
|
|
|
/* GL_NV_path_rendering */
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLMatrixLoadfProc> fMatrixLoadf;
|
|
|
|
GrGLFunction<GrGLMatrixLoadIdentityProc> fMatrixLoadIdentity;
|
|
|
|
GrGLFunction<GrGLGetProgramResourceLocationProc> fGetProgramResourceLocation;
|
|
|
|
GrGLFunction<GrGLPathCommandsProc> fPathCommands;
|
|
|
|
GrGLFunction<GrGLPathParameteriProc> fPathParameteri;
|
|
|
|
GrGLFunction<GrGLPathParameterfProc> fPathParameterf;
|
|
|
|
GrGLFunction<GrGLGenPathsProc> fGenPaths;
|
|
|
|
GrGLFunction<GrGLDeletePathsProc> fDeletePaths;
|
|
|
|
GrGLFunction<GrGLIsPathProc> fIsPath;
|
|
|
|
GrGLFunction<GrGLPathStencilFuncProc> fPathStencilFunc;
|
|
|
|
GrGLFunction<GrGLStencilFillPathProc> fStencilFillPath;
|
|
|
|
GrGLFunction<GrGLStencilStrokePathProc> fStencilStrokePath;
|
|
|
|
GrGLFunction<GrGLStencilFillPathInstancedProc> fStencilFillPathInstanced;
|
|
|
|
GrGLFunction<GrGLStencilStrokePathInstancedProc> fStencilStrokePathInstanced;
|
|
|
|
GrGLFunction<GrGLCoverFillPathProc> fCoverFillPath;
|
|
|
|
GrGLFunction<GrGLCoverStrokePathProc> fCoverStrokePath;
|
|
|
|
GrGLFunction<GrGLCoverFillPathInstancedProc> fCoverFillPathInstanced;
|
|
|
|
GrGLFunction<GrGLCoverStrokePathInstancedProc> fCoverStrokePathInstanced;
|
2014-08-11 21:05:05 +00:00
|
|
|
// NV_path_rendering v1.2
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLStencilThenCoverFillPathProc> fStencilThenCoverFillPath;
|
|
|
|
GrGLFunction<GrGLStencilThenCoverStrokePathProc> fStencilThenCoverStrokePath;
|
|
|
|
GrGLFunction<GrGLStencilThenCoverFillPathInstancedProc> fStencilThenCoverFillPathInstanced;
|
|
|
|
GrGLFunction<GrGLStencilThenCoverStrokePathInstancedProc> fStencilThenCoverStrokePathInstanced;
|
2014-08-11 21:05:05 +00:00
|
|
|
// NV_path_rendering v1.3
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLProgramPathFragmentInputGenProc> fProgramPathFragmentInputGen;
|
2015-07-14 17:59:23 +00:00
|
|
|
// CHROMIUM_path_rendering
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLBindFragmentInputLocationProc> fBindFragmentInputLocation;
|
2015-06-12 20:56:46 +00:00
|
|
|
|
|
|
|
/* NV_framebuffer_mixed_samples */
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLCoverageModulationProc> fCoverageModulation;
|
2015-06-12 20:56:46 +00:00
|
|
|
|
|
|
|
/* NV_bindless_texture */
|
|
|
|
// We use the NVIDIA verson for now because it does not require dynamically uniform handles.
|
|
|
|
// We may switch the the ARB version and/or omit methods in the future.
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLGetTextureHandleProc> fGetTextureHandle;
|
|
|
|
GrGLFunction<GrGLGetTextureSamplerHandleProc> fGetTextureSamplerHandle;
|
|
|
|
GrGLFunction<GrGLMakeTextureHandleResidentProc> fMakeTextureHandleResident;
|
|
|
|
GrGLFunction<GrGLMakeTextureHandleNonResidentProc> fMakeTextureHandleNonResident;
|
|
|
|
GrGLFunction<GrGLGetImageHandleProc> fGetImageHandle;
|
|
|
|
GrGLFunction<GrGLMakeImageHandleResidentProc> fMakeImageHandleResident;
|
|
|
|
GrGLFunction<GrGLMakeImageHandleNonResidentProc> fMakeImageHandleNonResident;
|
|
|
|
GrGLFunction<GrGLIsTextureHandleResidentProc> fIsTextureHandleResident;
|
|
|
|
GrGLFunction<GrGLIsImageHandleResidentProc> fIsImageHandleResident;
|
|
|
|
GrGLFunction<GrGLUniformHandleui64Proc> fUniformHandleui64;
|
|
|
|
GrGLFunction<GrGLUniformHandleui64vProc> fUniformHandleui64v;
|
|
|
|
GrGLFunction<GrGLProgramUniformHandleui64Proc> fProgramUniformHandleui64;
|
|
|
|
GrGLFunction<GrGLProgramUniformHandleui64vProc> fProgramUniformHandleui64v;
|
2015-06-12 20:56:46 +00:00
|
|
|
|
2016-03-25 16:26:03 +00:00
|
|
|
/* ARB_sample_shading */
|
|
|
|
GrGLFunction<GrGLMinSampleShadingProc> fMinSampleShading;
|
|
|
|
|
2015-06-12 20:56:46 +00:00
|
|
|
/* EXT_direct_state_access */
|
|
|
|
// We use the EXT verson because it is more expansive and interacts with more extensions
|
|
|
|
// than the ARB or core (4.5) versions. We may switch and/or omit methods in the future.
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLTextureParameteriProc> fTextureParameteri;
|
|
|
|
GrGLFunction<GrGLTextureParameterivProc> fTextureParameteriv;
|
|
|
|
GrGLFunction<GrGLTextureParameterfProc> fTextureParameterf;
|
|
|
|
GrGLFunction<GrGLTextureParameterfvProc> fTextureParameterfv;
|
|
|
|
GrGLFunction<GrGLTextureImage1DProc> fTextureImage1D;
|
|
|
|
GrGLFunction<GrGLTextureImage2DProc> fTextureImage2D;
|
|
|
|
GrGLFunction<GrGLTextureSubImage1DProc> fTextureSubImage1D;
|
|
|
|
GrGLFunction<GrGLTextureSubImage2DProc> fTextureSubImage2D;
|
|
|
|
GrGLFunction<GrGLCopyTextureImage1DProc> fCopyTextureImage1D;
|
|
|
|
GrGLFunction<GrGLCopyTextureImage2DProc> fCopyTextureImage2D;
|
|
|
|
GrGLFunction<GrGLCopyTextureSubImage1DProc> fCopyTextureSubImage1D;
|
|
|
|
GrGLFunction<GrGLCopyTextureSubImage2DProc> fCopyTextureSubImage2D;
|
|
|
|
GrGLFunction<GrGLGetTextureImageProc> fGetTextureImage;
|
|
|
|
GrGLFunction<GrGLGetTextureParameterfvProc> fGetTextureParameterfv;
|
|
|
|
GrGLFunction<GrGLGetTextureParameterivProc> fGetTextureParameteriv;
|
|
|
|
GrGLFunction<GrGLGetTextureLevelParameterfvProc> fGetTextureLevelParameterfv;
|
|
|
|
GrGLFunction<GrGLGetTextureLevelParameterivProc> fGetTextureLevelParameteriv;
|
2015-06-12 20:56:46 +00:00
|
|
|
// OpenGL 1.2
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLTextureImage3DProc> fTextureImage3D;
|
|
|
|
GrGLFunction<GrGLTextureSubImage3DProc> fTextureSubImage3D;
|
|
|
|
GrGLFunction<GrGLCopyTextureSubImage3DProc> fCopyTextureSubImage3D;
|
|
|
|
GrGLFunction<GrGLCompressedTextureImage3DProc> fCompressedTextureImage3D;
|
|
|
|
GrGLFunction<GrGLCompressedTextureImage2DProc> fCompressedTextureImage2D;
|
|
|
|
GrGLFunction<GrGLCompressedTextureImage1DProc> fCompressedTextureImage1D;
|
|
|
|
GrGLFunction<GrGLCompressedTextureSubImage3DProc> fCompressedTextureSubImage3D;
|
|
|
|
GrGLFunction<GrGLCompressedTextureSubImage2DProc> fCompressedTextureSubImage2D;
|
|
|
|
GrGLFunction<GrGLCompressedTextureSubImage1DProc> fCompressedTextureSubImage1D;
|
|
|
|
GrGLFunction<GrGLGetCompressedTextureImageProc> fGetCompressedTextureImage;
|
2015-06-12 20:56:46 +00:00
|
|
|
// OpenGL 1.5
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLNamedBufferDataProc> fNamedBufferData;
|
|
|
|
GrGLFunction<GrGLNamedBufferSubDataProc> fNamedBufferSubData;
|
|
|
|
GrGLFunction<GrGLMapNamedBufferProc> fMapNamedBuffer;
|
|
|
|
GrGLFunction<GrGLUnmapNamedBufferProc> fUnmapNamedBuffer;
|
|
|
|
GrGLFunction<GrGLGetNamedBufferParameterivProc> fGetNamedBufferParameteriv;
|
|
|
|
GrGLFunction<GrGLGetNamedBufferPointervProc> fGetNamedBufferPointerv;
|
|
|
|
GrGLFunction<GrGLGetNamedBufferSubDataProc> fGetNamedBufferSubData;
|
2015-06-12 20:56:46 +00:00
|
|
|
// OpenGL 2.0
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLProgramUniform1fProc> fProgramUniform1f;
|
|
|
|
GrGLFunction<GrGLProgramUniform2fProc> fProgramUniform2f;
|
|
|
|
GrGLFunction<GrGLProgramUniform3fProc> fProgramUniform3f;
|
|
|
|
GrGLFunction<GrGLProgramUniform4fProc> fProgramUniform4f;
|
|
|
|
GrGLFunction<GrGLProgramUniform1iProc> fProgramUniform1i;
|
|
|
|
GrGLFunction<GrGLProgramUniform2iProc> fProgramUniform2i;
|
|
|
|
GrGLFunction<GrGLProgramUniform3iProc> fProgramUniform3i;
|
|
|
|
GrGLFunction<GrGLProgramUniform4iProc> fProgramUniform4i;
|
|
|
|
GrGLFunction<GrGLProgramUniform1fvProc> fProgramUniform1fv;
|
|
|
|
GrGLFunction<GrGLProgramUniform2fvProc> fProgramUniform2fv;
|
|
|
|
GrGLFunction<GrGLProgramUniform3fvProc> fProgramUniform3fv;
|
|
|
|
GrGLFunction<GrGLProgramUniform4fvProc> fProgramUniform4fv;
|
|
|
|
GrGLFunction<GrGLProgramUniform1ivProc> fProgramUniform1iv;
|
|
|
|
GrGLFunction<GrGLProgramUniform2ivProc> fProgramUniform2iv;
|
|
|
|
GrGLFunction<GrGLProgramUniform3ivProc> fProgramUniform3iv;
|
|
|
|
GrGLFunction<GrGLProgramUniform4ivProc> fProgramUniform4iv;
|
|
|
|
GrGLFunction<GrGLProgramUniformMatrix2fvProc> fProgramUniformMatrix2fv;
|
|
|
|
GrGLFunction<GrGLProgramUniformMatrix3fvProc> fProgramUniformMatrix3fv;
|
|
|
|
GrGLFunction<GrGLProgramUniformMatrix4fvProc> fProgramUniformMatrix4fv;
|
2015-06-12 20:56:46 +00:00
|
|
|
// OpenGL 2.1
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLProgramUniformMatrix2x3fvProc> fProgramUniformMatrix2x3fv;
|
|
|
|
GrGLFunction<GrGLProgramUniformMatrix3x2fvProc> fProgramUniformMatrix3x2fv;
|
|
|
|
GrGLFunction<GrGLProgramUniformMatrix2x4fvProc> fProgramUniformMatrix2x4fv;
|
|
|
|
GrGLFunction<GrGLProgramUniformMatrix4x2fvProc> fProgramUniformMatrix4x2fv;
|
|
|
|
GrGLFunction<GrGLProgramUniformMatrix3x4fvProc> fProgramUniformMatrix3x4fv;
|
|
|
|
GrGLFunction<GrGLProgramUniformMatrix4x3fvProc> fProgramUniformMatrix4x3fv;
|
2015-06-12 20:56:46 +00:00
|
|
|
// OpenGL 3.0
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLNamedRenderbufferStorageProc> fNamedRenderbufferStorage;
|
|
|
|
GrGLFunction<GrGLGetNamedRenderbufferParameterivProc> fGetNamedRenderbufferParameteriv;
|
|
|
|
GrGLFunction<GrGLNamedRenderbufferStorageMultisampleProc> fNamedRenderbufferStorageMultisample;
|
|
|
|
GrGLFunction<GrGLCheckNamedFramebufferStatusProc> fCheckNamedFramebufferStatus;
|
|
|
|
GrGLFunction<GrGLNamedFramebufferTexture1DProc> fNamedFramebufferTexture1D;
|
|
|
|
GrGLFunction<GrGLNamedFramebufferTexture2DProc> fNamedFramebufferTexture2D;
|
|
|
|
GrGLFunction<GrGLNamedFramebufferTexture3DProc> fNamedFramebufferTexture3D;
|
|
|
|
GrGLFunction<GrGLNamedFramebufferRenderbufferProc> fNamedFramebufferRenderbuffer;
|
|
|
|
GrGLFunction<GrGLGetNamedFramebufferAttachmentParameterivProc> fGetNamedFramebufferAttachmentParameteriv;
|
|
|
|
GrGLFunction<GrGLGenerateTextureMipmapProc> fGenerateTextureMipmap;
|
|
|
|
GrGLFunction<GrGLFramebufferDrawBufferProc> fFramebufferDrawBuffer;
|
|
|
|
GrGLFunction<GrGLFramebufferDrawBuffersProc> fFramebufferDrawBuffers;
|
|
|
|
GrGLFunction<GrGLFramebufferReadBufferProc> fFramebufferReadBuffer;
|
|
|
|
GrGLFunction<GrGLGetFramebufferParameterivProc> fGetFramebufferParameteriv;
|
|
|
|
GrGLFunction<GrGLNamedCopyBufferSubDataProc> fNamedCopyBufferSubData;
|
|
|
|
GrGLFunction<GrGLVertexArrayVertexOffsetProc> fVertexArrayVertexOffset;
|
|
|
|
GrGLFunction<GrGLVertexArrayColorOffsetProc> fVertexArrayColorOffset;
|
|
|
|
GrGLFunction<GrGLVertexArrayEdgeFlagOffsetProc> fVertexArrayEdgeFlagOffset;
|
|
|
|
GrGLFunction<GrGLVertexArrayIndexOffsetProc> fVertexArrayIndexOffset;
|
|
|
|
GrGLFunction<GrGLVertexArrayNormalOffsetProc> fVertexArrayNormalOffset;
|
|
|
|
GrGLFunction<GrGLVertexArrayTexCoordOffsetProc> fVertexArrayTexCoordOffset;
|
|
|
|
GrGLFunction<GrGLVertexArrayMultiTexCoordOffsetProc> fVertexArrayMultiTexCoordOffset;
|
|
|
|
GrGLFunction<GrGLVertexArrayFogCoordOffsetProc> fVertexArrayFogCoordOffset;
|
|
|
|
GrGLFunction<GrGLVertexArraySecondaryColorOffsetProc> fVertexArraySecondaryColorOffset;
|
|
|
|
GrGLFunction<GrGLVertexArrayVertexAttribOffsetProc> fVertexArrayVertexAttribOffset;
|
|
|
|
GrGLFunction<GrGLVertexArrayVertexAttribIOffsetProc> fVertexArrayVertexAttribIOffset;
|
|
|
|
GrGLFunction<GrGLEnableVertexArrayProc> fEnableVertexArray;
|
|
|
|
GrGLFunction<GrGLDisableVertexArrayProc> fDisableVertexArray;
|
|
|
|
GrGLFunction<GrGLEnableVertexArrayAttribProc> fEnableVertexArrayAttrib;
|
|
|
|
GrGLFunction<GrGLDisableVertexArrayAttribProc> fDisableVertexArrayAttrib;
|
|
|
|
GrGLFunction<GrGLGetVertexArrayIntegervProc> fGetVertexArrayIntegerv;
|
|
|
|
GrGLFunction<GrGLGetVertexArrayPointervProc> fGetVertexArrayPointerv;
|
|
|
|
GrGLFunction<GrGLGetVertexArrayIntegeri_vProc> fGetVertexArrayIntegeri_v;
|
|
|
|
GrGLFunction<GrGLGetVertexArrayPointeri_vProc> fGetVertexArrayPointeri_v;
|
|
|
|
GrGLFunction<GrGLMapNamedBufferRangeProc> fMapNamedBufferRange;
|
|
|
|
GrGLFunction<GrGLFlushMappedNamedBufferRangeProc> fFlushMappedNamedBufferRange;
|
2016-03-11 22:07:38 +00:00
|
|
|
// OpenGL 3.1
|
|
|
|
GrGLFunction<GrGLTextureBufferProc> fTextureBuffer;
|
2015-06-12 20:56:46 +00:00
|
|
|
|
2016-09-30 15:39:02 +00:00
|
|
|
/* ARB_sync */
|
|
|
|
GrGLFunction<GrGLFenceSyncProc> fFenceSync;
|
2017-07-20 19:47:30 +00:00
|
|
|
GrGLFunction<GrGLIsSyncProc> fIsSync;
|
2016-09-30 15:39:02 +00:00
|
|
|
GrGLFunction<GrGLClientWaitSyncProc> fClientWaitSync;
|
2017-03-01 22:01:09 +00:00
|
|
|
GrGLFunction<GrGLWaitSyncProc> fWaitSync;
|
2016-09-30 15:39:02 +00:00
|
|
|
GrGLFunction<GrGLDeleteSyncProc> fDeleteSync;
|
|
|
|
|
2017-07-19 18:47:42 +00:00
|
|
|
/* ARB_internalforamt_query */
|
|
|
|
GrGLFunction<GrGLGetInternalformativProc> fGetInternalformativ;
|
|
|
|
|
2015-06-12 20:56:46 +00:00
|
|
|
/* KHR_debug */
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrGLDebugMessageControlProc> fDebugMessageControl;
|
|
|
|
GrGLFunction<GrGLDebugMessageInsertProc> fDebugMessageInsert;
|
|
|
|
GrGLFunction<GrGLDebugMessageCallbackProc> fDebugMessageCallback;
|
|
|
|
GrGLFunction<GrGLGetDebugMessageLogProc> fGetDebugMessageLog;
|
|
|
|
GrGLFunction<GrGLPushDebugGroupProc> fPushDebugGroup;
|
|
|
|
GrGLFunction<GrGLPopDebugGroupProc> fPopDebugGroup;
|
|
|
|
GrGLFunction<GrGLObjectLabelProc> fObjectLabel;
|
2015-11-16 14:48:44 +00:00
|
|
|
|
2016-08-09 19:42:47 +00:00
|
|
|
/* EXT_window_rectangles */
|
|
|
|
GrGLFunction<GrGLWindowRectanglesProc> fWindowRectangles;
|
|
|
|
|
2015-11-16 14:48:44 +00:00
|
|
|
/* EGL functions */
|
2016-02-08 15:22:17 +00:00
|
|
|
GrGLFunction<GrEGLCreateImageProc> fEGLCreateImage;
|
|
|
|
GrGLFunction<GrEGLDestroyImageProc> fEGLDestroyImage;
|
2014-01-21 16:09:18 +00:00
|
|
|
} fFunctions;
|
|
|
|
|
2014-07-29 15:01:52 +00:00
|
|
|
// This exists for internal testing.
|
|
|
|
virtual void abandon() const {}
|
2011-05-04 12:35:39 +00:00
|
|
|
};
|
2011-03-14 21:23:01 +00:00
|
|
|
|
|
|
|
#endif
|