diff options
Diffstat (limited to 'src/mesa/vbo/vbo_exec_draw.c')
-rw-r--r-- | src/mesa/vbo/vbo_exec_draw.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index a89f150654..38b6c56f47 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -176,7 +176,20 @@ static void vbo_exec_bind_arrays( GLcontext *ctx ) exec->vtx.inputs[attr + 16] = &vbo->generic_currval[attr]; } map = vbo->map_vp_arb; + + /* check if VERT_ATTRIB_POS is not read but VERT_BIT_GENERIC0 is read. + * In that case we effectively need to route the data from + * glVertexAttrib(0, val) calls to feed into the GENERIC0 input. + */ + if ((ctx->VertexProgram._Current->Base.InputsRead & VERT_BIT_POS) == 0 && + (ctx->VertexProgram._Current->Base.InputsRead & VERT_BIT_GENERIC0)) { + exec->vtx.inputs[16] = exec->vtx.inputs[0]; + exec->vtx.attrsz[16] = exec->vtx.attrsz[0]; + exec->vtx.attrsz[0] = 0; + } break; + default: + assert(0); } /* Make all active attributes (including edgeflag) available as @@ -205,6 +218,7 @@ static void vbo_exec_bind_arrays( GLcontext *ctx ) arrays[attr].StrideB = exec->vtx.vertex_size * sizeof(GLfloat); arrays[attr].Stride = exec->vtx.vertex_size * sizeof(GLfloat); arrays[attr].Type = GL_FLOAT; + arrays[attr].Format = GL_RGBA; arrays[attr].Enabled = 1; _mesa_reference_buffer_object(ctx, &arrays[attr].BufferObj, @@ -313,7 +327,6 @@ void vbo_exec_vtx_flush( struct vbo_exec_context *exec, if (ctx->NewState) _mesa_update_state( ctx ); - if (exec->vtx.bufferobj->Name) { vbo_exec_vtx_unmap( exec ); } |