From 10b5895597d5e069183cb647d17eb412effceb4f Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 10 Mar 2007 11:30:19 -0700 Subject: Implement gl_FrontFacing for fragment shaders. For the time being, we put the gl_FrontFacing value in the FOGC.Y input register. Combining FOGC and FrontFacing in one register is a bit of a hack and may need to be changed someday. --- src/mesa/swrast/s_fragprog.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mesa/swrast/s_fragprog.c') diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index 698925cdba..dbfc1b8c0c 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -113,6 +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; + machine->CurElement = col; /* init condition codes */ -- cgit v1.2.3