diff options
author | Brian Paul <[email protected]> | 2010-01-22 16:09:03 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-01-22 16:09:03 -0700 |
commit | 7b5ad23c7f7f9016f725cb1caa3cf8971aeedbc8 (patch) | |
tree | 5a31fa4eb2227654eb07ebdce1a954233fe4bc19 /src/mesa/shader/arbprogram.c | |
parent | d88b219cf37c488f57e18850c843078ff918b55d (diff) | |
parent | 099e8ec54d4f7b9cd9ae3a481d6a6ae60f4590be (diff) |
Merge branch 'mesa_7_7_branch'
Conflicts:
src/mesa/shader/prog_execute.c
Diffstat (limited to 'src/mesa/shader/arbprogram.c')
-rw-r--r-- | src/mesa/shader/arbprogram.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c index eb537cd1b99..3cb26109508 100644 --- a/src/mesa/shader/arbprogram.c +++ b/src/mesa/shader/arbprogram.c @@ -561,6 +561,8 @@ _mesa_ProgramEnvParameter4fARB(GLenum target, GLuint index, } } + + /** * Set a program env parameter register. * \note Called from the GL API dispatcher. @@ -569,10 +571,35 @@ _mesa_ProgramEnvParameter4fARB(GLenum target, GLuint index, */ void GLAPIENTRY _mesa_ProgramEnvParameter4fvARB(GLenum target, GLuint index, - const GLfloat *params) + const GLfloat *params) { - _mesa_ProgramEnvParameter4fARB(target, index, params[0], params[1], - params[2], params[3]); + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + FLUSH_VERTICES(ctx, _NEW_PROGRAM_CONSTANTS); + + if (target == GL_FRAGMENT_PROGRAM_ARB + && ctx->Extensions.ARB_fragment_program) { + if (index >= ctx->Const.FragmentProgram.MaxEnvParams) { + _mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameter4fv(index)"); + return; + } + memcpy(ctx->FragmentProgram.Parameters[index], params, + 4 * sizeof(GLfloat)); + } + 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, "glProgramEnvParameter4fv(index)"); + return; + } + memcpy(ctx->VertexProgram.Parameters[index], params, + 4 * sizeof(GLfloat)); + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glProgramEnvParameter4fv(target)"); + return; + } } |