[Mesa-dev] [PATCH 9/9] mesa : Api binding for UBO
Brian Paul
brianp at vmware.com
Fri Sep 23 13:45:15 PDT 2011
On 09/23/2011 07:53 AM, vlj wrote:
> ---
> src/mesa/main/uniforms.c | 22 ++++++++++++++++++++++
> 1 files changed, 22 insertions(+), 0 deletions(-)
>
> diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
> index b923aef..172c817 100644
> --- a/src/mesa/main/uniforms.c
> +++ b/src/mesa/main/uniforms.c
> @@ -1522,6 +1522,23 @@ _mesa_GetActiveUniformARB(GLhandleARB program, GLuint index,
> type, name);
> }
>
> +void GLAPIENTRY
> +_mesa_GetActiveUniformBlockInfo(GLint program,GLuint ubo_index,GLenum pname, GLint* params)
Please wrap lines to 79 columns or less and put spaces after the commas.
> +{
> + GET_CURRENT_CONTEXT(ctx);
> + struct gl_shader_program *shProg =
> + _mesa_lookup_shader_program_err(ctx, program, "GetActiveUniformBlockiv");
> + _mesa_query_ubo_general(ctx,shProg,ubo_index,pname,params);
> +}
> +
> +void GLAPIENTRY
> +_mesa_GetActiveUniformBlockName(GLint program,GLuint ubo_index,GLsizei bufsize, GLint* length, char* name)
> +{
> + GET_CURRENT_CONTEXT(ctx);
> + struct gl_shader_program *shProg =
> + _mesa_lookup_shader_program_err(ctx, program, "GetActiveUniformBlockName");
> + _mesa_get_ubo_name(ctx,shProg,ubo_index,bufsize,length,name);
> +}
>
> GLuint get_indice(struct gl_shader_program* prog, const char* name)
> {
> @@ -1609,5 +1626,10 @@ _mesa_init_shader_uniform_dispatch(struct _glapi_table *exec)
> SET_GetnUniformuivARB(exec, _mesa_GetnUniformuivARB);
> SET_GetnUniformdvARB(exec, _mesa_GetnUniformdvARB); /* GL 4.0 */
>
> + /* UBO */
Use /* GL_ARB_uniform_buffer_object */ to be consistent with comment
above.
> + SET_GetActiveUniformBlockiv(exec,_mesa_GetActiveUniformBlockInfo);
> + SET_GetActiveUniformBlockName(exec,_mesa_GetActiveUniformBlockName);
> + SET_GetUniformIndices(exec, _mesa_GetUniformIndices);
> +
> #endif /* FEATURE_GL */
> }
More information about the mesa-dev
mailing list