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 882fec29efe5a076fed62e561b617303afe9043b..09493873aa23a9d9347aa216279674e50f723a65 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;