diff options
author | Karl Rasche <[email protected]> | 2003-12-09 18:04:52 +0000 |
---|---|---|
committer | Karl Rasche <[email protected]> | 2003-12-09 18:04:52 +0000 |
commit | 057dfcb06c04883f156692633b0d4ca86396eabe (patch) | |
tree | bd229ac54250848cb5086079694173edd22ceb14 /src | |
parent | 82efdff66f8ede02e4b673102081e8f794c17f9d (diff) |
- handle IsPositionInvariant
- tweak assertion to allow for relative offets from ARB_vp
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/nvvertexec.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mesa/main/nvvertexec.c b/src/mesa/main/nvvertexec.c index d73f82b9738..66b3363365f 100644 --- a/src/mesa/main/nvvertexec.c +++ b/src/mesa/main/nvvertexec.c @@ -234,7 +234,8 @@ get_register_pointer( const struct vp_src_register *source, { if (source->RelAddr) { const GLint reg = source->Index + state->AddressReg[0]; - ASSERT(source->File == PROGRAM_ENV_PARAM); + ASSERT( (source->File == PROGRAM_ENV_PARAM) || + (source->File == PROGRAM_STATE_VAR) ); if (reg < 0 || reg > MAX_NV_VERTEX_PROGRAM_PARAMS) return zeroVec; else @@ -369,6 +370,20 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct vertex_program *program) ctx->_CurrentProgram = GL_VERTEX_PROGRAM_ARB; /* or NV, doesn't matter */ + /* If the program is position invariant, multiply the input + * position and the MVP matrix and stick it into the output pos slot + */ + if (ctx->VertexProgram.Current->IsPositionInvariant) { + TRANSFORM_POINT( ctx->VertexProgram.Outputs[0], + ctx->_ModelProjectMatrix.m, + ctx->VertexProgram.Inputs[0]); + + /* XXX: This could go elsewhere */ + ctx->VertexProgram.Current->OutputsWritten |= 0x1; + } + + + for (inst = program->Instructions; inst->Opcode != VP_OPCODE_END; inst++) { if (ctx->VertexProgram.CallbackEnabled && |