gl: fix build on OS X

Also add missing switch cases which cause a compiler warning on OS X.
They are unused so far.

Fixes golang/go#16071

Change-Id: I5ced5a814a7abc956b0b0cdad211ecd69a54a95b
Reviewed-on: https://go-review.googlesource.com/24177
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This commit is contained in:
David Crawshaw 2016-06-16 15:45:59 -04:00
parent 3919ffce20
commit 2bbe618778
2 changed files with 13 additions and 0 deletions

View File

@ -416,6 +416,9 @@ uintptr_t processFn(struct fnargs* args, char* parg) {
case glfnUniform1ui: case glfnUniform1ui:
glUniform1ui((GLint)args->a0, (GLuint)args->a1); glUniform1ui((GLint)args->a0, (GLuint)args->a1);
break; break;
case glfnUniform1uiv:
glUniform1uiv((GLint)args->a0, (GLsizeiptr)args->a1, (GLuint*)parg);
break;
case glfnUniform1iv: case glfnUniform1iv:
glUniform1iv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg); glUniform1iv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg);
break; break;
@ -431,6 +434,9 @@ uintptr_t processFn(struct fnargs* args, char* parg) {
case glfnUniform2ui: case glfnUniform2ui:
glUniform2ui((GLint)args->a0, (GLuint)args->a1, (GLuint)args->a2); glUniform2ui((GLint)args->a0, (GLuint)args->a1, (GLuint)args->a2);
break; break;
case glfnUniform2uiv:
glUniform2uiv((GLint)args->a0, (GLsizeiptr)args->a1, (GLuint*)parg);
break;
case glfnUniform2iv: case glfnUniform2iv:
glUniform2iv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg); glUniform2iv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg);
break; break;
@ -446,6 +452,9 @@ uintptr_t processFn(struct fnargs* args, char* parg) {
case glfnUniform3ui: case glfnUniform3ui:
glUniform3ui((GLint)args->a0, (GLuint)args->a1, (GLuint)args->a2, (GLuint)args->a3); glUniform3ui((GLint)args->a0, (GLuint)args->a1, (GLuint)args->a2, (GLuint)args->a3);
break; break;
case glfnUniform3uiv:
glUniform3uiv((GLint)args->a0, (GLsizeiptr)args->a1, (GLuint*)parg);
break;
case glfnUniform3iv: case glfnUniform3iv:
glUniform3iv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg); glUniform3iv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg);
break; break;
@ -461,6 +470,9 @@ uintptr_t processFn(struct fnargs* args, char* parg) {
case glfnUniform4ui: case glfnUniform4ui:
glUniform4ui((GLint)args->a0, (GLuint)args->a1, (GLuint)args->a2, (GLuint)args->a3, (GLuint)args->a4); glUniform4ui((GLint)args->a0, (GLuint)args->a1, (GLuint)args->a2, (GLuint)args->a3, (GLuint)args->a4);
break; break;
case glfnUniform4uiv:
glUniform4uiv((GLint)args->a0, (GLsizeiptr)args->a1, (GLuint*)parg);
break;
case glfnUniform4iv: case glfnUniform4iv:
glUniform4iv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg); glUniform4iv((GLint)args->a0, (GLsizeiptr)args->a1, (GLvoid*)parg);
break; break;

View File

@ -18,6 +18,7 @@
#ifdef os_osx #ifdef os_osx
#include <OpenGL/gl3.h> #include <OpenGL/gl3.h>
#define GL_ES_VERSION_3_0 1
#endif #endif
#if defined(GL_ES_VERSION_3_0) && GL_ES_VERSION_3_0 #if defined(GL_ES_VERSION_3_0) && GL_ES_VERSION_3_0