diff options
author | marha <marha@users.sourceforge.net> | 2014-08-11 21:22:25 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-08-11 21:22:25 +0200 |
commit | 8e27619ab489dece35cc4bec86950ee7729cd309 (patch) | |
tree | ab59dbc661e00c12ed4777cf9d0d37393c4163aa /mesalib/src/mesa/program/program.c | |
parent | ffc99ce2402fe5c9a6eb8fcf193e8e9472fd993b (diff) | |
parent | fdbedba4d50e1b28b0249c83ba11c029f096e400 (diff) | |
download | vcxsrv-8e27619ab489dece35cc4bec86950ee7729cd309.tar.gz vcxsrv-8e27619ab489dece35cc4bec86950ee7729cd309.tar.bz2 vcxsrv-8e27619ab489dece35cc4bec86950ee7729cd309.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
libxcb/src/c_client.py
mesalib/include/GL/glext.h
mesalib/include/GL/glxext.h
mesalib/src/glsl/.gitignore
mesalib/src/mesa/drivers/dri/common/xmlconfig.h
mesalib/src/mesa/main/.gitignore
xorg-server/Xext/xvmain.c
xorg-server/dix/dispatch.c
xorg-server/hw/xfree86/common/compiler.h
Diffstat (limited to 'mesalib/src/mesa/program/program.c')
-rw-r--r-- | mesalib/src/mesa/program/program.c | 88 |
1 files changed, 46 insertions, 42 deletions
diff --git a/mesalib/src/mesa/program/program.c b/mesalib/src/mesa/program/program.c index aedce3e3c..ef5bf6b11 100644 --- a/mesalib/src/mesa/program/program.c +++ b/mesalib/src/mesa/program/program.c @@ -226,27 +226,24 @@ _mesa_find_line_column(const GLubyte *string, const GLubyte *pos, /** - * Initialize a new vertex/fragment program object. + * Initialize a new gl_program object. */ -static struct gl_program * -_mesa_init_program_struct( struct gl_context *ctx, struct gl_program *prog, - GLenum target, GLuint id) +static void +init_program_struct(struct gl_program *prog, GLenum target, GLuint id) { - (void) ctx; - if (prog) { - GLuint i; - memset(prog, 0, sizeof(*prog)); - prog->Id = id; - prog->Target = target; - prog->RefCount = 1; - prog->Format = GL_PROGRAM_FORMAT_ASCII_ARB; - - /* default mapping from samplers to texture units */ - for (i = 0; i < MAX_SAMPLERS; i++) - prog->SamplerUnits[i] = i; - } + GLuint i; - return prog; + assert(prog); + + memset(prog, 0, sizeof(*prog)); + prog->Id = id; + prog->Target = target; + prog->RefCount = 1; + prog->Format = GL_PROGRAM_FORMAT_ASCII_ARB; + + /* default mapping from samplers to texture units */ + for (i = 0; i < MAX_SAMPLERS; i++) + prog->SamplerUnits[i] = i; } @@ -254,13 +251,15 @@ _mesa_init_program_struct( struct gl_context *ctx, struct gl_program *prog, * Initialize a new fragment program object. */ struct gl_program * -_mesa_init_fragment_program( struct gl_context *ctx, struct gl_fragment_program *prog, - GLenum target, GLuint id) +_mesa_init_fragment_program(struct gl_context *ctx, + struct gl_fragment_program *prog, + GLenum target, GLuint id) { - if (prog) - return _mesa_init_program_struct( ctx, &prog->Base, target, id ); - else - return NULL; + if (prog) { + init_program_struct(&prog->Base, target, id); + return &prog->Base; + } + return NULL; } @@ -268,13 +267,15 @@ _mesa_init_fragment_program( struct gl_context *ctx, struct gl_fragment_program * Initialize a new vertex program object. */ struct gl_program * -_mesa_init_vertex_program( struct gl_context *ctx, struct gl_vertex_program *prog, - GLenum target, GLuint id) +_mesa_init_vertex_program(struct gl_context *ctx, + struct gl_vertex_program *prog, + GLenum target, GLuint id) { - if (prog) - return _mesa_init_program_struct( ctx, &prog->Base, target, id ); - else - return NULL; + if (prog) { + init_program_struct(&prog->Base, target, id); + return &prog->Base; + } + return NULL; } @@ -283,13 +284,14 @@ _mesa_init_vertex_program( struct gl_context *ctx, struct gl_vertex_program *pro */ struct gl_program * _mesa_init_compute_program(struct gl_context *ctx, - struct gl_compute_program *prog, GLenum target, - GLuint id) + struct gl_compute_program *prog, + GLenum target, GLuint id) { - if (prog) - return _mesa_init_program_struct( ctx, &prog->Base, target, id ); - else - return NULL; + if (prog) { + init_program_struct(&prog->Base, target, id); + return &prog->Base; + } + return NULL; } @@ -297,13 +299,15 @@ _mesa_init_compute_program(struct gl_context *ctx, * Initialize a new geometry program object. */ struct gl_program * -_mesa_init_geometry_program( struct gl_context *ctx, struct gl_geometry_program *prog, - GLenum target, GLuint id) +_mesa_init_geometry_program(struct gl_context *ctx, + struct gl_geometry_program *prog, + GLenum target, GLuint id) { - if (prog) - return _mesa_init_program_struct( ctx, &prog->Base, target, id ); - else - return NULL; + if (prog) { + init_program_struct(&prog->Base, target, id); + return &prog->Base; + } + return NULL; } |