diff options
author | Brian Paul <[email protected]> | 2010-12-10 09:29:13 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-12-10 09:29:13 -0700 |
commit | a63486ac680acc0bfb895037aca130a457caa01a (patch) | |
tree | 399a63279019d8b424ca6d8f3a51348409eb380f /src/mesa/tnl/t_vb_program.c | |
parent | 6a0d3b7696260f449a1d0c5222814568764e8110 (diff) |
tnl: implement instanced drawing
Diffstat (limited to 'src/mesa/tnl/t_vb_program.c')
-rw-r--r-- | src/mesa/tnl/t_vb_program.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index 76f8fde3f52..a1853689a43 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -218,7 +218,8 @@ _tnl_program_string(struct gl_context *ctx, GLenum target, struct gl_program *pr * Initialize virtual machine state prior to executing vertex program. */ static void -init_machine(struct gl_context *ctx, struct gl_program_machine *machine) +init_machine(struct gl_context *ctx, struct gl_program_machine *machine, + GLuint instID) { /* Input registers get initialized from the current vertex attribs */ memcpy(machine->VertAttribs, ctx->Current.Attrib, @@ -254,6 +255,8 @@ init_machine(struct gl_context *ctx, struct gl_program_machine *machine) machine->FetchTexelDeriv = NULL; /* not used by vertex programs */ machine->Samplers = ctx->VertexProgram._Current->Base.SamplerUnits; + + machine->SystemValues[SYSTEM_VALUE_INSTANCE_ID][0] = (GLfloat) instID; } @@ -339,7 +342,7 @@ run_vp( struct gl_context *ctx, struct tnl_pipeline_stage *stage ) for (i = 0; i < VB->Count; i++) { GLuint attr; - init_machine(ctx, &machine); + init_machine(ctx, &machine, tnl->CurInstance); #if 0 printf("Input %d: %f, %f, %f, %f\n", i, |