diff options
author | Jeremy Huddleston Sequoia <[email protected]> | 2016-05-08 00:47:10 -0700 |
---|---|---|
committer | Jeremy Huddleston Sequoia <[email protected]> | 2017-09-13 19:48:58 -0700 |
commit | e7ef901650b92052d07f578a7884c53e93554d4c (patch) | |
tree | 36a62b20ab50ce122ea45859d93137ded5b46020 /src/mesa/main/shaderapi.c | |
parent | 74d2456491fbd96eb3fb99cf8dd3595b223c2065 (diff) |
mesa: Deal with size differences between GLuint and GLhandleARB in GetAttachedObjectsARB
Signed-off-by: Jeremy Huddleston Sequoia <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderapi.c')
-rw-r--r-- | src/mesa/main/shaderapi.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 6dd617be7e5..72824355838 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -513,10 +513,12 @@ detach_shader_no_error(struct gl_context *ctx, GLuint program, GLuint shader) /** * Return list of shaders attached to shader program. + * \param objOut returns GLuint ids + * \param handleOut returns GLhandleARB handles */ static void get_attached_shaders(struct gl_context *ctx, GLuint program, GLsizei maxCount, - GLsizei *count, GLuint *obj) + GLsizei *countOut, GLuint *objOut, GLhandleARB *handleOut) { struct gl_shader_program *shProg; @@ -531,14 +533,20 @@ get_attached_shaders(struct gl_context *ctx, GLuint program, GLsizei maxCount, if (shProg) { GLuint i; for (i = 0; i < (GLuint) maxCount && i < shProg->NumShaders; i++) { - obj[i] = shProg->Shaders[i]->Name; + if (objOut) { + objOut[i] = shProg->Shaders[i]->Name; + } + + if (handleOut) { + handleOut[i] = (GLhandleARB) shProg->Shaders[i]->Name; + } + } + if (countOut) { + *countOut = i; } - if (count) - *count = i; } } - /** * glGetHandleARB() - return ID/name of currently bound shader program. */ @@ -1575,7 +1583,7 @@ _mesa_GetAttachedObjectsARB(GLhandleARB container, GLsizei maxCount, GLsizei * count, GLhandleARB * obj) { GET_CURRENT_CONTEXT(ctx); - get_attached_shaders(ctx, container, maxCount, count, obj); + get_attached_shaders(ctx, (GLuint)container, maxCount, count, NULL, obj); } @@ -1584,7 +1592,7 @@ _mesa_GetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj) { GET_CURRENT_CONTEXT(ctx); - get_attached_shaders(ctx, program, maxCount, count, obj); + get_attached_shaders(ctx, program, maxCount, count, obj, NULL); } |