aboutsummaryrefslogtreecommitdiffhomepage
path: root/gpu
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-04 12:35:39 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-04 12:35:39 +0000
commitbf2a46941e8fdebfcd24ea8f7184779021898225 (patch)
tree1fcabf7bad39c8a0e0b49010a82a707ad74a2eff /gpu
parent68ac0dfce295df6a4f9e5c62a933b4c1d429410e (diff)
Add all ES2 glUniform functions to GrGLInterface. Add interface validation for fixed pipe or shader pipe use.
Review URL: http://codereview.appspot.com/4435082/ git-svn-id: http://skia.googlecode.com/svn/trunk@1234 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu')
-rw-r--r--gpu/include/GrGLInterface.h64
-rw-r--r--gpu/src/GrGLInterface.cpp243
-rw-r--r--gpu/src/GrGpuFactory.cpp6
-rw-r--r--gpu/src/mac/GrGLDefaultInterface_mac.cpp21
-rw-r--r--gpu/src/unix/GrGLDefaultInterface_unix.cpp26
-rw-r--r--gpu/src/win/GrGLDefaultInterface_win.cpp21
6 files changed, 354 insertions, 27 deletions
diff --git a/gpu/include/GrGLInterface.h b/gpu/include/GrGLInterface.h
index c9592a5f96..591ab8c2e5 100644
--- a/gpu/include/GrGLInterface.h
+++ b/gpu/include/GrGLInterface.h
@@ -19,6 +19,7 @@
#define GrGLInterface_DEFINED
#include "GrGLConfig.h"
+#include "GrTypes.h"
#if !defined(GR_GL_FUNCTION_TYPE)
#define GR_GL_FUNCTION_TYPE
@@ -83,16 +84,6 @@ enum GrGLBinding {
};
extern "C" {
-/*
- * The following interface exports the OpenGL entry points used by the system.
- * Use of OpenGL calls is disallowed. All calls should be invoked through
- * the global instance of this struct, defined above.
- *
- * IMPORTANT NOTE: The OpenGL entry points exposed here include both core GL
- * functions, and extensions. The system assumes that the address of the
- * extension pointer will be valid across contexts.
- */
-struct GrGLInterface {
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLActiveTextureProc)(GrGLenum texture);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLAttachShaderProc)(GrGLuint program, GrGLuint shader);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindAttribLocationProc)(GrGLuint program, GrGLuint index, const char* name);
@@ -160,10 +151,25 @@ struct GrGLInterface {
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexImage2DProc)(GrGLenum target, GrGLint level, GrGLint internalformat, GrGLsizei width, GrGLsizei height, GrGLint border, GrGLenum format, GrGLenum type, const GrGLvoid* pixels);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexParameteriProc)(GrGLenum target, GrGLenum pname, GrGLint param);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexSubImage2DProc)(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, const GrGLvoid* pixels);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform1fProc)(GrGLint location, GrGLfloat v0);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform1iProc)(GrGLint location, GrGLint v0);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform1fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v);
- typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform1iProc)(GrGLint location, GrGLint x);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform1ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform2fProc)(GrGLint location, GrGLfloat v0, GrGLfloat v1);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform2iProc)(GrGLint location, GrGLint v0, GrGLint v1);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform2fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform2ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform3fProc)(GrGLint location, GrGLfloat v0, GrGLfloat v1, GrGLfloat v2);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform3iProc)(GrGLint location, GrGLint v0, GrGLint v1, GrGLint v2);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform3fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform3ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform4fProc)(GrGLint location, GrGLfloat v0, GrGLfloat v1, GrGLfloat v2, GrGLfloat v3);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform4iProc)(GrGLint location, GrGLint v0, GrGLint v1, GrGLint v2, GrGLint v3);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform4fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform4ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniformMatrix2fvProc)(GrGLint location, GrGLsizei count, GrGLboolean transpose, const GrGLfloat* value);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniformMatrix3fvProc)(GrGLint location, GrGLsizei count, GrGLboolean transpose, const GrGLfloat* value);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniformMatrix4fvProc)(GrGLint location, GrGLsizei count, GrGLboolean transpose, const GrGLfloat* value);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUseProgramProc)(GrGLuint program);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLVertexAttrib4fvProc)(GrGLuint indx, const GrGLfloat* values);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLVertexAttribPointerProc)(GrGLuint indx, GrGLint size, GrGLenum type, GrGLboolean normalized, GrGLsizei stride, const GrGLvoid* ptr);
@@ -193,6 +199,19 @@ struct GrGLInterface {
// Buffer mapping (extension in ES).
typedef GrGLvoid* (GR_GL_FUNCTION_TYPE *GrGLMapBufferProc)(GrGLenum target, GrGLenum access);
typedef GrGLboolean (GR_GL_FUNCTION_TYPE *GrGLUnmapBufferProc)(GrGLenum target);
+} // extern "C"
+
+/*
+ * The following interface exports the OpenGL entry points used by the system.
+ * Use of OpenGL calls is disallowed. All calls should be invoked through
+ * the global instance of this struct, defined above.
+ *
+ * IMPORTANT NOTE: The OpenGL entry points exposed here include both core GL
+ * functions, and extensions. The system assumes that the address of the
+ * extension pointer will be valid across contexts.
+ */
+struct GrGLInterface {
+ bool validate(GrEngine engine) const;
// Indicator variable specifying the type of GL implementation
// exported: GLES{1|2} or Desktop.
@@ -265,10 +284,25 @@ struct GrGLInterface {
GrGLTexImage2DProc fTexImage2D;
GrGLTexParameteriProc fTexParameteri;
GrGLTexSubImage2DProc fTexSubImage2D;
- GrGLUniform1fvProc fUniform1fv;
+ GrGLUniform1fProc fUniform1f;
GrGLUniform1iProc fUniform1i;
+ GrGLUniform1fvProc fUniform1fv;
+ GrGLUniform1ivProc fUniform1iv;
+ GrGLUniform2fProc fUniform2f;
+ GrGLUniform2iProc fUniform2i;
+ GrGLUniform2fvProc fUniform2fv;
+ GrGLUniform2ivProc fUniform2iv;
+ GrGLUniform3fProc fUniform3f;
+ GrGLUniform3iProc fUniform3i;
+ GrGLUniform3fvProc fUniform3fv;
+ GrGLUniform3ivProc fUniform3iv;
+ GrGLUniform4fProc fUniform4f;
+ GrGLUniform4iProc fUniform4i;
GrGLUniform4fvProc fUniform4fv;
+ GrGLUniform4ivProc fUniform4iv;
+ GrGLUniformMatrix2fvProc fUniformMatrix2fv;
GrGLUniformMatrix3fvProc fUniformMatrix3fv;
+ GrGLUniformMatrix4fvProc fUniformMatrix4fv;
GrGLUseProgramProc fUseProgram;
GrGLVertexAttrib4fvProc fVertexAttrib4fv;
GrGLVertexAttribPointerProc fVertexAttribPointer;
@@ -303,8 +337,10 @@ struct GrGLInterface {
// make this the last entry in the static initializer. It can help to guard
// against failing to initialize newly-added members of this struct.
enum { kStaticInitEndGuard } fStaticInitEndGuard;
-};
-} // extern "C"
+private:
+ bool validateShaderFunctions() const;
+ bool validateFixedFunctions() const;
+};
#endif
diff --git a/gpu/src/GrGLInterface.cpp b/gpu/src/GrGLInterface.cpp
index 5dfc03ca4f..319d33f680 100644
--- a/gpu/src/GrGLInterface.cpp
+++ b/gpu/src/GrGLInterface.cpp
@@ -93,3 +93,246 @@ void gl_version(int* major, int* minor) {
GrGLGetGLInterface()->fGetString(GR_GL_VERSION));
gl_version_from_string(major, minor, v);
}
+
+bool GrGLInterface::validateShaderFunctions() const {
+ // required for GrGpuGLShaders
+ if (NULL == fAttachShader ||
+ NULL == fBindAttribLocation ||
+ NULL == fCompileShader ||
+ NULL == fCreateProgram ||
+ NULL == fCreateShader ||
+ NULL == fDeleteProgram ||
+ NULL == fDeleteShader ||
+ NULL == fDisableVertexAttribArray ||
+ NULL == fEnableVertexAttribArray ||
+ NULL == fGetProgramInfoLog ||
+ NULL == fGetProgramiv ||
+ NULL == fGetShaderInfoLog ||
+ NULL == fGetShaderiv ||
+ NULL == fGetUniformLocation ||
+ NULL == fLinkProgram ||
+ NULL == fShaderSource ||
+ NULL == fUniform1f ||
+ NULL == fUniform1i ||
+ NULL == fUniform1fv ||
+ NULL == fUniform1iv ||
+ NULL == fUniform2f ||
+ NULL == fUniform2i ||
+ NULL == fUniform2fv ||
+ NULL == fUniform2iv ||
+ NULL == fUniform3f ||
+ NULL == fUniform3i ||
+ NULL == fUniform3fv ||
+ NULL == fUniform3iv ||
+ NULL == fUniform4f ||
+ NULL == fUniform4i ||
+ NULL == fUniform4fv ||
+ NULL == fUniform4iv ||
+ NULL == fUniformMatrix2fv ||
+ NULL == fUniformMatrix3fv ||
+ NULL == fUniformMatrix4fv ||
+ NULL == fUseProgram ||
+ NULL == fVertexAttrib4fv ||
+ NULL == fVertexAttribPointer) {
+ return false;
+ }
+ return true;
+}
+
+bool GrGLInterface::validateFixedFunctions() const {
+ if (NULL == fClientActiveTexture ||
+ NULL == fColor4ub ||
+ NULL == fColorPointer ||
+ NULL == fDisableClientState ||
+ NULL == fEnableClientState ||
+ NULL == fLoadMatrixf ||
+ NULL == fMatrixMode ||
+ NULL == fPointSize ||
+ NULL == fShadeModel ||
+ NULL == fTexCoordPointer ||
+ NULL == fVertexPointer) {
+ return false;
+ }
+ return true;
+}
+
+bool GrGLInterface::validate(GrEngine engine) const {
+
+ bool isDesktop = kDesktop_GrGLBinding == fBindingsExported;
+
+ // ES1 and 2 can be supported in the same interface
+ bool isES = ((kES1_GrGLBinding | kES2_GrGLBinding) & fBindingsExported &&
+ !(~(kES1_GrGLBinding | kES2_GrGLBinding) & fBindingsExported));
+
+ if (!isDesktop && !isES) {
+ return false;
+ }
+
+ // functions that are always required
+ if (NULL == fActiveTexture ||
+ NULL == fBindBuffer ||
+ NULL == fBindTexture ||
+ NULL == fBlendFunc ||
+ NULL == fBufferData ||
+ NULL == fBufferSubData ||
+ NULL == fClear ||
+ NULL == fClearColor ||
+ NULL == fClearStencil ||
+ NULL == fColorMask ||
+ NULL == fCullFace ||
+ NULL == fDeleteBuffers ||
+ NULL == fDeleteTextures ||
+ NULL == fDepthMask ||
+ NULL == fDisable ||
+ NULL == fDrawArrays ||
+ NULL == fDrawElements ||
+ NULL == fEnable ||
+ NULL == fFrontFace ||
+ NULL == fGenBuffers ||
+ NULL == fGenTextures ||
+ NULL == fGetBufferParameteriv ||
+ NULL == fGetError ||
+ NULL == fGetIntegerv ||
+ NULL == fGetString ||
+ NULL == fPixelStorei ||
+ NULL == fReadPixels ||
+ NULL == fScissor ||
+ NULL == fStencilFunc ||
+ NULL == fStencilMask ||
+ NULL == fStencilOp ||
+ NULL == fTexEnvi ||
+ NULL == fTexImage2D ||
+ NULL == fTexParameteri ||
+ NULL == fTexSubImage2D ||
+ NULL == fViewport ||
+ NULL == fBindFramebuffer ||
+ NULL == fBindRenderbuffer ||
+ NULL == fCheckFramebufferStatus ||
+ NULL == fDeleteFramebuffers ||
+ NULL == fDeleteRenderbuffers ||
+ NULL == fFramebufferRenderbuffer ||
+ NULL == fFramebufferTexture2D ||
+ NULL == fGenFramebuffers ||
+ NULL == fGenRenderbuffers ||
+ NULL == fRenderbufferStorage) {
+ return false;
+ }
+
+ switch (engine) {
+ case kOpenGL_Shaders_GrEngine:
+ if (kES1_GrGLBinding == fBindingsExported) {
+ return false;
+ }
+ if (!this->validateShaderFunctions()) {
+ return false;
+ }
+ break;
+ case kOpenGL_Fixed_GrEngine:
+ if (kES1_GrGLBinding == fBindingsExported) {
+ return false;
+ }
+ if (!this->validateFixedFunctions()) {
+ return false;
+ }
+ break;
+ default:
+ return false;
+ }
+
+ int major, minor;
+ const char* ext;
+
+ gl_version(&major, &minor);
+ ext = (const char*)fGetString(GR_GL_EXTENSIONS);
+
+ // Now check that baseline ES/Desktop fns not covered above are present
+ // and that we have fn pointers for any advertised extensions that we will
+ // try to use.
+
+ // these functions are part of ES2, we assume they are available
+ // On the desktop we assume they are available if the extension
+ // is present or GL version is high enough.
+ if ((kES2_GrGLBinding & fBindingsExported)) {
+ if (NULL == fBlendColor ||
+ NULL == fStencilFuncSeparate ||
+ NULL == fStencilMaskSeparate ||
+ NULL == fStencilOpSeparate) {
+ return false;
+ }
+ } else if (kDesktop_GrGLBinding == fBindingsExported) {
+ if (major >= 2) {
+ if (NULL == fStencilFuncSeparate ||
+ NULL == fStencilMaskSeparate ||
+ NULL == fStencilOpSeparate) {
+ return false;
+ }
+ }
+ if (1 < major || (1 == major && 4 <= minor) ||
+ has_gl_extension_from_string("GL_EXT_blend_color", ext)) {
+ if (NULL == fBlendColor) {
+ return false;
+ }
+ }
+ }
+
+ // optional function on desktop before 1.3
+ if (kDesktop_GrGLBinding != fBindingsExported ||
+ (1 < major || (1 == major && 3 <= minor)) ||
+ has_gl_extension_from_string("GL_ARB_texture_compression", ext)) {
+ if (NULL == fCompressedTexImage2D) {
+ return false;
+ }
+ }
+
+ // part of desktop GL
+ if (kDesktop_GrGLBinding == fBindingsExported &&
+ NULL == fLineWidth) {
+ return false;
+ }
+ // FBO MSAA
+ if (kDesktop_GrGLBinding == fBindingsExported) {
+ // GL 3.0 and the ARB extension have multisample + blit
+ if ((major >= 3) || has_gl_extension_from_string("GL_ARB_framebuffer_object", ext)) {
+ if (NULL == fRenderbufferStorageMultisample ||
+ NULL == fBlitFramebuffer) {
+ return false;
+ }
+ } else {
+ if (has_gl_extension_from_string("GL_EXT_framebuffer_blit", ext) &&
+ NULL == fBlitFramebuffer) {
+ return false;
+ }
+ if (has_gl_extension_from_string("GL_EXT_framebuffer_multisample", ext) &&
+ NULL == fRenderbufferStorageMultisample) {
+ return false;
+ }
+ }
+ } else {
+ if (has_gl_extension_from_string("GL_CHROMIUM_framebuffer_multisample", ext)) {
+ if (NULL == fRenderbufferStorageMultisample ||
+ NULL == fBlitFramebuffer) {
+ return false;
+ }
+ }
+ if (has_gl_extension_from_string("GL_APPLE_framebuffer_multisample", ext)) {
+ if (NULL == fRenderbufferStorageMultisample ||
+ NULL == fResolveMultisampleFramebuffer) {
+ return false;
+ }
+ }
+ }
+
+ // On ES buffer mapping is an extension. On Desktop
+ // buffer mapping was part of original VBO extension
+ // which we require.
+ if (kDesktop_GrGLBinding == fBindingsExported ||
+ has_gl_extension_from_string("GL_OES_mapbuffer", ext)) {
+ if (NULL == fMapBuffer ||
+ NULL == fUnmapBuffer) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
diff --git a/gpu/src/GrGpuFactory.cpp b/gpu/src/GrGpuFactory.cpp
index c6f541c7bb..0e316a49ad 100644
--- a/gpu/src/GrGpuFactory.cpp
+++ b/gpu/src/GrGpuFactory.cpp
@@ -41,6 +41,12 @@ GrGpu* GrGpu::Create(GrEngine engine, GrPlatform3DContext context3D) {
return NULL;
}
}
+ if (!GrGLGetGLInterface()->validate(engine)) {
+#if GR_DEBUG
+ GrPrintf("Failed GL interface validation!");
+#endif
+ return NULL;
+ }
}
GrGpu* gpu = NULL;
diff --git a/gpu/src/mac/GrGLDefaultInterface_mac.cpp b/gpu/src/mac/GrGLDefaultInterface_mac.cpp
index 802d717886..b9396faace 100644
--- a/gpu/src/mac/GrGLDefaultInterface_mac.cpp
+++ b/gpu/src/mac/GrGLDefaultInterface_mac.cpp
@@ -91,14 +91,29 @@ void GrGLSetDefaultGLInterface() {
gDefaultInterface.fTexEnvi = glTexEnvi;
// mac uses GLenum for internalFormat param (non-standard)
// amounts to int vs. uint.
- gDefaultInterface.fTexImage2D =
- (GrGLInterface::GrGLTexImage2DProc)glTexImage2D;
+ gDefaultInterface.fTexImage2D = (GrGLTexImage2DProc)glTexImage2D;
gDefaultInterface.fTexParameteri = glTexParameteri;
gDefaultInterface.fTexSubImage2D = glTexSubImage2D;
- gDefaultInterface.fUniform1fv = glUniform1fv;
+ gDefaultInterface.fUniform1f = glUniform1f;
gDefaultInterface.fUniform1i = glUniform1i;
+ gDefaultInterface.fUniform1fv = glUniform1fv;
+ gDefaultInterface.fUniform1iv = glUniform1iv;
+ gDefaultInterface.fUniform2f = glUniform2f;
+ gDefaultInterface.fUniform2i = glUniform2i;
+ gDefaultInterface.fUniform2fv = glUniform2fv;
+ gDefaultInterface.fUniform2iv = glUniform2iv;
+ gDefaultInterface.fUniform3f = glUniform3f;
+ gDefaultInterface.fUniform3i = glUniform3i;
+ gDefaultInterface.fUniform3fv = glUniform3fv;
+ gDefaultInterface.fUniform3iv = glUniform3iv;
+ gDefaultInterface.fUniform4f = glUniform4f;
+ gDefaultInterface.fUniform4i = glUniform4i;
+ gDefaultInterface.fUniform4fv = glUniform4fv;
+ gDefaultInterface.fUniform4iv = glUniform4iv;
gDefaultInterface.fUniform4fv = glUniform4fv;
+ gDefaultInterface.fUniformMatrix2fv = glUniformMatrix2fv;
gDefaultInterface.fUniformMatrix3fv = glUniformMatrix3fv;
+ gDefaultInterface.fUniformMatrix4fv = glUniformMatrix4fv;
gDefaultInterface.fUnmapBuffer = glUnmapBuffer;
gDefaultInterface.fUseProgram = glUseProgram;
gDefaultInterface.fVertexAttrib4fv = glVertexAttrib4fv;
diff --git a/gpu/src/unix/GrGLDefaultInterface_unix.cpp b/gpu/src/unix/GrGLDefaultInterface_unix.cpp
index 6d6873d5a2..4c1e89ecd2 100644
--- a/gpu/src/unix/GrGLDefaultInterface_unix.cpp
+++ b/gpu/src/unix/GrGLDefaultInterface_unix.cpp
@@ -21,9 +21,9 @@
#include <GL/glext.h>
#include <GL/glu.h>
-#define GR_GL_GET_PROC(F) gDefaultInterface.f ## F = (GrGLInterface::GrGL ## F ## Proc) \
+#define GR_GL_GET_PROC(F) gDefaultInterface.f ## F = (GrGL ## F ## Proc) \
glXGetProcAddress(reinterpret_cast<const GLubyte*>("gl" #F));
-#define GR_GL_GET_PROC_SUFFIX(F, S) gDefaultInterface.f ## F = (GrGLInterface::GrGL ## F ## Proc) \
+#define GR_GL_GET_PROC_SUFFIX(F, S) gDefaultInterface.f ## F = (GrGL ## F ## Proc) \
glXGetProcAddress(reinterpret_cast<const GLubyte*>("gl" #F #S));
void GrGLSetDefaultGLInterface() {
@@ -105,16 +105,28 @@ void GrGLSetDefaultGLInterface() {
GR_GL_GET_PROC(StencilOpSeparate);
gDefaultInterface.fTexCoordPointer = glTexCoordPointer;
gDefaultInterface.fTexEnvi = glTexEnvi;
- // mac uses GLenum for internalFormat param (non-standard)
- // amounts to int vs. uint.
- gDefaultInterface.fTexImage2D =
- (GrGLInterface::GrGLTexImage2DProc)glTexImage2D;
+ gDefaultInterface.fTexImage2D = glTexImage2D;
gDefaultInterface.fTexParameteri = glTexParameteri;
gDefaultInterface.fTexSubImage2D = glTexSubImage2D;
- GR_GL_GET_PROC(Uniform1fv);
+ GR_GL_GET_PROC(Uniform1f);
GR_GL_GET_PROC(Uniform1i);
+ GR_GL_GET_PROC(Uniform1fv);
+ GR_GL_GET_PROC(Uniform1iv);
+ GR_GL_GET_PROC(Uniform2f);
+ GR_GL_GET_PROC(Uniform2i);
+ GR_GL_GET_PROC(Uniform2fv);
+ GR_GL_GET_PROC(Uniform2iv);
+ GR_GL_GET_PROC(Uniform3f);
+ GR_GL_GET_PROC(Uniform3i);
+ GR_GL_GET_PROC(Uniform3fv);
+ GR_GL_GET_PROC(Uniform3iv);
+ GR_GL_GET_PROC(Uniform4f);
+ GR_GL_GET_PROC(Uniform4i);
GR_GL_GET_PROC(Uniform4fv);
+ GR_GL_GET_PROC(Uniform4iv);
+ GR_GL_GET_PROC(UniformMatrix2fv);
GR_GL_GET_PROC(UniformMatrix3fv);
+ GR_GL_GET_PROC(UniformMatrix4fv);
GR_GL_GET_PROC(UnmapBuffer);
GR_GL_GET_PROC(UseProgram);
GR_GL_GET_PROC(VertexAttrib4fv);
diff --git a/gpu/src/win/GrGLDefaultInterface_win.cpp b/gpu/src/win/GrGLDefaultInterface_win.cpp
index 62270151f6..53fb26a17a 100644
--- a/gpu/src/win/GrGLDefaultInterface_win.cpp
+++ b/gpu/src/win/GrGLDefaultInterface_win.cpp
@@ -25,8 +25,8 @@
* Otherwise, a springboard would be needed that hides the calling convention.
*/
-#define GR_GL_GET_PROC(F) gDefaultInterface.f ## F = (GrGLInterface::GrGL ## F ## Proc) wglGetProcAddress("gl" #F);
-#define GR_GL_GET_PROC_SUFFIX(F, S) gDefaultInterface.f ## F = (GrGLInterface::GrGL ## F ## Proc) wglGetProcAddress("gl" #F #S);
+#define GR_GL_GET_PROC(F) gDefaultInterface.f ## F = (GrGL ## F ## Proc) wglGetProcAddress("gl" #F);
+#define GR_GL_GET_PROC_SUFFIX(F, S) gDefaultInterface.f ## F = (GrGL ## F ## Proc) wglGetProcAddress("gl" #F #S);
void GrGLSetDefaultGLInterface() {
static GrGLInterface gDefaultInterface;
@@ -117,10 +117,25 @@ void GrGLSetDefaultGLInterface() {
GR_GL_GET_PROC(StencilFuncSeparate);
GR_GL_GET_PROC(StencilMaskSeparate);
GR_GL_GET_PROC(StencilOpSeparate);
- GR_GL_GET_PROC(Uniform1fv);
+ GR_GL_GET_PROC(Uniform1f);
GR_GL_GET_PROC(Uniform1i);
+ GR_GL_GET_PROC(Uniform1fv);
+ GR_GL_GET_PROC(Uniform1iv);
+ GR_GL_GET_PROC(Uniform2f);
+ GR_GL_GET_PROC(Uniform2i);
+ GR_GL_GET_PROC(Uniform2fv);
+ GR_GL_GET_PROC(Uniform2iv);
+ GR_GL_GET_PROC(Uniform3f);
+ GR_GL_GET_PROC(Uniform3i);
+ GR_GL_GET_PROC(Uniform3fv);
+ GR_GL_GET_PROC(Uniform3iv);
+ GR_GL_GET_PROC(Uniform4f);
+ GR_GL_GET_PROC(Uniform4i);
GR_GL_GET_PROC(Uniform4fv);
+ GR_GL_GET_PROC(Uniform4iv);
+ GR_GL_GET_PROC(UniformMatrix2fv);
GR_GL_GET_PROC(UniformMatrix3fv);
+ GR_GL_GET_PROC(UniformMatrix4fv);
GR_GL_GET_PROC(UseProgram);
GR_GL_GET_PROC(VertexAttrib4fv);
GR_GL_GET_PROC(VertexAttribPointer);