summaryrefslogtreecommitdiff
path: root/src/mesa/swrast_setup
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast_setup')
-rw-r--r--src/mesa/swrast_setup/descrip.mms42
-rw-r--r--src/mesa/swrast_setup/sources10
-rw-r--r--src/mesa/swrast_setup/ss_context.c3
-rw-r--r--src/mesa/swrast_setup/ss_triangle.c14
-rw-r--r--src/mesa/swrast_setup/ss_tritmp.h20
5 files changed, 62 insertions, 27 deletions
diff --git a/src/mesa/swrast_setup/descrip.mms b/src/mesa/swrast_setup/descrip.mms
new file mode 100644
index 0000000000..32ffd80732
--- /dev/null
+++ b/src/mesa/swrast_setup/descrip.mms
@@ -0,0 +1,42 @@
+# Makefile for core library for VMS
+# contributed by Jouk Jansen joukj@hrem.nano.tudelft.nl
+# Last revision : 3 October 2007
+
+.first
+ define gl [---.include.gl]
+ define math [-.math]
+ define tnl [-.tnl]
+ define vbo [-.vbo]
+ define swrast [-.swrast]
+ define array_cache [-.array_cache]
+ define glapi [-.glapi]
+ define main [-.main]
+
+.include [---]mms-config.
+
+##### MACROS #####
+
+VPATH = RCS
+
+INCDIR = [---.include],[-.main],[-.glapi]
+LIBDIR = [---.lib]
+CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)/float=ieee/ieee=denorm
+
+SOURCES = ss_context.c ss_triangle.c
+
+OBJECTS = ss_context.obj,ss_triangle.obj
+##### RULES #####
+
+VERSION=Mesa V3.4
+
+##### TARGETS #####
+# Make the library
+$(LIBDIR)$(GL_LIB) : $(OBJECTS)
+ @ library $(LIBDIR)$(GL_LIB) $(OBJECTS)
+
+clean :
+ purge
+ delete *.obj;*
+
+ss_context.obj : ss_context.c
+ss_triangle.obj : ss_triangle.c
diff --git a/src/mesa/swrast_setup/sources b/src/mesa/swrast_setup/sources
deleted file mode 100644
index dee14b6774..0000000000
--- a/src/mesa/swrast_setup/sources
+++ /dev/null
@@ -1,10 +0,0 @@
-MESA_SWRAST_SETUP_SOURCES = \
-ss_context.c \
-ss_triangle.c
-
-MESA_SWRAST_SETUP_HEADERS = \
-ss_context.h \
-ss_triangle.h \
-ss_tritmp.h \
-ss_vb.h \
-swrast_setup.h
diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c
index fd6935e7be..4ed868ea60 100644
--- a/src/mesa/swrast_setup/ss_context.c
+++ b/src/mesa/swrast_setup/ss_context.c
@@ -201,6 +201,9 @@ _swsetup_RenderStart( GLcontext *ctx )
swsetup->NewState = 0;
+ /* This will change if drawing unfilled tris */
+ _swrast_SetFacing(ctx, 0);
+
_swrast_render_start(ctx);
/* Important */
diff --git a/src/mesa/swrast_setup/ss_triangle.c b/src/mesa/swrast_setup/ss_triangle.c
index 9fef7a52ec..54e24c4c44 100644
--- a/src/mesa/swrast_setup/ss_triangle.c
+++ b/src/mesa/swrast_setup/ss_triangle.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.1
+ * Version: 7.1
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -68,6 +68,8 @@ static void _swsetup_render_line_tri( GLcontext *ctx,
return;
}
+ _swrast_SetFacing(ctx, facing);
+
if (ctx->Light.ShadeModel == GL_FLAT) {
COPY_CHAN4(c[0], v0->color);
COPY_CHAN4(c[1], v1->color);
@@ -127,6 +129,8 @@ static void _swsetup_render_point_tri( GLcontext *ctx,
return;
}
+ _swrast_SetFacing(ctx, facing);
+
if (ctx->Light.ShadeModel == GL_FLAT) {
/* save colors/indexes for v0, v1 vertices */
COPY_CHAN4(c[0], v0->color);
@@ -290,10 +294,8 @@ 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->FragmentProgram._Current && ctx->FragmentProgram._Current->Base.InputsRead & (1 << FRAG_ATTRIB_FOGC)))
+ (ctx->VertexProgram._Current && ctx->VertexProgram.TwoSideEnabled))
ind |= SS_TWOSIDE_BIT;
/* We piggyback the two-sided stencil front/back determination on the
@@ -311,6 +313,4 @@ void _swsetup_choose_trifuncs( GLcontext *ctx )
tnl->Driver.Render.Quad = quad_tab[ind];
tnl->Driver.Render.Line = swsetup_line;
tnl->Driver.Render.Points = swsetup_points;
-
- ctx->_Facing = 0;
}
diff --git a/src/mesa/swrast_setup/ss_tritmp.h b/src/mesa/swrast_setup/ss_tritmp.h
index f6b738d60d..97d2f4a16b 100644
--- a/src/mesa/swrast_setup/ss_tritmp.h
+++ b/src/mesa/swrast_setup/ss_tritmp.h
@@ -49,7 +49,6 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
v[1] = &verts[e1];
v[2] = &verts[e2];
-
if (IND & (SS_TWOSIDE_BIT | SS_OFFSET_BIT | SS_UNFILLED_BIT))
{
GLfloat ex = v[0]->attrib[FRAG_ATTRIB_WPOS][0] - v[2]->attrib[FRAG_ATTRIB_WPOS][0];
@@ -61,7 +60,6 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
if (IND & (SS_TWOSIDE_BIT | SS_UNFILLED_BIT))
{
facing = (cc < 0.0) ^ ctx->Polygon._FrontBit;
- ctx->_Facing = facing;
if (IND & SS_UNFILLED_BIT)
mode = facing ? ctx->Polygon.BackMode : ctx->Polygon.FrontMode;
@@ -238,14 +236,16 @@ static void TAG(quadfunc)( GLcontext *ctx, GLuint v0,
{
if (IND & SS_UNFILLED_BIT) {
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLubyte ef1 = VB->EdgeFlag[v1];
- GLubyte ef3 = VB->EdgeFlag[v3];
- VB->EdgeFlag[v1] = 0;
- TAG(triangle)( ctx, v0, v1, v3 );
- VB->EdgeFlag[v1] = ef1;
- VB->EdgeFlag[v3] = 0;
- TAG(triangle)( ctx, v1, v2, v3 );
- VB->EdgeFlag[v3] = ef3;
+ if (VB->EdgeFlag) { /* XXX this test shouldn't be needed (bug 12614) */
+ GLubyte ef1 = VB->EdgeFlag[v1];
+ GLubyte ef3 = VB->EdgeFlag[v3];
+ VB->EdgeFlag[v1] = 0;
+ TAG(triangle)( ctx, v0, v1, v3 );
+ VB->EdgeFlag[v1] = ef1;
+ VB->EdgeFlag[v3] = 0;
+ TAG(triangle)( ctx, v1, v2, v3 );
+ VB->EdgeFlag[v3] = ef3;
+ }
} else {
TAG(triangle)( ctx, v0, v1, v3 );
TAG(triangle)( ctx, v1, v2, v3 );