OSDN Git Service

only load front/back face attrib if using a shader (bug 10788)
authorBrian <brian@yutani.localnet.net>
Sat, 28 Apr 2007 14:51:23 +0000 (08:51 -0600)
committerBrian <brian@yutani.localnet.net>
Sat, 28 Apr 2007 14:51:23 +0000 (08:51 -0600)
src/mesa/swrast/s_fragprog.c

index 882fec2..0949387 100644 (file)
@@ -113,8 +113,10 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine,
    /* Setup pointer to input attributes */
    machine->Attribs = span->array->attribs;
 
-   /* Store front/back facing value in register FOGC.Y */
-   machine->Attribs[FRAG_ATTRIB_FOGC][col][1] = (GLfloat) ctx->_Facing;
+   if (ctx->Shader.CurrentProgram) {
+      /* Store front/back facing value in register FOGC.Y */
+      machine->Attribs[FRAG_ATTRIB_FOGC][col][1] = (GLfloat) ctx->_Facing;
+   }
 
    machine->CurElement = col;