diff options
author | Eric Anholt <[email protected]> | 2009-09-23 16:49:52 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2009-09-24 13:34:06 -0700 |
commit | 601769a2c0071e23ade32de4e8911d75d7f324d2 (patch) | |
tree | 6a63a0086c9adeb38ed34dbce670ef564d8eea64 /src/mesa/shader/nvprogram.c | |
parent | b849c6f1b3b38a68fae32d4dea16dd7431e41b6e (diff) |
mesa: Initialize NV_vertex_program fields for the parameter lists and such.
This helps let drivers treat NV_vp like ARB_vp.
Diffstat (limited to 'src/mesa/shader/nvprogram.c')
-rw-r--r-- | src/mesa/shader/nvprogram.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index d6469b17bea..fdb2f4210ad 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -511,6 +511,34 @@ _mesa_GetVertexAttribPointervNV(GLuint index, GLenum pname, GLvoid **pointer) +void +_mesa_setup_nv_temporary_count(GLcontext *ctx, struct gl_program *program) +{ + int i; + + program->NumTemporaries = 0; + for (i = 0; i < program->NumInstructions; i++) { + struct prog_instruction *inst = &program->Instructions[i]; + + if (inst->DstReg.File == PROGRAM_TEMPORARY) { + program->NumTemporaries = MAX2(program->NumTemporaries, + inst->DstReg.Index + 1); + } + if (inst->SrcReg[0].File == PROGRAM_TEMPORARY) { + program->NumTemporaries = MAX2(program->NumTemporaries, + inst->SrcReg[0].Index + 1); + } + if (inst->SrcReg[1].File == PROGRAM_TEMPORARY) { + program->NumTemporaries = MAX2(program->NumTemporaries, + inst->SrcReg[1].Index + 1); + } + if (inst->SrcReg[2].File == PROGRAM_TEMPORARY) { + program->NumTemporaries = MAX2(program->NumTemporaries, + inst->SrcReg[2].Index + 1); + } + } +} + /** * Load/parse/compile a program. * \note Called from the GL API dispatcher. |