Commit 29ddcc99 by Jamie Madill Committed by Commit Bot

Add an auto-generated dispatch table for GL bindings.

This will more easily allow us to extend our implementation to make a NULL or "stub" set of bindings. It also exposes a lot more function permutations via extension variations. It might improve the loading speed for bindings obtained via extensions. Instead of generating a list every time an extension is checked, we use a single std::set for a fast query. However because more extensions are checked for more entry points, it might not make a huge difference. This also fixes an issue where the "real" ANGLE GL headers were being propagated to the entry point dispatch table definitions, instead of being in a totally isolated file. This patch adds the missing typedefs to our proxy headers. It also fixes the naming of a few entry points which was inconsistent with the spec. It also makes an XML adjustment to GL_NV_path_rendering to accomodate a hole in the spec where glLoadMatrixfEXT was not ever defined in OpenGL ES. A spec oddity with the TexStorage extension is not resolved - in this case, some methods are only exposed if other extensions are present, but this information is missing from gl.xml. BUG=angleproject:2188 Change-Id: I0fd61dd32de6fadd55fa6bd79295833392d51104 Reviewed-on: https://chromium-review.googlesource.com/726949 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org>
parent 76e471e9
...@@ -44460,6 +44460,7 @@ typedef unsigned int GLhandleARB; ...@@ -44460,6 +44460,7 @@ typedef unsigned int GLhandleARB;
<command name="glIsPointInStrokePathNV"/> <command name="glIsPointInStrokePathNV"/>
<command name="glGetPathLengthNV"/> <command name="glGetPathLengthNV"/>
<command name="glPointAlongPathNV"/> <command name="glPointAlongPathNV"/>
<command name="glMatrixLoadfEXT"/>
</require> </require>
<require comment="API revision 1.2"> <require comment="API revision 1.2">
<enum name="GL_ROUNDED_RECT_NV"/> <enum name="GL_ROUNDED_RECT_NV"/>
...@@ -9,18 +9,16 @@ ...@@ -9,18 +9,16 @@
#ifndef LIBANGLE_VERSION_H_ #ifndef LIBANGLE_VERSION_H_
#define LIBANGLE_VERSION_H_ #define LIBANGLE_VERSION_H_
#include <angle_gl.h>
namespace gl namespace gl
{ {
struct Version struct Version
{ {
constexpr Version(); constexpr Version();
constexpr Version(GLuint major, GLuint minor); constexpr Version(unsigned int major, unsigned int minor);
GLuint major; unsigned int major;
GLuint minor; unsigned int minor;
}; };
bool operator==(const Version &a, const Version &b); bool operator==(const Version &a, const Version &b);
......
...@@ -20,7 +20,7 @@ constexpr Version::Version() ...@@ -20,7 +20,7 @@ constexpr Version::Version()
#undef major #undef major
#undef minor #undef minor
constexpr Version::Version(GLuint major_, GLuint minor_) constexpr Version::Version(unsigned int major_, unsigned int minor_)
: major(major_), : major(major_),
minor(minor_) minor(minor_)
{ {
...@@ -56,4 +56,4 @@ inline bool operator>(const Version &a, const Version &b) ...@@ -56,4 +56,4 @@ inline bool operator>(const Version &a, const Version &b)
return std::tie(a.major, a.minor) > std::tie(b.major, b.minor); return std::tie(a.major, a.minor) > std::tie(b.major, b.minor);
} }
} } // namespace gl
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -250,11 +250,11 @@ Error FramebufferGL::invalidate(const gl::Context *context, size_t count, const ...@@ -250,11 +250,11 @@ Error FramebufferGL::invalidate(const gl::Context *context, size_t count, const
mFunctions->invalidateFramebuffer(GL_FRAMEBUFFER, static_cast<GLsizei>(count), mFunctions->invalidateFramebuffer(GL_FRAMEBUFFER, static_cast<GLsizei>(count),
finalAttachmentsPtr); finalAttachmentsPtr);
} }
else if (mFunctions->discardFramebuffer) else if (mFunctions->discardFramebufferEXT)
{ {
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
mFunctions->discardFramebuffer(GL_FRAMEBUFFER, static_cast<GLsizei>(count), mFunctions->discardFramebufferEXT(GL_FRAMEBUFFER, static_cast<GLsizei>(count),
finalAttachmentsPtr); finalAttachmentsPtr);
} }
return gl::NoError(); return gl::NoError();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -32,7 +32,7 @@ gl::Error PathGL::setCommands(GLsizei numCommands, ...@@ -32,7 +32,7 @@ gl::Error PathGL::setCommands(GLsizei numCommands,
void PathGL::setPathParameter(GLenum pname, GLfloat value) void PathGL::setPathParameter(GLenum pname, GLfloat value)
{ {
mFunctions->setPathParameterfNV(mPathID, pname, value); mFunctions->pathParameterfNV(mPathID, pname, value);
} }
} // rx } // rx
...@@ -2162,7 +2162,7 @@ void StateManagerGL::setPathRenderingModelViewMatrix(const GLfloat *m) ...@@ -2162,7 +2162,7 @@ void StateManagerGL::setPathRenderingModelViewMatrix(const GLfloat *m)
if (memcmp(mPathMatrixMV, m, sizeof(mPathMatrixMV)) != 0) if (memcmp(mPathMatrixMV, m, sizeof(mPathMatrixMV)) != 0)
{ {
memcpy(mPathMatrixMV, m, sizeof(mPathMatrixMV)); memcpy(mPathMatrixMV, m, sizeof(mPathMatrixMV));
mFunctions->matrixLoadEXT(GL_PATH_MODELVIEW_CHROMIUM, m); mFunctions->matrixLoadfEXT(GL_PATH_MODELVIEW_CHROMIUM, m);
mLocalDirtyBits.set(gl::State::DIRTY_BIT_PATH_RENDERING_MATRIX_MV); mLocalDirtyBits.set(gl::State::DIRTY_BIT_PATH_RENDERING_MATRIX_MV);
} }
...@@ -2173,7 +2173,7 @@ void StateManagerGL::setPathRenderingProjectionMatrix(const GLfloat *m) ...@@ -2173,7 +2173,7 @@ void StateManagerGL::setPathRenderingProjectionMatrix(const GLfloat *m)
if (memcmp(mPathMatrixProj, m, sizeof(mPathMatrixProj)) != 0) if (memcmp(mPathMatrixProj, m, sizeof(mPathMatrixProj)) != 0)
{ {
memcpy(mPathMatrixProj, m, sizeof(mPathMatrixProj)); memcpy(mPathMatrixProj, m, sizeof(mPathMatrixProj));
mFunctions->matrixLoadEXT(GL_PATH_PROJECTION_CHROMIUM, m); mFunctions->matrixLoadfEXT(GL_PATH_PROJECTION_CHROMIUM, m);
mLocalDirtyBits.set(gl::State::DIRTY_BIT_PATH_RENDERING_MATRIX_PROJ); mLocalDirtyBits.set(gl::State::DIRTY_BIT_PATH_RENDERING_MATRIX_PROJ);
} }
......
...@@ -36,7 +36,7 @@ class FunctionsGLCGL : public FunctionsGL ...@@ -36,7 +36,7 @@ class FunctionsGLCGL : public FunctionsGL
~FunctionsGLCGL() override { dlclose(mDylibHandle); } ~FunctionsGLCGL() override { dlclose(mDylibHandle); }
private: private:
void *loadProcAddress(const std::string &function) override void *loadProcAddress(const std::string &function) const override
{ {
return dlsym(mDylibHandle, function.c_str()); return dlsym(mDylibHandle, function.c_str());
} }
......
...@@ -200,7 +200,7 @@ class FunctionsGLEGL : public FunctionsGL ...@@ -200,7 +200,7 @@ class FunctionsGLEGL : public FunctionsGL
~FunctionsGLEGL() override {} ~FunctionsGLEGL() override {}
private: private:
void *loadProcAddress(const std::string &function) override void *loadProcAddress(const std::string &function) const override
{ {
return mEGL.getProcAddress(function.c_str()); return mEGL.getProcAddress(function.c_str());
} }
......
...@@ -218,7 +218,7 @@ bool DisplayOzone::Buffer::resize(int32_t width, int32_t height) ...@@ -218,7 +218,7 @@ bool DisplayOzone::Buffer::resize(int32_t width, int32_t height)
gl->genRenderbuffers(1, &mColorBuffer); gl->genRenderbuffers(1, &mColorBuffer);
sm->bindRenderbuffer(GL_RENDERBUFFER, mColorBuffer); sm->bindRenderbuffer(GL_RENDERBUFFER, mColorBuffer);
gl->eglImageTargetRenderbufferStorageOES(GL_RENDERBUFFER, mImage); gl->eGLImageTargetRenderbufferStorageOES(GL_RENDERBUFFER, mImage);
sm->bindFramebuffer(GL_FRAMEBUFFER, mGLFB); sm->bindFramebuffer(GL_FRAMEBUFFER, mGLFB);
gl->framebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER, gl->framebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER,
...@@ -263,7 +263,7 @@ bool DisplayOzone::Buffer::initialize(int width, int height) ...@@ -263,7 +263,7 @@ bool DisplayOzone::Buffer::initialize(int width, int height)
void DisplayOzone::Buffer::bindTexImage() void DisplayOzone::Buffer::bindTexImage()
{ {
mDisplay->mFunctionsGL->eglImageTargetTexture2DOES(GL_TEXTURE_2D, mImage); mDisplay->mFunctionsGL->eGLImageTargetTexture2DOES(GL_TEXTURE_2D, mImage);
} }
GLuint DisplayOzone::Buffer::getTexture() GLuint DisplayOzone::Buffer::getTexture()
...@@ -280,7 +280,7 @@ GLuint DisplayOzone::Buffer::getTexture() ...@@ -280,7 +280,7 @@ GLuint DisplayOzone::Buffer::getTexture()
gl->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); gl->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
gl->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); gl->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
ASSERT(mImage != EGL_NO_IMAGE_KHR); ASSERT(mImage != EGL_NO_IMAGE_KHR);
gl->eglImageTargetTexture2DOES(GL_TEXTURE_2D, mImage); gl->eGLImageTargetTexture2DOES(GL_TEXTURE_2D, mImage);
return mTexture; return mTexture;
} }
......
...@@ -753,6 +753,143 @@ typedef void (INTERNAL_GL_APIENTRY *PFNGLVERTEXARRAYELEMENTBUFFERPROC)(GLuint, G ...@@ -753,6 +753,143 @@ typedef void (INTERNAL_GL_APIENTRY *PFNGLVERTEXARRAYELEMENTBUFFERPROC)(GLuint, G
typedef void (INTERNAL_GL_APIENTRY *PFNGLVERTEXARRAYVERTEXBUFFERPROC)(GLuint, GLuint, GLuint, GLintptr, GLsizei); typedef void (INTERNAL_GL_APIENTRY *PFNGLVERTEXARRAYVERTEXBUFFERPROC)(GLuint, GLuint, GLuint, GLintptr, GLsizei);
typedef void (INTERNAL_GL_APIENTRY *PFNGLVERTEXARRAYVERTEXBUFFERSPROC)(GLuint, GLuint, GLsizei, const GLuint *, const GLintptr *, const GLsizei *); typedef void (INTERNAL_GL_APIENTRY *PFNGLVERTEXARRAYVERTEXBUFFERSPROC)(GLuint, GLuint, GLsizei, const GLuint *, const GLintptr *, const GLsizei *);
// GL_EXT_discard_framebuffer
typedef void(INTERNAL_GL_APIENTRY *PFNGLDISCARDFRAMEBUFFEREXTPROC)(GLenum target,
GLsizei numAttachments,
const GLenum *attachments);
// GL_OES_EGL_image
typedef void *GLeglImageOES;
typedef void(INTERNAL_GL_APIENTRY *PFNGLEGLIMAGETARGETTEXTURE2DOESPROC)(GLenum target,
GLeglImageOES image);
typedef void(INTERNAL_GL_APIENTRY *PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC)(
GLenum target,
GLeglImageOES image);
// NV_path_rendering (originally written against 3.2 compatibility profile)
typedef void(INTERNAL_GL_APIENTRY *PFNGLMATRIXLOADFEXTPROC)(GLenum matrixMode, const GLfloat *m);
typedef void(INTERNAL_GL_APIENTRY *PFNGLMATRIXLOADFNVPROC)(GLenum matrixMode, const GLfloat *m);
typedef void(INTERNAL_GL_APIENTRY *PFNGLMATRIXLOADIDENTITYNVPROC)(GLenum matrixMode);
typedef GLuint(INTERNAL_GL_APIENTRY *PFNGLGENPATHSNVPROC)(GLsizei range);
typedef void(INTERNAL_GL_APIENTRY *PFNGLDELETEPATHSNVPROC)(GLuint path, GLsizei range);
typedef GLboolean(INTERNAL_GL_APIENTRY *PFNGLISPATHNVPROC)(GLuint path);
typedef void(INTERNAL_GL_APIENTRY *PFNGLPATHCOMMANDSNVPROC)(GLuint path,
GLsizei numCommands,
const GLubyte *commands,
GLsizei numCoords,
GLenum coordType,
const void *coords);
typedef void(INTERNAL_GL_APIENTRY *PFNGLPATHPARAMETERINVPROC)(GLuint path,
GLenum pname,
GLint value);
typedef void(INTERNAL_GL_APIENTRY *PFNGLPATHPARAMETERFNVPROC)(GLuint path,
GLenum pname,
GLfloat value);
typedef void(INTERNAL_GL_APIENTRY *PFNGLGETPATHPARAMETERIVNVPROC)(GLuint path,
GLenum pname,
GLint *value);
typedef void(INTERNAL_GL_APIENTRY *PFNGLGETPATHPARAMETERFVNVPROC)(GLuint path,
GLenum pname,
GLfloat *value);
typedef void(INTERNAL_GL_APIENTRY *PFNGLPATHSTENCILFUNCNVPROC)(GLenum func, GLint ref, GLuint mask);
typedef void(INTERNAL_GL_APIENTRY *PFNGLSTENCILFILLPATHNVPROC)(GLuint path,
GLenum fillMode,
GLuint mask);
typedef void(INTERNAL_GL_APIENTRY *PFNGLSTENCILSTROKEPATHNVPROC)(GLuint path,
GLint reference,
GLuint mask);
typedef void(INTERNAL_GL_APIENTRY *PFNGLCOVERFILLPATHNVPROC)(GLuint path, GLenum coverMode);
typedef void(INTERNAL_GL_APIENTRY *PFNGLCOVERSTROKEPATHNVPROC)(GLuint path, GLenum coverMode);
typedef void(INTERNAL_GL_APIENTRY *PFNGLSTENCILTHENCOVERFILLPATHNVPROC)(GLuint path,
GLenum fillMode,
GLuint mask,
GLenum coverMode);
typedef void(INTERNAL_GL_APIENTRY *PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC)(GLuint path,
GLint reference,
GLuint mask,
GLenum coverMode);
typedef void(INTERNAL_GL_APIENTRY *PFNGLCOVERFILLPATHINSTANCEDNVPROC)(
GLsizei numPaths,
GLenum pathNameType,
const void *paths,
GLuint pathBase,
GLenum coverMode,
GLenum transformType,
const GLfloat *transformValues);
typedef void(INTERNAL_GL_APIENTRY *PFNGLCOVERSTROKEPATHINSTANCEDNVPROC)(
GLsizei numPaths,
GLenum pathNameType,
const void *paths,
GLuint pathBase,
GLenum coverMode,
GLenum transformType,
const GLfloat *transformValues);
typedef void(INTERNAL_GL_APIENTRY *PFNGLSTENCILFILLPATHINSTANCEDNVPROC)(
GLsizei numPaths,
GLenum pathNameType,
const void *paths,
GLuint pathBase,
GLenum fillMode,
GLuint mask,
GLenum transformType,
const GLfloat *transformValues);
typedef void(INTERNAL_GL_APIENTRY *PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC)(
GLsizei numPaths,
GLenum pathNameType,
const void *paths,
GLuint pathBase,
GLint reference,
GLuint mask,
GLenum transformType,
const GLfloat *transformValues);
typedef void(INTERNAL_GL_APIENTRY *PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC)(
GLsizei numPaths,
GLenum pathNameType,
const void *paths,
GLuint pathBase,
GLenum fillMode,
GLuint mask,
GLenum coverMode,
GLenum transformType,
const GLfloat *transformValues);
typedef void(INTERNAL_GL_APIENTRY *PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC)(
GLsizei numPaths,
GLenum pathNameType,
const void *paths,
GLuint pathBase,
GLint reference,
GLuint mask,
GLenum coverMode,
GLenum transformType,
const GLfloat *transformValues);
typedef void(INTERNAL_GL_APIENTRY *PFNGLBINDFRAGMENTINPUTLOCATIONNVPROC)(GLuint program,
GLint location,
const GLchar *name);
typedef void(INTERNAL_GL_APIENTRY *PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC)(GLuint program,
GLint location,
GLenum genMode,
GLint components,
const GLfloat *coeffs);
// ES 3.2
typedef void(INTERNAL_GL_APIENTRY *PFNGLBLENDBARRIERPROC)(void);
typedef void(INTERNAL_GL_APIENTRY *PFNGLPRIMITIVEBOUNDINGBOXPROC)(GLfloat minX,
GLfloat minY,
GLfloat minZ,
GLfloat minW,
GLfloat maxX,
GLfloat maxY,
GLfloat maxZ,
GLfloat maxW);
// GL_NV_internalformat_sample_query
typedef void(INTERNAL_GL_APIENTRY *PFNGLGETINTERNALFORMATSAMPLEIVNVPROC)(GLenum target,
GLenum internalformat,
GLsizei samples,
GLenum pname,
GLsizei bufSize,
GLint *params);
} }
#endif // LIBANGLE_RENDERER_GL_FUNCTIONSGLTYPEDEFS_H_ #endif // LIBANGLE_RENDERER_GL_FUNCTIONSGLTYPEDEFS_H_
...@@ -49,7 +49,7 @@ class FunctionsGLGLX : public FunctionsGL ...@@ -49,7 +49,7 @@ class FunctionsGLGLX : public FunctionsGL
~FunctionsGLGLX() override {} ~FunctionsGLGLX() override {}
private: private:
void *loadProcAddress(const std::string &function) override void *loadProcAddress(const std::string &function) const override
{ {
return reinterpret_cast<void*>(mGetProc(function.c_str())); return reinterpret_cast<void*>(mGetProc(function.c_str()));
} }
......
...@@ -44,7 +44,7 @@ class FunctionsGLWindows : public FunctionsGL ...@@ -44,7 +44,7 @@ class FunctionsGLWindows : public FunctionsGL
~FunctionsGLWindows() override {} ~FunctionsGLWindows() override {}
private: private:
void *loadProcAddress(const std::string &function) override void *loadProcAddress(const std::string &function) const override
{ {
void *proc = reinterpret_cast<void*>(mGetProcAddressWGL(function.c_str())); void *proc = reinterpret_cast<void*>(mGetProcAddressWGL(function.c_str()));
if (!proc) if (!proc)
......
...@@ -574,6 +574,8 @@ ...@@ -574,6 +574,8 @@
'libANGLE/renderer/gl/CompilerGL.h', 'libANGLE/renderer/gl/CompilerGL.h',
'libANGLE/renderer/gl/ContextGL.cpp', 'libANGLE/renderer/gl/ContextGL.cpp',
'libANGLE/renderer/gl/ContextGL.h', 'libANGLE/renderer/gl/ContextGL.h',
'libANGLE/renderer/gl/DispatchTableGL_autogen.cpp',
'libANGLE/renderer/gl/DispatchTableGL_autogen.h',
'libANGLE/renderer/gl/DisplayGL.cpp', 'libANGLE/renderer/gl/DisplayGL.cpp',
'libANGLE/renderer/gl/DisplayGL.h', 'libANGLE/renderer/gl/DisplayGL.h',
'libANGLE/renderer/gl/FenceNVGL.cpp', 'libANGLE/renderer/gl/FenceNVGL.cpp',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment