fxMesa->haveTwoTMUs=GL_FALSE;
if (getenv("FX_EMULATE_SINGLE_TMU")) {
+ fprint(stderr, "stadnnadna;lskdjf");
if (MESA_VERBOSE&VERBOSE_DRIVER)
fprintf(stderr, "\n\nEmulating single tmu\n\n");
fxMesa->haveTwoTMUs = GL_FALSE;
if(new_state & INTERESTED) {
fxDDChooseRenderState( ctx );
fxMesa->RenderVBTables=fxDDChooseRenderVBTables(ctx);
+ fxMesa->RenderVBClippedTab=fxMesa->RenderVBTables[0];
+ fxMesa->RenderVBCulledTab=fxMesa->RenderVBTables[1];
+ fxMesa->RenderVBRawTab=fxMesa->RenderVBTables[2];
+
ctx->Driver.RasterSetup=fxDDChooseSetupFunction(ctx);
}
ctx->Driver.LineFunc=fxMesa->LineFunc;
ctx->Driver.TriangleFunc=fxMesa->TriangleFunc;
ctx->Driver.QuadFunc=fxMesa->QuadFunc;
- ctx->Driver.RenderVBClippedTab=fxMesa->RenderVBTables[0];
- ctx->Driver.RenderVBCulledTab=fxMesa->RenderVBTables[1];
- ctx->Driver.RenderVBRawTab=fxMesa->RenderVBTables[2];
-
}
ctx->Driver.AllocDepthBuffer=fxAllocDepthBuffer;
render_func **RenderVBTables;
+ render_func *RenderVBClippedTab;
+ render_func *RenderVBCulledTab;
+ render_func *RenderVBRawTab;
+
+
tfxStats stats;
void *state;
extern void fxDDCullFace(GLcontext *ctx, GLenum mode);
extern void fxDDFrontFace(GLcontext *ctx, GLenum mode);
+extern void fxPrintRenderState( const char *msg, GLuint state );
+extern void fxPrintHintState( const char *msg, GLuint state );
+extern void fxDDDoRenderVB( struct vertex_buffer *VB );
#endif
-/* $Id: context.c,v 1.1 1999/08/19 00:55:41 jtg Exp $ */
+/* $Id: context.c,v 1.2 1999/08/26 14:50:49 keithw Exp $ */
/*
* Mesa 3-D graphics library
/* Extensions */
gl_extensions_ctr( ctx );
- ctx->AllowVertexCull = 0;
+ ctx->AllowVertexCull = CLIP_CULLED_BIT;
/* Lighting group */
for (i=0;i<MAX_LIGHTS;i++) {
static void update_fog_mode( GLcontext *ctx )
{
+ int old_mode = ctx->FogMode;
+
if (ctx->Fog.Enabled) {
if (ctx->Texture.Enabled)
ctx->FogMode = FOG_FRAGMENT;
else {
ctx->FogMode = FOG_NONE;
}
+
+ if (old_mode != ctx->FogMode)
+ ctx->NewState |= NEW_FOG;
}
ctx->NeedNormals = (ctx->Light.Enabled || ctx->Texture.NeedNormals);
}
- if (ctx->NewState & (NEW_RASTER_OPS | NEW_LIGHTING)) {
+ if (ctx->NewState & (NEW_RASTER_OPS | NEW_LIGHTING | NEW_FOG)) {
+
+
if (ctx->NewState & NEW_RASTER_OPS) {
update_pixel_logic(ctx);
update_pixel_masking(ctx);
}
if (ctx->NewState & NEW_LIGHTING) {
- ctx->TriangleCaps &= ~(DD_TRI_LIGHT_TWOSIDE|DD_EARLY_CULL);
+ ctx->TriangleCaps &= ~(DD_TRI_LIGHT_TWOSIDE|DD_LIGHTING_CULL);
if (ctx->Light.Enabled) {
if (ctx->Light.Model.TwoSide)
- ctx->TriangleCaps |= (DD_TRI_LIGHT_TWOSIDE|DD_EARLY_CULL);
+ ctx->TriangleCaps |= (DD_TRI_LIGHT_TWOSIDE|DD_LIGHTING_CULL);
gl_update_lighting(ctx);
}
}
if (ctx->NewState & NEW_POLYGON) {
/* Setup CullBits bitmask */
if (ctx->Polygon.CullFlag) {
+ ctx->backface_sign = 1;
switch(ctx->Polygon.CullFaceMode) {
- case GL_FRONT:
- ctx->Polygon.CullBits = 2;
- break;
case GL_BACK:
+ if(ctx->Polygon.FrontFace==GL_CCW)
+ ctx->backface_sign = -1;
ctx->Polygon.CullBits = 1;
break;
+ case GL_FRONT:
+ if(ctx->Polygon.FrontFace!=GL_CCW)
+ ctx->backface_sign = -1;
+ ctx->Polygon.CullBits = 2;
+ break;
default:
case GL_FRONT_AND_BACK:
+ ctx->backface_sign = 0;
ctx->Polygon.CullBits = 3;
break;
}
}
- else
+ else {
ctx->Polygon.CullBits = 3;
+ ctx->backface_sign = 0;
+ }
/* Any Polygon offsets enabled? */
ctx->TriangleCaps &= ~DD_TRI_OFFSET;
ctx->IndirectTriangles = ctx->TriangleCaps & ~ctx->Driver.TriangleCaps;
ctx->IndirectTriangles |= DD_SW_RASTERIZE;
+ if (MESA_VERBOSE&VERBOSE_CULL)
+ gl_print_tri_caps("initial indirect tris", ctx->IndirectTriangles);
+
ctx->Driver.PointsFunc = NULL;
ctx->Driver.LineFunc = NULL;
ctx->Driver.TriangleFunc = NULL;
*/
ctx->Driver.UpdateState(ctx);
+ if (MESA_VERBOSE&VERBOSE_CULL)
+ gl_print_tri_caps("indirect tris", ctx->IndirectTriangles);
+
/*
* In case the driver didn't hook in an optimized point, line or
* triangle function we'll now select "core/fallback" point, line
gl_set_line_function(ctx);
gl_set_triangle_function(ctx);
gl_set_quad_function(ctx);
+
+ if ((ctx->IndirectTriangles &
+ (DD_TRI_SW_RASTERIZE|DD_QUAD_SW_RASTERIZE|DD_TRI_CULL)) ==
+ (DD_TRI_SW_RASTERIZE|DD_QUAD_SW_RASTERIZE|DD_TRI_CULL))
+ ctx->IndirectTriangles &= ~DD_TRI_CULL;
}
+ if (MESA_VERBOSE&VERBOSE_CULL)
+ gl_print_tri_caps("indirect tris 2", ctx->IndirectTriangles);
+
gl_set_render_vb_function(ctx);
}
/* Figure out whether we can light in object space or not. If we
* can, find the current positions of the lights in object space
*/
- if ((ctx->Enabled & (ENABLE_POINT_ATTEN | ENABLE_LIGHT |
+ if ((ctx->Enabled & (ENABLE_POINT_ATTEN | ENABLE_LIGHT | ENABLE_FOG |
ENABLE_TEXGEN0 | ENABLE_TEXGEN1)) &&
(ctx->NewState & (NEW_LIGHTING |
+ NEW_FOG |
NEW_MODELVIEW |
NEW_PROJECTION |
NEW_TEXTURING |
-/* $Id: dlist.c,v 1.1 1999/08/19 00:55:41 jtg Exp $ */
+/* $Id: dlist.c,v 1.2 1999/08/26 14:50:49 keithw Exp $ */
/*
* Mesa 3-D graphics library
case OPCODE_VERTEX_CASSETTE:
if (ctx->NewState)
gl_update_state(ctx);
+ if (ctx->CompileCVAFlag) {
+ ctx->CompileCVAFlag = 0;
+ ctx->CVA.elt.pipeline_valid = 0;
+ }
if (!ctx->CVA.elt.pipeline_valid)
gl_build_immediate_pipeline( ctx );
gl_fixup_cassette( ctx, (struct immediate *) n[1].data );
-/* $Id: enable.c,v 1.2 1999/08/19 13:24:27 brianp Exp $ */
+/* $Id: enable.c,v 1.3 1999/08/26 14:50:49 keithw Exp $ */
/*
* Mesa 3-D graphics library
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx, "gl_enable/disable" );
if (MESA_VERBOSE & VERBOSE_API)
- fprintf(stderr, "%s %s (%x)\n",
+ fprintf(stderr, "%s %s (newstate is %x)\n",
state ? "glEnable" : "glDisable",
gl_lookup_enum_by_nr(cap),
ctx->NewState);
if (ctx->Fog.Enabled!=state) {
ctx->Fog.Enabled = state;
ctx->Enabled ^= ENABLE_FOG;
- ctx->NewState |= NEW_FOG;
+ ctx->NewState |= NEW_FOG|NEW_RASTER_OPS;
}
break;
case GL_LIGHT0:
-/* $Id: polygon.c,v 1.1 1999/08/19 00:55:41 jtg Exp $ */
+/* $Id: polygon.c,v 1.2 1999/08/26 14:50:49 keithw Exp $ */
/*
* Mesa 3-D graphics library
ctx->Polygon.Unfilled = GL_TRUE;
ctx->TriangleCaps |= DD_TRI_UNFILLED;
}
- else {
- ctx->Polygon.Unfilled = GL_FALSE;
- }
ctx->NewState |= (NEW_POLYGON | NEW_RASTER_OPS);
-/* $Id: varray.c,v 1.1 1999/08/19 00:55:41 jtg Exp $ */
+/* $Id: varray.c,v 1.2 1999/08/26 14:50:49 keithw Exp $ */
/*
* Mesa 3-D graphics library
if (translate & VERT_OBJ_ANY)
(ctx->Array.VertexEltFunc)( IM->Obj,
&ctx->Array.Vertex,
- flags, elts, VERT_ELT,
+ flags, elts, (VERT_ELT|VERT_OBJ_ANY),
start, count);
if (translate & VERT_NORM)
GLuint nr = MIN2( VB_MAX, count - j + VB_START ); \
struct immediate *IM = ctx->input; \
GLuint sf = IM->Flag[VB_START]; \
- GLuint flags = IM->ArrayOrFlags; \
\
for (i = VB_START ; i < nr ; i++) { \
IM->Elt[i] = (GLuint) *indices++; \
- IM->Flag[i] = flags; \
+ IM->Flag[i] = VERT_ELT; \
} \
\
if (j == 0) IM->Flag[VB_START] |= sf; \
/* Not really important any more:
*/
ctx->Array.Summary = ctx->Array.Flags & VERT_DATA;
-
- ctx->input->ArrayOrFlags = (ctx->Array.Flags & VERT_OBJ_234) | VERT_ELT;
ctx->input->ArrayAndFlags = ~ctx->Array.Flags;
ctx->input->ArrayEltFlush = !(ctx->CompileCVAFlag);
}
*/
#include <stdlib.h>
+#include <stdio.h>
#include "common_x86asm.h"
int gl_x86_cpu_features = 0;
gl_x86_cpu_features = gl_identify_x86_cpu_features ();
if (gl_x86_cpu_features & GL_CPU_GenuineIntel) {
- printf ("GenuineIntel cpu detected.\n");
+ fprintf (stderr, "GenuineIntel cpu detected.\n");
}
gl_init_x86_asm_transforms ();
if (gl_x86_cpu_features & GL_CPU_MMX) {
char *s = getenv( "MESA_NO_MMX" );
if (s == NULL) {
- printf ("MMX cpu detected.\n");
+ fprintf (stderr, "MMX cpu detected.\n");
} else {
gl_x86_cpu_features &= (!GL_CPU_MMX);
}
if (gl_x86_cpu_features & GL_CPU_3Dnow) {
char *s = getenv( "MESA_NO_3DNOW" );
if (s == NULL) {
- printf ("3Dnow cpu detected.\n");
+ fprintf (stderr, "3Dnow cpu detected.\n");
gl_init_3dnow_asm_transforms ();
} else {
gl_x86_cpu_features &= (!GL_CPU_3Dnow);