summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast_setup/ss_triangle.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-03-10 11:30:19 -0700
committerBrian <[email protected]>2007-03-10 11:30:19 -0700
commit10b5895597d5e069183cb647d17eb412effceb4f (patch)
tree326f17498a851a18ecbd0e517ad2d64da4cbb8b0 /src/mesa/swrast_setup/ss_triangle.c
parent1fcb4ecc07685872c9c42569ba13faa1cad54d3c (diff)
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.
Diffstat (limited to 'src/mesa/swrast_setup/ss_triangle.c')
-rw-r--r--src/mesa/swrast_setup/ss_triangle.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/swrast_setup/ss_triangle.c b/src/mesa/swrast_setup/ss_triangle.c
index 09244d9c4bc..628e9288e87 100644
--- a/src/mesa/swrast_setup/ss_triangle.c
+++ b/src/mesa/swrast_setup/ss_triangle.c
@@ -290,8 +290,10 @@ void _swsetup_choose_trifuncs( GLcontext *ctx )
ctx->Polygon.OffsetFill)
ind |= SS_OFFSET_BIT;
+ /* Note: gl_FrontFacing lives in fragment input FOGC.Y at this time */
if ((ctx->Light.Enabled && ctx->Light.Model.TwoSide) ||
- (ctx->VertexProgram._Enabled && ctx->VertexProgram.TwoSideEnabled))
+ (ctx->VertexProgram._Enabled && ctx->VertexProgram.TwoSideEnabled) ||
+ (ctx->FragmentProgram._Current && ctx->FragmentProgram._Current->Base.InputsRead & (1 << FRAG_ATTRIB_FOGC)))
ind |= SS_TWOSIDE_BIT;
/* We piggyback the two-sided stencil front/back determination on the