glsl: Expand nested preprocessor macros.
[mesa.git] / src / mesa / tnl / t_vb_program.c
index addaf761273076eb6ef0f47df552518de476059a..1795f62c3233a1e2fc4bcc06973f716c31e5463a 100644 (file)
@@ -176,17 +176,12 @@ static void
 vp_fetch_texel(GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda,
                GLuint unit, GLfloat color[4])
 {
-   GLchan rgba[4];
    SWcontext *swrast = SWRAST_CONTEXT(ctx);
 
    /* XXX use a float-valued TextureSample routine here!!! */
    swrast->TextureSample[unit](ctx, ctx->Texture.Unit[unit]._Current,
                                1, (const GLfloat (*)[4]) texcoord,
-                               &lambda, &rgba);
-   color[0] = CHAN_TO_FLOAT(rgba[0]);
-   color[1] = CHAN_TO_FLOAT(rgba[1]);
-   color[2] = CHAN_TO_FLOAT(rgba[2]);
-   color[3] = CHAN_TO_FLOAT(rgba[3]);
+                               &lambda,  (GLfloat (*)[4]) color);
 }
 
 
@@ -242,6 +237,8 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine)
 
    machine->FetchTexelLod = vp_fetch_texel;
    machine->FetchTexelDeriv = NULL; /* not used by vertex programs */
+
+   machine->Samplers = ctx->VertexProgram._Current->Base.SamplerUnits;
 }