diff options
Diffstat (limited to 'src/mesa/shader')
-rw-r--r-- | src/mesa/shader/arbprogram.c | 29 | ||||
-rw-r--r-- | src/mesa/shader/nvprogram.c | 69 | ||||
-rw-r--r-- | src/mesa/shader/nvprogram.h | 12 |
3 files changed, 26 insertions, 84 deletions
diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c index ee75be315e..1656dc9450 100644 --- a/src/mesa/shader/arbprogram.c +++ b/src/mesa/shader/arbprogram.c @@ -247,6 +247,12 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len, } +/** + * Set a program env parameter register. + * \note Called from the GL API dispatcher. + * Note, this function is also used by the GL_NV_vertex_program extension + * (alias to ProgramParameterdNV) + */ void GLAPIENTRY _mesa_ProgramEnvParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) @@ -256,6 +262,12 @@ _mesa_ProgramEnvParameter4dARB(GLenum target, GLuint index, } +/** + * Set a program env parameter register. + * \note Called from the GL API dispatcher. + * Note, this function is also used by the GL_NV_vertex_program extension + * (alias to ProgramParameterdvNV) + */ void GLAPIENTRY _mesa_ProgramEnvParameter4dvARB(GLenum target, GLuint index, const GLdouble *params) @@ -266,6 +278,12 @@ _mesa_ProgramEnvParameter4dvARB(GLenum target, GLuint index, } +/** + * Set a program env parameter register. + * \note Called from the GL API dispatcher. + * Note, this function is also used by the GL_NV_vertex_program extension + * (alias to ProgramParameterfNV) + */ void GLAPIENTRY _mesa_ProgramEnvParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) @@ -283,8 +301,8 @@ _mesa_ProgramEnvParameter4fARB(GLenum target, GLuint index, } ASSIGN_4V(ctx->FragmentProgram.Parameters[index], x, y, z, w); } - else if (target == GL_VERTEX_PROGRAM_ARB - && ctx->Extensions.ARB_vertex_program) { + else if (target == GL_VERTEX_PROGRAM_ARB /* == GL_VERTEX_PROGRAM_NV */ + && (ctx->Extensions.ARB_vertex_program || ctx->Extensions.NV_vertex_program)) { if (index >= ctx->Const.VertexProgram.MaxEnvParams) { _mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameter(index)"); return; @@ -297,7 +315,12 @@ _mesa_ProgramEnvParameter4fARB(GLenum target, GLuint index, } } - +/** + * Set a program env parameter register. + * \note Called from the GL API dispatcher. + * Note, this function is also used by the GL_NV_vertex_program extension + * (alias to ProgramParameterfvNV) + */ void GLAPIENTRY _mesa_ProgramEnvParameter4fvARB(GLenum target, GLuint index, const GLfloat *params) diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index 337784bfe2..409c61cdc1 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -576,75 +576,6 @@ _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len, /** - * Set a program parameter register. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_ProgramParameter4dNV(GLenum target, GLuint index, - GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - _mesa_ProgramParameter4fNV(target, index, - (GLfloat)x, (GLfloat)y, (GLfloat)z, (GLfloat)w); -} - - -/** - * Set a program parameter register. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_ProgramParameter4dvNV(GLenum target, GLuint index, - const GLdouble *params) -{ - _mesa_ProgramParameter4fNV(target, index, - (GLfloat)params[0], (GLfloat)params[1], - (GLfloat)params[2], (GLfloat)params[3]); -} - - -/** - * Set a program parameter register. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_ProgramParameter4fNV(GLenum target, GLuint index, - GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target == GL_VERTEX_PROGRAM_NV && ctx->Extensions.NV_vertex_program) { - if (index < MAX_NV_VERTEX_PROGRAM_PARAMS) { - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - ASSIGN_4V(ctx->VertexProgram.Parameters[index], x, y, z, w); - } - else { - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramParameterNV(index)"); - return; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramParameterNV"); - return; - } -} - - -/** - * Set a program parameter register. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_ProgramParameter4fvNV(GLenum target, GLuint index, - const GLfloat *params) -{ - _mesa_ProgramParameter4fNV(target, index, - params[0], params[1], params[2], params[3]); -} - - - -/** * Set a sequence of program parameter registers. * \note Called from the GL API dispatcher. */ diff --git a/src/mesa/shader/nvprogram.h b/src/mesa/shader/nvprogram.h index dcea7727e0..bfac165b5e 100644 --- a/src/mesa/shader/nvprogram.h +++ b/src/mesa/shader/nvprogram.h @@ -70,18 +70,6 @@ extern void GLAPIENTRY _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len, const GLubyte *program); extern void GLAPIENTRY -_mesa_ProgramParameter4dNV(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); - -extern void GLAPIENTRY -_mesa_ProgramParameter4dvNV(GLenum target, GLuint index, const GLdouble *params); - -extern void GLAPIENTRY -_mesa_ProgramParameter4fNV(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); - -extern void GLAPIENTRY -_mesa_ProgramParameter4fvNV(GLenum target, GLuint index, const GLfloat *params); - -extern void GLAPIENTRY _mesa_ProgramParameters4dvNV(GLenum target, GLuint index, GLuint num, const GLdouble *params); extern void GLAPIENTRY |