aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2014-10-31 10:55:06 +0100
committerbohu <bohu@google.com>2014-11-25 12:31:48 -0800
commit92a73be1a361353e0c3577002e477db68fa00d45 (patch)
tree4f125a925a3fdfda5cdae222743ce0552bd10245
parentc8f4ebe81beb0ee0a10d466bc5559fc0d9c783e8 (diff)
downloadsdk-92a73be1a361353e0c3577002e477db68fa00d45.zip
sdk-92a73be1a361353e0c3577002e477db68fa00d45.tar.gz
sdk-92a73be1a361353e0c3577002e477db68fa00d45.tar.bz2
emulator/opengl: Fix glShaderSource() signature.
The glShaderSource() function really takes a 'const GLchar* const*' parameter, not 'const GLchar**'. This creates issues when compiling the auto-generated encoders created with the latest version of 'emugen' and the GL2 Khronos headers. This patch is used to fix the issue. Note that it requires defining a new type in gl2.types, as well as fixing the signature of misc functions in the translator. Change-Id: I750f95f2e33d83b3b5563642ad7f87e4b8a37f35
-rw-r--r--emulator/opengl/host/libs/GLESv2_dec/gl2.in2
-rw-r--r--emulator/opengl/host/libs/GLESv2_dec/gl2.types1
-rw-r--r--emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp2
-rw-r--r--emulator/opengl/host/libs/Translator/GLES_V2/ShaderParser.cpp2
-rw-r--r--emulator/opengl/host/libs/Translator/GLES_V2/ShaderParser.h2
-rw-r--r--emulator/opengl/host/libs/Translator/GLcommon/DummyGLfuncs.cpp2
-rw-r--r--emulator/opengl/host/libs/Translator/GLcommon/DummyGLfuncs.h2
-rw-r--r--emulator/opengl/host/libs/Translator/GLcommon/GLDispatch.cpp2
-rw-r--r--emulator/opengl/host/libs/Translator/include/GLES2/gl2.h2
-rw-r--r--emulator/opengl/host/libs/Translator/include/GLcommon/GLDispatch.h2
10 files changed, 10 insertions, 9 deletions
diff --git a/emulator/opengl/host/libs/GLESv2_dec/gl2.in b/emulator/opengl/host/libs/GLESv2_dec/gl2.in
index 916153b..925eb98 100644
--- a/emulator/opengl/host/libs/GLESv2_dec/gl2.in
+++ b/emulator/opengl/host/libs/GLESv2_dec/gl2.in
@@ -96,7 +96,7 @@ GL_ENTRY(void, glRenderbufferStorage, GLenum target, GLenum internalformat, GLsi
GL_ENTRY(void, glSampleCoverage, GLclampf value, GLboolean invert)
GL_ENTRY(void, glScissor, GLint x, GLint y, GLsizei width, GLsizei height)
GL_ENTRY(void, glShaderBinary, GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length)
-GL_ENTRY(void, glShaderSource, GLuint shader, GLsizei count, const GLchar** string, const GLint* length)
+GL_ENTRY(void, glShaderSource, GLuint shader, GLsizei count, const GLchar*const* string, const GLint* length)
GL_ENTRY(void, glStencilFunc, GLenum func, GLint ref, GLuint mask)
GL_ENTRY(void, glStencilFuncSeparate, GLenum face, GLenum func, GLint ref, GLuint mask)
GL_ENTRY(void, glStencilMask, GLuint mask)
diff --git a/emulator/opengl/host/libs/GLESv2_dec/gl2.types b/emulator/opengl/host/libs/GLESv2_dec/gl2.types
index ab4eae3..2f5c0c3 100644
--- a/emulator/opengl/host/libs/GLESv2_dec/gl2.types
+++ b/emulator/opengl/host/libs/GLESv2_dec/gl2.types
@@ -34,3 +34,4 @@ GLvoid** 32 0x%08x
void* 32 0x%08x
GLstr* 32 0x%08x
GLvoidptr* 32 0x%08x
+GLchar*const* 32 0x%08x
diff --git a/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp b/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp
index 476d0e6..833a4ce 100644
--- a/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp
+++ b/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp
@@ -1767,7 +1767,7 @@ GL_APICALL void GL_APIENTRY glShaderBinary(GLsizei n, const GLuint* shaders, GL
}
}
-GL_APICALL void GL_APIENTRY glShaderSource(GLuint shader, GLsizei count, const GLchar** string, const GLint* length){
+GL_APICALL void GL_APIENTRY glShaderSource(GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length){
GET_CTX_V2();
SET_ERROR_IF(count < 0,GL_INVALID_VALUE);
if(ctx->shareGroup().Ptr()){
diff --git a/emulator/opengl/host/libs/Translator/GLES_V2/ShaderParser.cpp b/emulator/opengl/host/libs/Translator/GLES_V2/ShaderParser.cpp
index ca17514..4e14a29 100644
--- a/emulator/opengl/host/libs/Translator/GLES_V2/ShaderParser.cpp
+++ b/emulator/opengl/host/libs/Translator/GLES_V2/ShaderParser.cpp
@@ -39,7 +39,7 @@ ShaderParser::ShaderParser(GLenum type):ObjectData(SHADER_DATA),
m_infoLog[0] = '\0';
};
-void ShaderParser::setSrc(const Version& ver,GLsizei count,const GLchar** strings,const GLint* length){
+void ShaderParser::setSrc(const Version& ver,GLsizei count,const GLchar* const* strings,const GLint* length){
m_src.clear();
for(int i = 0;i<count;i++){
m_src.append(strings[i]);
diff --git a/emulator/opengl/host/libs/Translator/GLES_V2/ShaderParser.h b/emulator/opengl/host/libs/Translator/GLES_V2/ShaderParser.h
index 6da5476..8cd3940 100644
--- a/emulator/opengl/host/libs/Translator/GLES_V2/ShaderParser.h
+++ b/emulator/opengl/host/libs/Translator/GLES_V2/ShaderParser.h
@@ -26,7 +26,7 @@ class ShaderParser:public ObjectData{
public:
ShaderParser();
ShaderParser(GLenum type);
- void setSrc(const Version& ver,GLsizei count,const GLchar** strings,const GLint* length);
+ void setSrc(const Version& ver,GLsizei count,const GLchar* const* strings,const GLint* length);
const char* getOriginalSrc();
const GLchar** parsedLines();
GLenum getType();
diff --git a/emulator/opengl/host/libs/Translator/GLcommon/DummyGLfuncs.cpp b/emulator/opengl/host/libs/Translator/GLcommon/DummyGLfuncs.cpp
index e4b632d..cc0e3ec 100644
--- a/emulator/opengl/host/libs/Translator/GLcommon/DummyGLfuncs.cpp
+++ b/emulator/opengl/host/libs/Translator/GLcommon/DummyGLfuncs.cpp
@@ -251,6 +251,6 @@
void GL_APIENTRY dummy_glReleaseShaderCompiler(void){}
void GL_APIENTRY dummy_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height){}
void GL_APIENTRY dummy_glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length){}
- void GL_APIENTRY dummy_glShaderSource(GLuint shader, GLsizei count, const GLchar** string, const GLint* length){}
+ void GL_APIENTRY dummy_glShaderSource(GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length){}
void GL_APIENTRY dummy_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer){}
void GL_APIENTRY dummy_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level){}
diff --git a/emulator/opengl/host/libs/Translator/GLcommon/DummyGLfuncs.h b/emulator/opengl/host/libs/Translator/GLcommon/DummyGLfuncs.h
index f72107c..dd5379c 100644
--- a/emulator/opengl/host/libs/Translator/GLcommon/DummyGLfuncs.h
+++ b/emulator/opengl/host/libs/Translator/GLcommon/DummyGLfuncs.h
@@ -258,7 +258,7 @@
void GL_APIENTRY dummy_glReleaseShaderCompiler(void);
void GL_APIENTRY dummy_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
void GL_APIENTRY dummy_glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
- void GL_APIENTRY dummy_glShaderSource(GLuint shader, GLsizei count, const GLchar** string, const GLint* length);
+ void GL_APIENTRY dummy_glShaderSource(GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length);
void GL_APIENTRY dummy_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
void GL_APIENTRY dummy_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
diff --git a/emulator/opengl/host/libs/Translator/GLcommon/GLDispatch.cpp b/emulator/opengl/host/libs/Translator/GLcommon/GLDispatch.cpp
index 5da7247..3f091d1 100644
--- a/emulator/opengl/host/libs/Translator/GLcommon/GLDispatch.cpp
+++ b/emulator/opengl/host/libs/Translator/GLcommon/GLDispatch.cpp
@@ -293,7 +293,7 @@ void (GL_APIENTRY *GLDispatch::glGetUniformiv)(GLuint,GLint,GLint*) = NULL;
int (GL_APIENTRY *GLDispatch::glGetUniformLocation)(GLuint,const GLchar*) = NULL;
void (GL_APIENTRY *GLDispatch::glReleaseShaderCompiler)() = NULL;
void (GL_APIENTRY *GLDispatch::glShaderBinary)(GLsizei,const GLuint*,GLenum,const GLvoid*,GLsizei) = NULL;
-void (GL_APIENTRY *GLDispatch::glShaderSource)(GLuint,GLsizei,const GLchar**,const GLint*) = NULL;
+void (GL_APIENTRY *GLDispatch::glShaderSource)(GLuint,GLsizei,const GLchar* const*,const GLint*) = NULL;
GLDispatch::GLDispatch():m_isLoaded(false){};
diff --git a/emulator/opengl/host/libs/Translator/include/GLES2/gl2.h b/emulator/opengl/host/libs/Translator/include/GLES2/gl2.h
index e1d3b87..eae81f4 100644
--- a/emulator/opengl/host/libs/Translator/include/GLES2/gl2.h
+++ b/emulator/opengl/host/libs/Translator/include/GLES2/gl2.h
@@ -569,7 +569,7 @@ GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum
GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
-GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar** string, const GLint* length);
+GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length);
GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
diff --git a/emulator/opengl/host/libs/Translator/include/GLcommon/GLDispatch.h b/emulator/opengl/host/libs/Translator/include/GLcommon/GLDispatch.h
index 18a989c..6eda55b 100644
--- a/emulator/opengl/host/libs/Translator/include/GLcommon/GLDispatch.h
+++ b/emulator/opengl/host/libs/Translator/include/GLcommon/GLDispatch.h
@@ -257,7 +257,7 @@ public:
static int (GL_APIENTRY *glGetUniformLocation)(GLuint program, const GLchar* name);
static void (GL_APIENTRY *glReleaseShaderCompiler)(void);
static void (GL_APIENTRY *glShaderBinary)(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
- static void (GL_APIENTRY *glShaderSource)(GLuint shader, GLsizei count, const GLchar** string, const GLint* length);
+ static void (GL_APIENTRY *glShaderSource)(GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length);
private:
bool m_isLoaded;