From dcf52ccedba09a5ad555fe1567e6389338d71ead Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Sat, 17 Nov 2012 10:18:08 +0000 Subject: [PATCH] gltrace: Respect length argument in glShaderSource(ARB) --- specs/glapi.py | 4 ++-- wrappers/trace.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/specs/glapi.py b/specs/glapi.py index 257fe2e..ff35afa 100644 --- a/specs/glapi.py +++ b/specs/glapi.py @@ -589,7 +589,7 @@ glapi.addFunctions([ GlFunction(GLboolean, "glIsProgram", [(GLprogram, "program")], sideeffects=False), GlFunction(GLboolean, "glIsShader", [(GLshader, "shader")], sideeffects=False), GlFunction(Void, "glLinkProgram", [(GLprogram, "program")]), - GlFunction(Void, "glShaderSource", [(GLshader, "shader"), (GLsizei, "count"), (Array(Const(GLstringConstARB), "count"), "string"), (Array(Const(GLint), "count"), "length")]), + GlFunction(Void, "glShaderSource", [(GLshader, "shader"), (GLsizei, "count"), (Array(Const(String(Const(GLchar), "length ? length[{i}] : strlen(string[{i}])")), "count"), "string"), (Array(Const(GLint), "count"), "length")]), GlFunction(Void, "glUseProgram", [(GLprogram, "program")]), GlFunction(Void, "glUniform1f", [(GLlocation, "location"), (GLfloat, "v0")]), GlFunction(Void, "glUniform2f", [(GLlocation, "location"), (GLfloat, "v0"), (GLfloat, "v1")]), @@ -925,7 +925,7 @@ glapi.addFunctions([ GlFunction(GLhandleARB, "glGetHandleARB", [(GLenum, "pname")], sideeffects=False), GlFunction(Void, "glDetachObjectARB", [(GLhandleARB, "containerObj"), (GLhandleARB, "attachedObj")]), GlFunction(GLhandleARB, "glCreateShaderObjectARB", [(GLenum, "shaderType")]), - GlFunction(Void, "glShaderSourceARB", [(GLhandleARB, "shaderObj"), (GLsizei, "count"), (Const(Array(GLstringConstARB, "count")), "string"), (Array(Const(GLint), "count"), "length")]), + GlFunction(Void, "glShaderSourceARB", [(GLhandleARB, "shaderObj"), (GLsizei, "count"), (Const(Array(String(Const(GLcharARB), "length ? length[{i}] : strlen(string[{i}])"), "count")), "string"), (Array(Const(GLint), "count"), "length")]), GlFunction(Void, "glCompileShaderARB", [(GLhandleARB, "shaderObj")]), GlFunction(GLhandleARB, "glCreateProgramObjectARB", []), GlFunction(Void, "glAttachObjectARB", [(GLhandleARB, "containerObj"), (GLhandleARB, "obj")]), diff --git a/wrappers/trace.py b/wrappers/trace.py index e35108b..f1aaf82 100644 --- a/wrappers/trace.py +++ b/wrappers/trace.py @@ -208,7 +208,7 @@ class ValueSerializer(stdapi.Visitor, ExpanderMixin): # reinterpret_cast is necessary for GLubyte * <=> char * instance = 'reinterpret_cast<%s>(%s)' % (cast, instance) if string.length is not None: - length = ', %s' % string.length + length = ', %s' % self.expand(string.length) else: length = '' print ' trace::localWriter.write%s(%s%s);' % (suffix, instance, length) -- 2.45.2