summaryrefslogtreecommitdiff
path: root/src/mesa/swrast_setup/ss_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast_setup/ss_context.c')
-rw-r--r--src/mesa/swrast_setup/ss_context.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c
index fd6935e7be..61172f9979 100644
--- a/src/mesa/swrast_setup/ss_context.c
+++ b/src/mesa/swrast_setup/ss_context.c
@@ -28,13 +28,14 @@
#include "main/glheader.h"
#include "main/imports.h"
#include "main/colormac.h"
-#include "ss_context.h"
-#include "ss_triangle.h"
-#include "swrast_setup.h"
#include "tnl/tnl.h"
#include "tnl/t_context.h"
#include "tnl/t_pipeline.h"
#include "tnl/t_vertex.h"
+#include "swrast_setup.h"
+#include "ss_context.h"
+#include "ss_triangle.h"
+
/* Need to check lighting state and vertex program state to know
* if two-sided lighting is in effect.
@@ -111,22 +112,25 @@ setup_vertex_format(GLcontext *ctx)
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
SScontext *swsetup = SWSETUP_CONTEXT(ctx);
+ GLboolean intColors = !ctx->FragmentProgram._Current
+ && !ctx->ATIFragmentShader._Enabled
+ && ctx->RenderMode == GL_RENDER
+ && CHAN_TYPE == GL_UNSIGNED_BYTE;
- if (!RENDERINPUTS_EQUAL(tnl->render_inputs_bitset,
+ if (intColors != swsetup->intColors ||
+ !RENDERINPUTS_EQUAL(tnl->render_inputs_bitset,
swsetup->last_index_bitset)) {
DECLARE_RENDERINPUTS(index_bitset);
struct tnl_attr_map map[_TNL_ATTRIB_MAX];
int i, e = 0;
+ swsetup->intColors = intColors;
+
RENDERINPUTS_COPY( index_bitset, tnl->render_inputs_bitset );
EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, attrib[FRAG_ATTRIB_WPOS] );
if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR0 )) {
- swsetup->intColors = !ctx->FragmentProgram._Current
- && !ctx->ATIFragmentShader._Enabled
- && ctx->RenderMode == GL_RENDER
- && CHAN_TYPE == GL_UNSIGNED_BYTE;
if (swsetup->intColors)
EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4CHAN_4F_RGBA, color );
else
@@ -201,6 +205,9 @@ _swsetup_RenderStart( GLcontext *ctx )
swsetup->NewState = 0;
+ /* This will change if drawing unfilled tris */
+ _swrast_SetFacing(ctx, 0);
+
_swrast_render_start(ctx);
/* Important */