- use the new interface to the software rasterizer.
- manage all fallbacks internally, hooking in swrast or
swrast_setup if necessary.
- removed lots of marginal code no longer appropriate in a
maturing driver.
- reworked the vertex-setup and triangle routines, including
drawing unfilled triangles from within the driver.
fxMesa->screen_width = fxMesa->width;
fxMesa->screen_height = fxMesa->height;
- fxMesa->x_offset = 0;
- fxMesa->y_offset = 0;
- fxMesa->y_delta = 0;
- fxMesa->needClip = 0;
+ fxMesa->new_state = ~0;
if(verbose)
fprintf(stderr,"Voodoo Glide screen size: %dx%d\n",
-/* -*- mode: C; tab-width:8; c-basic-offset:2 -*- */
/*
* Mesa 3-D graphics library
}
-#ifdef XF86DRI
-/* test if window coord (px,py) is visible */
-static GLboolean inClipRects(fxMesaContext fxMesa, int px, int py)
-{
- int i;
- for (i=0; i<fxMesa->numClipRects; i++) {
- if ((px>=fxMesa->pClipRects[i].x1) &&
- (px<fxMesa->pClipRects[i].x2) &&
- (py>=fxMesa->pClipRects[i].y1) &&
- (py<fxMesa->pClipRects[i].y2)) return GL_TRUE;
- }
- return GL_FALSE;
-}
-#endif
-
static GLboolean fxDDDrawBitmap(GLcontext *ctx, GLint px, GLint py,
GLsizei width, GLsizei height,
struct gl_pixelstore_attrib scissoredUnpack;
/* check if there's any raster operations enabled which we can't handle */
- if (ctx->RasterMask & (ALPHATEST_BIT |
- BLEND_BIT |
- DEPTH_BIT |
- FOG_BIT |
- LOGIC_OP_BIT |
- SCISSOR_BIT |
- STENCIL_BIT |
- MASKING_BIT |
- ALPHABUF_BIT |
- MULTI_DRAW_BIT))
+ if (ctx->Color.AlphaEnabled ||
+ ctx->Color.BlendEnabled ||
+ ctx->Depth.Test ||
+ ctx->Fog.Enabled ||
+ ctx->Color.ColorLogicOpEnabled ||
+ ctx->Stencil.Enabled ||
+ ctx->Scissor.Enabled ||
+ ( ctx->DrawBuffer->UseSoftwareAlphaBuffers &&
+ ctx->Color.ColorMask[ACOMP]) ||
+ ctx->Color.MultiDrawBuffer)
return GL_FALSE;
+
if (ctx->Scissor.Enabled) {
/* This is a bit tricky, but by carefully adjusting the px, py,
* width, height, skipPixels and skipRows values we can do
* scissoring without special code in the rendering loop.
+ *
+ * KW: This code is never reached, see the test above.
*/
/* we'll construct a new pixelstore struct */
return GL_TRUE;
}
-#ifdef XF86DRI
-#define INSIDE(c, x, y) inClipRects((c), (x), (y))
-#else
-#define INSIDE(c, x, y) (1)
-#endif
-
{
- const GLint winX = fxMesa->x_offset;
- const GLint winY = fxMesa->y_offset + fxMesa->height - 1;
+ const GLint winX = 0;
+ const GLint winY = fxMesa->height - 1;
/* The dest stride depends on the hardware and whether we're drawing
* to the front or back buffer. This compile-time test seems to do
* the job for now.
*/
-#ifdef XF86DRI
- const GLint dstStride = (fxMesa->glCtx->Color.DrawBuffer == GL_FRONT)
- ? (fxMesa->screen_width) : (info.strideInBytes / 2);
-#else
const GLint dstStride = info.strideInBytes / 2; /* stride in GLushorts */
-#endif
+
GLint row;
/* compute dest address of bottom-left pixel in bitmap */
GLushort *dst = (GLushort *) info.lfbPtr
GLint col;
for (col=0; col<width; col++) {
if (*src & mask) {
- if (INSIDE(fxMesa, winX + px + col, winY - py - row))
- dst[col] = color;
+ dst[col] = color;
}
if (mask == 128U) {
src++;
GLint col;
for (col=0; col<width; col++) {
if (*src & mask) {
- if (INSIDE(fxMesa, winX + px + col, winY - py - row))
- dst[col] = color;
+ dst[col] = color;
}
if (mask == 1U) {
src++;
}
}
-#undef INSIDE
-
FX_grLfbUnlock(GR_LFB_WRITE_ONLY,fxMesa->currentFB);
return GL_TRUE;
}
const struct gl_pixelstore_attrib *packing,
GLvoid *dstImage )
{
- if (ctx->ImageTransferState) {
+ if (ctx->_ImageTransferState) {
return GL_FALSE; /* can't do this */
}
else {
GR_ORIGIN_UPPER_LEFT,
FXFALSE,
&info)) {
- const GLint winX = fxMesa->x_offset;
- const GLint winY = fxMesa->y_offset + fxMesa->height - 1;
-#ifdef XF86DRI
- const GLint srcStride = (fxMesa->glCtx->Color.DrawBuffer == GL_FRONT)
- ? (fxMesa->screen_width) : (info.strideInBytes / 2);
-#else
+ const GLint winX = 0;
+ const GLint winY = fxMesa->height - 1;
const GLint srcStride = info.strideInBytes / 2; /* stride in GLushorts */
-#endif
const GLushort *src = (const GLushort *) info.lfbPtr
+ (winY - y) * srcStride + (winX + x);
GLubyte *dst = (GLubyte *) _mesa_image_address(packing, dstImage,
}
-static GLint fxDDGetParameteri(const GLcontext *ctx, GLint param)
-{
- switch(param) {
- case DD_HAVE_HARDWARE_FOG:
- return 1;
- default:
- fprintf(stderr,"fx Driver: internal error in fxDDGetParameteri(): %x\n", (int) param);
- fxCloseHardware();
- exit(-1);
- return 0;
- }
-}
void fxDDSetNearFar(GLcontext *ctx, GLfloat n, GLfloat f)
*/
static const GLubyte *fxDDGetString(GLcontext *ctx, GLenum name)
{
-#if defined(GLX_DIRECT_RENDERING)
- /* Building for DRI driver */
- switch (name) {
- case GL_RENDERER:
- {
- static char buffer[100];
- char hardware[100];
- strcpy(hardware, grGetString(GR_HARDWARE));
- if (strcmp(hardware, "Voodoo3 (tm)") == 0)
- strcpy(hardware, "Voodoo3");
- else if (strcmp(hardware, "Voodoo Banshee (tm)") == 0)
- strcpy(hardware, "VoodooBanshee");
- else {
- /* unexpected result: replace spaces with hyphens */
- int i;
- for (i = 0; hardware[i]; i++) {
- if (hardware[i] == ' ' || hardware[i] == '\t')
- hardware[i] = '-';
- }
- }
- /* now make the GL_RENDERER string */
- sprintf(buffer, "Mesa DRI %s 20000510", hardware);
- return buffer;
- }
- case GL_VENDOR:
- return "Precision Insight, Inc.";
- default:
- return NULL;
- }
-
-#else
-
- /* Building for Voodoo1/2 stand-alone Mesa */
switch (name) {
case GL_RENDERER:
{
default:
return NULL;
}
-#endif
}
fxMesa->new_state = _NEW_ALL;
fxDDSetupInit();
- fxDDClipInit();
fxDDTrifuncInit();
fxDDFastPathInit();
+
+ /* Initialize the software rasterizer and helper modules.
+ */
+ _swrast_CreateContext( fxMesa->glCtx );
+ _swsetup_CreateContext( fxMesa->glCtx );
+
+
fxSetupDDPointers(fxMesa->glCtx);
- fxDDRenderInit(fxMesa->glCtx);
fxDDInitExtensions(fxMesa->glCtx);
fxDDSetNearFar(fxMesa->glCtx,1.0,100.0);
}
-#if 0
-/* Example extension function */
-static void fxFooBarEXT(GLint i)
-{
- printf("You called glFooBarEXT(%d)\n", i);
-}
-#endif
void fxDDInitExtensions( GLcontext *ctx )
if (!fxMesa->emulateTwoTMUs)
gl_extensions_disable(ctx, "GL_ARB_multitexture");
-
-
- /* Example of hooking in an extension function.
- * For DRI-based drivers, also see __driRegisterExtensions in the
- * tdfx_xmesa.c file.
- */
-#if 0
- {
- void **dispatchTable = (void **) ctx->Exec;
- const int _gloffset_FooBarEXT = 555; /* just an example number! */
- const int tabSize = _glapi_get_dispatch_table_size();
- assert(_gloffset_FooBarEXT < tabSize);
- dispatchTable[_gloffset_FooBarEXT] = (void *) fxFooBarEXT;
- /* XXX You would also need to hook into the display list dispatch
- * table. Really, the implementation of extensions might as well
- * be in the core of Mesa since core Mesa and the device driver
- * is one big shared lib.
- */
- }
-#endif
}
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
+ if (ctx->RenderMode != GL_RENDER)
+ return GL_FALSE;
+
if (!ctx->Hint.AllowDrawMem)
return GL_TRUE; /* you'll take it and like it */
- if((ctx->RasterMask & (STENCIL_BIT | MULTI_DRAW_BIT)) ||
- ((ctx->Color.BlendEnabled) && (ctx->Color.BlendEquation!=GL_FUNC_ADD_EXT)) ||
- ((ctx->Color.ColorLogicOpEnabled) && (ctx->Color.LogicOp!=GL_COPY)) ||
- (ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR) ||
- (!((ctx->Color.ColorMask[RCOMP]==ctx->Color.ColorMask[GCOMP]) &&
- (ctx->Color.ColorMask[GCOMP]==ctx->Color.ColorMask[BCOMP]) &&
- (ctx->Color.ColorMask[ACOMP]==ctx->Color.ColorMask[ACOMP])))
- )
+ if (ctx->Stencil.Enabled ||
+ ctx->Color.MultiDrawBuffer ||
+ ((ctx->Color.BlendEnabled) && (ctx->Color.BlendEquation!=GL_FUNC_ADD_EXT)) ||
+ ((ctx->Color.ColorLogicOpEnabled) && (ctx->Color.LogicOp!=GL_COPY)) ||
+ (ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR) ||
+ (!((ctx->Color.ColorMask[RCOMP]==ctx->Color.ColorMask[GCOMP]) &&
+ (ctx->Color.ColorMask[GCOMP]==ctx->Color.ColorMask[BCOMP]) &&
+ (ctx->Color.ColorMask[ACOMP]==ctx->Color.ColorMask[ACOMP])))
+ )
{
return GL_FALSE;
}
/* Unsupported texture/multitexture cases */
if(fxMesa->emulateTwoTMUs) {
- if((ctx->Enabled & (TEXTURE0_3D | TEXTURE1_3D)) ||
+ if((ctx->_Enabled & (TEXTURE0_3D | TEXTURE1_3D)) ||
/* Not very well written ... */
- ((ctx->Enabled & (TEXTURE0_1D | TEXTURE1_1D)) &&
- ((ctx->Enabled & (TEXTURE0_2D | TEXTURE1_2D))!=(TEXTURE0_2D | TEXTURE1_2D)))
+ ((ctx->_Enabled & (TEXTURE0_1D | TEXTURE1_1D)) &&
+ ((ctx->_Enabled & (TEXTURE0_2D | TEXTURE1_2D))!=(TEXTURE0_2D | TEXTURE1_2D)))
) {
return GL_FALSE;
}
- if (ctx->Texture.ReallyEnabled & TEXTURE0_2D) {
+ if (ctx->Texture._ReallyEnabled & TEXTURE0_2D) {
if (ctx->Texture.Unit[0].EnvMode == GL_BLEND &&
- (ctx->Texture.ReallyEnabled & TEXTURE1_2D ||
+ (ctx->Texture._ReallyEnabled & TEXTURE1_2D ||
ctx->Texture.Unit[0].EnvColor[0] != 0 ||
ctx->Texture.Unit[0].EnvColor[1] != 0 ||
ctx->Texture.Unit[0].EnvColor[2] != 0 ||
ctx->Texture.Unit[0].EnvColor[3] != 1)) {
return GL_FALSE;
}
- if (ctx->Texture.Unit[0].Current->Image[0]->Border > 0)
+ if (ctx->Texture.Unit[0]._Current->Image[0]->Border > 0)
return GL_FALSE;
}
- if (ctx->Texture.ReallyEnabled & TEXTURE1_2D) {
+ if (ctx->Texture._ReallyEnabled & TEXTURE1_2D) {
if (ctx->Texture.Unit[1].EnvMode == GL_BLEND)
return GL_FALSE;
- if (ctx->Texture.Unit[0].Current->Image[0]->Border > 0)
+ if (ctx->Texture.Unit[0]._Current->Image[0]->Border > 0)
return GL_FALSE;
}
/* KW: This was wrong (I think) and I changed it... which doesn't mean
* it is now correct...
*/
- if((ctx->Enabled & (TEXTURE0_1D | TEXTURE0_2D | TEXTURE0_3D)) &&
- (ctx->Enabled & (TEXTURE1_1D | TEXTURE1_2D | TEXTURE1_3D)))
+ if((ctx->_Enabled & (TEXTURE0_1D | TEXTURE0_2D | TEXTURE0_3D)) &&
+ (ctx->_Enabled & (TEXTURE1_1D | TEXTURE1_2D | TEXTURE1_3D)))
{
/* Can't use multipass to blend a multitextured triangle - fall
* back to software.
}
}
} else {
- if((ctx->Enabled & (TEXTURE1_1D | TEXTURE1_2D | TEXTURE1_3D)) ||
+ if((ctx->_Enabled & (TEXTURE1_1D | TEXTURE1_2D | TEXTURE1_3D)) ||
/* Not very well written ... */
- ((ctx->Enabled & TEXTURE0_1D) &&
- (!(ctx->Enabled & TEXTURE0_2D)))
+ ((ctx->_Enabled & TEXTURE0_1D) &&
+ (!(ctx->_Enabled & TEXTURE0_2D)))
) {
return GL_FALSE;
}
- if((ctx->Texture.ReallyEnabled & TEXTURE0_2D) &&
+ if((ctx->Texture._ReallyEnabled & TEXTURE0_2D) &&
(ctx->Texture.Unit[0].EnvMode==GL_BLEND)) {
return GL_FALSE;
}
static void fxDDUpdateDDPointers(GLcontext *ctx)
{
- fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
GLuint new_state = ctx->NewState;
- if (MESA_VERBOSE&(VERBOSE_DRIVER|VERBOSE_STATE))
- fprintf(stderr,"fxmesa: fxDDUpdateDDPointers(...)\n");
+ _swrast_InvalidateState( ctx, new_state );
+ _swsetup_InvalidateState( ctx, new_state );
- if (new_state & _FX_NEW_FALLBACK)
- fxMesa->is_in_hardware = fxIsInHardware(ctx);
+ if (new_state & (_FX_NEW_IS_IN_HARDWARE |
+ _FX_NEW_RENDERSTATE |
+ _FX_NEW_SETUP_FUNCTION))
+ {
+ fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
- if (fxMesa->is_in_hardware) {
+ if (new_state & _FX_NEW_IS_IN_HARDWARE)
+ fxMesa->is_in_hardware = fxIsInHardware(ctx);
+
if (fxMesa->new_state)
fxSetupFXUnits(ctx);
- if (new_state & _FX_NEW_RENDERSTATE) {
+ if (new_state & _FX_NEW_RENDERSTATE)
fxDDChooseRenderState( ctx );
-
- fxMesa->RenderVBTables=fxDDChooseRenderVBTables(ctx);
- fxMesa->RenderVBClippedTab=fxMesa->RenderVBTables[0];
- fxMesa->RenderVBCulledTab=fxMesa->RenderVBTables[1];
- fxMesa->RenderVBRawTab=fxMesa->RenderVBTables[2];
- }
if (new_state & _FX_NEW_SETUP_FUNCTION)
- ctx->Driver.RasterSetup=fxDDChooseSetupFunction(ctx);
-
-
- ctx->Driver.PointsFunc=fxMesa->PointsFunc;
- ctx->Driver.LineFunc=fxMesa->LineFunc;
- ctx->Driver.TriangleFunc=fxMesa->TriangleFunc;
- ctx->Driver.QuadFunc=fxMesa->QuadFunc;
- } else {
- fxMesa->render_index = FX_FALLBACK;
+ ctx->Driver.RasterSetup = fxDDChooseSetupFunction(ctx);
}
}
-static void fxDDReducedPrimitiveChange(GLcontext *ctx, GLenum prim)
-{
- if (ctx->Polygon.CullFlag) {
- if (ctx->ReducedPrimitive != GL_POLYGON) { /* Lines or Points */
- FX_grCullMode(GR_CULL_DISABLE);
- FX_CONTEXT(ctx)->cullMode=GR_CULL_DISABLE;
- }
- }
-}
+
void fxSetupDDPointers(GLcontext *ctx)
{
fprintf(stderr,"fxmesa: fxSetupDDPointers()\n");
}
- ctx->Driver.UpdateStateNotify = (_FX_NEW_SETUP_FUNCTION|
- _FX_NEW_RENDERSTATE|
- _FX_NEW_FALLBACK|
- _SWRAST_NEW_TRIANGLE|
- _SWRAST_NEW_LINE|
- _SWRAST_NEW_POINT);
-
+ ctx->Driver.UpdateStateNotify = ~0;
ctx->Driver.UpdateState=fxDDUpdateDDPointers;
ctx->Driver.WriteDepthSpan=fxDDWriteDepthSpan;
ctx->Driver.NearFar=fxDDSetNearFar;
- ctx->Driver.GetParameteri=fxDDGetParameteri;
-
ctx->Driver.ClearIndex=NULL;
ctx->Driver.ClearColor=fxDDClearColor;
ctx->Driver.Clear=fxDDClear;
ctx->Driver.CullFace=fxDDCullFace;
ctx->Driver.ShadeModel=fxDDShadeModel;
ctx->Driver.Enable=fxDDEnable;
- ctx->Driver.ReducedPrimitiveChange=fxDDReducedPrimitiveChange;
ctx->Driver.RegisterVB=fxDDRegisterVB;
ctx->Driver.UnregisterVB=fxDDUnregisterVB;
ctx->Driver.RegisterPipelineStages = fxDDRegisterPipelineStages;
- ctx->Driver.OptimizeImmediatePipeline = 0; /* nothing done yet */
- ctx->Driver.OptimizePrecalcPipeline = 0;
-
-/* if (getenv("MESA_USE_FAST") || getenv("FX_USE_FAST")) */
-/* ctx->Driver.OptimizePrecalcPipeline = fxDDOptimizePrecalcPipeline; */
-
if (!getenv("FX_NO_FAST"))
ctx->Driver.BuildPrecalcPipeline = fxDDBuildPrecalcPipeline;
- ctx->Driver.TriangleCaps = DD_TRI_CULL|DD_TRI_OFFSET|DD_TRI_LIGHT_TWOSIDE;
-
fxSetupDDSpanPointers(ctx);
-
- FX_CONTEXT(ctx)->render_index = 1; /* force an update */
fxDDUpdateDDPointers(ctx);
}
-/* -*- mode: C; tab-width:8; c-basic-offset:2 -*- */
/*
* Mesa 3-D graphics library
#if !defined(FXMESA_USE_ARGB)
-#if defined(FX_GLIDE3) && defined(XF86DRI)
-
-static FxBool writeRegionClipped(fxMesaContext fxMesa, GrBuffer_t dst_buffer,
- FxU32 dst_x, FxU32 dst_y, GrLfbSrcFmt_t src_format,
- FxU32 src_width, FxU32 src_height, FxI32 src_stride,
- void *src_data)
-{
- int i, x, w, srcElt;
- void *data;
-
- if (src_width==1 && src_height==1) { /* Easy case writing a point */
- for (i=0; i<fxMesa->numClipRects; i++) {
- if ((dst_x>=fxMesa->pClipRects[i].x1) &&
- (dst_x<fxMesa->pClipRects[i].x2) &&
- (dst_y>=fxMesa->pClipRects[i].y1) &&
- (dst_y<fxMesa->pClipRects[i].y2)) {
- FX_grLfbWriteRegion(dst_buffer, dst_x, dst_y, src_format,
- 1, 1, src_stride, src_data);
- return GL_TRUE;
- }
- }
- } else if (src_height==1) { /* Writing a span */
- if (src_format==GR_LFB_SRC_FMT_8888) srcElt=4;
- else if (src_format==GR_LFB_SRC_FMT_ZA16) srcElt=2;
- else {
- fprintf(stderr, "Unknown src_format passed to writeRegionClipped\n");
- return GL_FALSE;
- }
- for (i=0; i<fxMesa->numClipRects; i++) {
- if (dst_y>=fxMesa->pClipRects[i].y1 && dst_y<fxMesa->pClipRects[i].y2) {
- if (dst_x<fxMesa->pClipRects[i].x1) {
- x=fxMesa->pClipRects[i].x1;
- data=((char*)src_data)+srcElt*(x - dst_x);
- w=src_width-(x-dst_x);
- } else {
- x=dst_x;
- data=src_data;
- w=src_width;
- }
- if (x+w>fxMesa->pClipRects[i].x2) {
- w=fxMesa->pClipRects[i].x2-x;
- }
- FX_grLfbWriteRegion(dst_buffer, x, dst_y, src_format, w, 1,
- src_stride, data);
- }
- }
- } else { /* Punt on the case of arbitrary rectangles */
- return GL_FALSE;
- }
- return GL_TRUE;
-}
-
-#else
#define writeRegionClipped(fxm,dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data)
-#endif
/* KW: Rearranged the args in the call to grLfbWriteRegion().
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
GLuint i;
- GLint bottom=fxMesa->height+fxMesa->y_offset-1;
+ GLint bottom=fxMesa->height-1;
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxDDWriteRGBASpan(...)\n");
}
- x+=fxMesa->x_offset;
if (mask) {
int span=0;
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
GLuint i;
- GLint bottom=fxMesa->height+fxMesa->y_offset-1;
+ GLint bottom=fxMesa->height-1;
GLubyte rgba[MAX_WIDTH][4];
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxDDWriteRGBSpan()\n");
}
- x+=fxMesa->x_offset;
if (mask) {
int span=0;
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
GLuint i;
- GLint bottom=fxMesa->height+fxMesa->y_offset-1;
+ GLint bottom=fxMesa->height-1;
GLuint data[MAX_WIDTH];
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxDDWriteMonoRGBASpan(...)\n");
}
- x+=fxMesa->x_offset;
if (mask) {
int span=0;
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
GLushort data[MAX_WIDTH];
GLuint i;
- GLint bottom=fxMesa->height+fxMesa->y_offset-1;
+ GLint bottom=fxMesa->height-1;
printf("read span %d, %d, %d\n", x,y,n);
if (MESA_VERBOSE&VERBOSE_DRIVER) {
assert(n < MAX_WIDTH);
- x+=fxMesa->x_offset;
FX_grLfbReadRegion( fxMesa->currentFB, x, bottom-y, n, 1, 0, data);
for (i=0;i<n;i++) {
GR_ORIGIN_UPPER_LEFT,
FXFALSE,
&info)) {
- const GLint winX = fxMesa->x_offset;
- const GLint winY = fxMesa->y_offset + fxMesa->height - 1;
-#ifdef XF86DRI
- const GLint srcStride = (fxMesa->glCtx->Color.DrawBuffer == GL_FRONT)
- ? (fxMesa->screen_width) : (info.strideInBytes / 2);
-#else
+ const GLint winX = 0;
+ const GLint winY = fxMesa->height - 1;
const GLint srcStride = info.strideInBytes / 2; /* stride in GLushorts */
-#endif
const GLushort *data16 = (const GLushort *) info.lfbPtr
+ (winY - y) * srcStride
+ (winX + x);
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
GLuint i;
- GLint bottom=fxMesa->height+fxMesa->y_offset-1;
+ GLint bottom=fxMesa->height-1;
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxDDWriteRGBAPixels(...)\n");
for(i=0;i<n;i++)
if(mask[i])
- LFB_WRITE_SPAN_MESA(fxMesa->currentFB, x[i]+fxMesa->x_offset, bottom-y[i],
+ LFB_WRITE_SPAN_MESA(fxMesa->currentFB, x[i], bottom-y[i],
1, 1, (void *)rgba[i]);
}
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
GLuint i;
- GLint bottom=fxMesa->height+fxMesa->y_offset-1;
+ GLint bottom=fxMesa->height-1;
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxDDWriteMonoRGBAPixels(...)\n");
for(i=0;i<n;i++)
if(mask[i])
- writeRegionClipped(fxMesa, fxMesa->currentFB,x[i]+fxMesa->x_offset,bottom-y[i],
+ writeRegionClipped(fxMesa, fxMesa->currentFB,x[i],bottom-y[i],
GR_LFB_SRC_FMT_8888,1,1,0,(void *) &fxMesa->color);
}
GR_ORIGIN_UPPER_LEFT,
FXFALSE,
&info)) {
-#ifdef XF86DRI
- const GLint srcStride = (fxMesa->glCtx->Color.DrawBuffer == GL_FRONT)
- ? (fxMesa->screen_width) : (info.strideInBytes / 2);
-#else
const GLint srcStride = info.strideInBytes / 2; /* stride in GLushorts */
-#endif
- const GLint winX = fxMesa->x_offset;
- const GLint winY = fxMesa->y_offset + fxMesa->height - 1;
+ const GLint winX = 0;
+ const GLint winY = fxMesa->height - 1;
GLuint i;
for(i=0;i<n;i++) {
if(mask[i]) {
const GLubyte mask[])
{
fxMesaContext fxMesa = (fxMesaContext)ctx->DriverCtx;
- GLint bottom = fxMesa->height + fxMesa->y_offset - 1;
+ GLint bottom = fxMesa->height - 1;
if (MESA_VERBOSE & VERBOSE_DRIVER) {
fprintf(stderr, "fxmesa: fxDDWriteDepthSpan(...)\n");
}
- x += fxMesa->x_offset;
if (mask) {
GLint i;
GLuint n, GLint x, GLint y, GLdepth depth[])
{
fxMesaContext fxMesa = (fxMesaContext)ctx->DriverCtx;
- GLint bottom = fxMesa->height + fxMesa->y_offset - 1;
+ GLint bottom = fxMesa->height - 1;
GLushort depth16[MAX_WIDTH];
GLuint i;
fprintf(stderr, "fxmesa: fxDDReadDepthSpan(...)\n");
}
- x += fxMesa->x_offset;
FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, depth16);
for (i = 0; i < n; i++) {
depth[i] = depth16[i];
const GLdepth depth[], const GLubyte mask[])
{
fxMesaContext fxMesa = (fxMesaContext)ctx->DriverCtx;
- GLint bottom = fxMesa->height + fxMesa->y_offset - 1;
+ GLint bottom = fxMesa->height - 1;
GLuint i;
if (MESA_VERBOSE & VERBOSE_DRIVER) {
for (i = 0; i < n; i++) {
if (mask[i]) {
- int xpos = x[i] + fxMesa->x_offset;
+ int xpos = x[i];
int ypos = bottom - y[i];
GLushort d = depth[i];
writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER, xpos, ypos,
const GLint x[], const GLint y[], GLdepth depth[])
{
fxMesaContext fxMesa = (fxMesaContext)ctx->DriverCtx;
- GLint bottom = fxMesa->height + fxMesa->y_offset - 1;
+ GLint bottom = fxMesa->height - 1;
GLuint i;
if (MESA_VERBOSE & VERBOSE_DRIVER) {
}
for (i = 0; i < n; i++) {
- int xpos = x[i] + fxMesa->x_offset;
+ int xpos = x[i];
int ypos = bottom - y[i];
GLushort d;
FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER, xpos, ypos, 1, 1, 0, &d);
-/* -*- mode: C; tab-width:8; c-basic-offset:2 -*- */
/*
* Mesa 3-D graphics library
else {
fxMesa->haveGlobalPaletteTexture = 0;
- if ((ctx->Texture.Unit[0].Current == ctx->Texture.Unit[0].CurrentD[2]) &&
- (ctx->Texture.Unit[0].Current != NULL)) {
- struct gl_texture_object *tObj = ctx->Texture.Unit[0].Current;
+ if ((ctx->Texture.Unit[0]._Current == ctx->Texture.Unit[0].CurrentD[2]) &&
+ (ctx->Texture.Unit[0]._Current != NULL)) {
+ struct gl_texture_object *tObj = ctx->Texture.Unit[0]._Current;
if (!tObj->DriverData)
tObj->DriverData = fxAllocTexObjData(fxMesa);
-/* -*- mode: C; tab-width:8; c-basic-offset:2 -*- */
/*
* Mesa 3-D graphics library
* you turn debugging on/off from the debugger.
*/
-#ifdef XFree86Server
-#include "GL/xf86glx.h"
-#else
#include "glheader.h"
-#endif
#if defined(__linux__)
#include "clip.h"
#include "vbrender.h"
-#ifdef XF86DRI
-typedef struct tfxMesaContext *fxMesaContext;
-#else
#include "GL/fxmesa.h"
-#endif
#include "fxglidew.h"
-/* use gl/gl.h GLAPI/GLAPIENTRY/GLCALLBACK in place of WINGDIAPI/APIENTRY/CALLBACK, */
-/* these are defined in mesa gl/gl.h - tjump@spgs.com */
+
+/* use gl/gl.h GLAPI/GLAPIENTRY/GLCALLBACK in place of
+ * WINGDIAPI/APIENTRY/CALLBACK, these are defined in mesa gl/gl.h -
+ * tjump@spgs.com
+ */
#define T1COORD GR_VERTEX_TOW_TMU1_OFFSET
-#if FX_USE_PARGB
-
-#define CLIP_XCOORD 0 /* normal place */
-#define CLIP_YCOROD 1 /* normal place */
-#define CLIP_ZCOORD 2 /* normal place */
-#define CLIP_WCOORD 3 /* normal place */
-#define CLIP_GCOORD 4 /* GR_VERTEX_PARGB_OFFSET */
-#define CLIP_BCOORD 5 /* GR_VERTEX_SOW_TMU0_OFFSET */
-#define CLIP_RCOORD 6 /* GR_VERTEX_TOW_TMU0_OFFSET */
-#define CLIP_ACOORD 7 /* GR_VERTEX_OOW_TMU0_OFFSET */
-
-#else
#define CLIP_XCOORD 0 /* normal place */
#define CLIP_YCOROD 1 /* normal place */
#define CLIP_ACOORD 7 /* normal place */
-#endif
/* Should have size == 16 * sizeof(float).
*/
-typedef struct {
- GLfloat f[15]; /* Same layout as GrVertex */
- GLubyte mask; /* Unsued */
- GLubyte usermask; /* Unused */
+typedef union {
+ GrVertex v;
+ GLfloat f[16];
+ GLuint ui[16];
} fxVertex;
-
-
#if defined(FXMESA_USE_ARGB)
#define FXCOLOR4( c ) ( \
( ((unsigned int)(c[3]))<<24 ) | \
#endif
#endif
-#define FX_VB_COLOR(fxm, color) \
- do { \
- if (sizeof(GLint) == 4*sizeof(GLubyte)) { \
- if (fxm->constColor != *(GLuint*)color) { \
- fxm->constColor = *(GLuint*)color; \
- FX_grConstantColorValue(FXCOLOR4(color)); \
- } \
- } else { \
- FX_grConstantColorValue(FXCOLOR4(color)); \
- } \
- } while (0)
-
-#define GOURAUD(x) { \
- GLubyte *col = VB->ColorPtr->data[(x)]; \
- gWin[(x)].v.r=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[0]); \
- gWin[(x)].v.g=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[1]); \
- gWin[(x)].v.b=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[2]); \
- gWin[(x)].v.a=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[3]); \
-}
-
-#if FX_USE_PARGB
-#define GOURAUD2(v, c) { \
- GLubyte *col = c; \
- v->argb=MESACOLOR2PARGB(col); \
-}
-#else
-#define GOURAUD2(v, c) { \
- GLubyte *col = c; \
- v->r=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[0]); \
- v->g=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[1]); \
- v->b=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[2]); \
- v->a=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[3]); \
-}
-#endif
/* Mergable items first
#define SETUP_RGBA 0x1
#define SETUP_TMU0 0x2
#define SETUP_TMU1 0x4
-#define SETUP_XY 0x8
-#define SETUP_Z 0x10
-#define SETUP_W 0x20
+#define SETUP_XYZW 0x8
+#define MAX_SETUP 0x10
#define MAX_MERGABLE 0x8
} tfxStats;
-typedef void (*tfxTriViewClipFunc)( struct vertex_buffer *VB,
- GLuint v[],
- GLubyte mask );
-
-typedef void (*tfxTriClipFunc)( struct vertex_buffer *VB,
- GLuint v[],
- GLuint mask );
-
-
-typedef void (*tfxLineClipFunc)( struct vertex_buffer *VB,
- GLuint v1, GLuint v2,
- GLubyte mask );
-
-
-extern tfxTriViewClipFunc fxTriViewClipTab[0x8];
-extern tfxTriClipFunc fxTriClipStrideTab[0x8];
-extern tfxLineClipFunc fxLineClipTab[0x8];
typedef struct {
/* Alpha test */
} tfxUnitsState;
-/* Flags for render_index.
- */
-#define FX_OFFSET 0x1
-#define FX_TWOSIDE 0x2
-#define FX_FRONT_BACK 0x4
-#define FX_FLAT 0x8
-#define FX_ANTIALIAS 0x10
-#define FX_FALLBACK 0x20
/* Flags for fxMesa->new_state
fxVertex *verts;
fxVertex *last_vert;
void *vert_store;
-#if defined(FX_GLIDE3)
- GrVertex **triangle_b; /* Triangle buffer */
- GrVertex **strips_b; /* Strips buffer */
-#endif
GLuint size;
};
#define FX_DRIVER_DATA(vb) ((struct tfxMesaVertexBuffer *)((vb)->driver_data))
#define FX_CONTEXT(ctx) ((fxMesaContext)((ctx)->DriverCtx))
-#define FX_TEXTURE_DATA(t) fxTMGetTexInfo((t)->Current)
+#define FX_TEXTURE_DATA(t) fxTMGetTexInfo((t)->_Current)
-#if defined(XFree86Server) || defined(GLX_DIRECT_RENDERING)
-#include "tdfx_init.h"
-#else
-#define DRI_FX_CONTEXT
#define BEGIN_BOARD_LOCK()
#define END_BOARD_LOCK()
#define BEGIN_CLIP_LOOP()
#define END_CLIP_LOOP()
-#endif
/* Covers the state referenced by IsInHardware:
*/
-#define _FX_NEW_FALLBACK (_NEW_TEXTURE| \
- _NEW_HINT| \
- _NEW_STENCIL| \
- _NEW_BUFFERS| \
- _NEW_COLOR| \
- _NEW_LIGHT)
-
-/* Covers the state referenced by fxDDChooseRenderState and
- * fxDDChoseRenderVBTables.
+#define _FX_NEW_IS_IN_HARDWARE (_NEW_TEXTURE| \
+ _NEW_HINT| \
+ _NEW_STENCIL| \
+ _NEW_BUFFERS| \
+ _NEW_COLOR| \
+ _NEW_LIGHT)
+
+/* Covers the state referenced by fxDDChooseRenderState
*/
-#define _FX_NEW_RENDERSTATE (_NEW_RENDERMODE | \
+#define _FX_NEW_RENDERSTATE (_FX_NEW_IS_IN_HARDWARE | \
_DD_NEW_FLATSHADE | \
_DD_NEW_TRI_LIGHT_TWOSIDE| \
- _DD_NEW_MULTIDRAW | \
- _NEW_POINT | \
- _NEW_LINE | \
- _NEW_POLYGON)
+ _DD_NEW_TRI_OFFSET | \
+ _DD_NEW_TRI_UNFILLED | \
+ _DD_NEW_TRI_SMOOTH | \
+ _DD_NEW_TRI_STIPPLE | \
+ _DD_NEW_LINE_SMOOTH | \
+ _DD_NEW_LINE_STIPPLE | \
+ _DD_NEW_LINE_WIDTH | \
+ _DD_NEW_POINT_SMOOTH | \
+ _DD_NEW_POINT_SIZE | \
+ _NEW_LINE)
/* Covers the state referenced by fxDDChooseSetupFunction.
*/
extern GLubyte FX_PixelToB[0x10000];
+typedef void (*fx_tri_func)( GLcontext *, const fxVertex *, const fxVertex *, const fxVertex * );
+typedef void (*fx_line_func)( GLcontext *, const fxVertex *, const fxVertex * );
+typedef void (*fx_point_func)( GLcontext *, const fxVertex * );
+typedef void (*fxRenderEltsFunc)( struct vertex_buffer * );
+
struct tfxMesaContext {
GuTexPalette glbPalette;
GLcontext *glCtx; /* the core Mesa context */
-#if !defined(XFree86Server) && !defined(GLX_DIRECT_RENDERING)
GLvisual *glVis; /* describes the color buffer */
GLframebuffer *glBuffer; /* the ancillary buffers */
-#endif
GLint board; /* the board used for this context */
GLint width, height; /* size of color buffer */
GLuint tmu_source[FX_NUM_TMU];
GLuint tex_dest[MAX_TEXTURE_UNITS];
+ GLuint render_index;
GLuint setupindex;
- GLuint partial_setup_index;
GLuint setupdone;
- GLuint mergeindex;
- GLuint mergeinputs;
- GLuint render_index;
- GLuint last_tri_caps;
GLuint stw_hint_state; /* for grHints */
GLuint is_in_hardware;
GLuint new_state;
GLuint using_fast_path, passes, multipass;
- tfxLineClipFunc clip_line;
- tfxTriClipFunc clip_tri_stride;
- tfxTriViewClipFunc view_clip_tri;
-
-
/* Texture Memory Manager Data */
GLuint texBindNumber;
/* Acc. functions */
- points_func PointsFunc;
- line_func LineFunc;
- triangle_func TriangleFunc;
- quad_func QuadFunc;
+ fx_point_func draw_point;
+ fx_line_func draw_line;
+ fx_tri_func draw_tri;
+
+ fxRenderEltsFunc RenderElementsRaw;
- render_func **RenderVBTables;
+ /* System to turn culling on/off for tris/lines/points.
+ */
+ fx_point_func initial_point;
+ fx_line_func initial_line;
+ fx_tri_func initial_tri;
- render_func *RenderVBClippedTab;
- render_func *RenderVBCulledTab;
- render_func *RenderVBRawTab;
+ fx_point_func subsequent_point;
+ fx_line_func subsequent_line;
+ fx_tri_func subsequent_tri;
+
+ GLfloat inv_s0scale;
+ GLfloat inv_s1scale;
+ GLfloat inv_t0scale;
+ GLfloat inv_t1scale;
tfxStats stats;
FX_GrContext_t glideContext;
- int x_offset;
- int y_offset;
- int y_delta;
int screen_width;
int screen_height;
int initDone;
int clipMaxX;
int clipMinY;
int clipMaxY;
- int needClip;
-
- DRI_FX_CONTEXT
};
typedef void (*tfxSetupFunc)(struct vertex_buffer *, GLuint, GLuint);
extern void fxDDChooseRenderState( GLcontext *ctx );
-extern void fxRenderClippedLine( struct vertex_buffer *VB,
- GLuint v1, GLuint v2 );
-
extern tfxSetupFunc fxDDChooseSetupFunction(GLcontext *);
-extern points_func fxDDChoosePointsFunction(GLcontext *);
-extern line_func fxDDChooseLineFunction(GLcontext *);
-extern triangle_func fxDDChooseTriangleFunction(GLcontext *);
-extern quad_func fxDDChooseQuadFunction(GLcontext *);
-extern render_func **fxDDChooseRenderVBTables(GLcontext *);
-
extern void fxDDRenderInit(GLcontext *);
-extern void fxDDClipInit(void);
extern void fxUpdateDDSpanPointers(GLcontext *);
extern void fxSetupDDSpanPointers(GLcontext *);
extern void fxDDUnregisterVB( struct vertex_buffer *VB );
extern void fxDDResizeVB( struct vertex_buffer *VB, GLuint size );
-extern void fxDDCheckMergeAndRender( GLcontext *ctx,
- struct gl_pipeline_stage *d );
-
-extern void fxDDMergeAndRender( struct vertex_buffer *VB );
-
-
extern void fxDDPartialRasterSetup( struct vertex_buffer *VB );
extern void fxDDDoRasterSetup( struct vertex_buffer *VB );
extern GLboolean fxDDBuildPrecalcPipeline( GLcontext *ctx );
-extern void fxDDOptimizePrecalcPipeline( GLcontext *ctx,
- struct gl_pipeline *pipe );
-
-extern void fxDDRenderElementsDirect( struct vertex_buffer *VB );
-
extern void fxDDInitExtensions( GLcontext *ctx );
#define fxTMGetTexInfo(o) ((tfxTexInfo*)((o)->DriverData))
-/* -*- mode: C; tab-width:8; c-basic-offset:2 -*- */
/*
* Mesa 3-D graphics library
END_CLIP_LOOP();
}
-#if FX_USE_PARGB
-void FX_setupGrVertexLayout(void)
-{
- BEGIN_BOARD_LOCK();
- grReset(GR_VERTEX_PARAMETER);
-
- grCoordinateSpace(GR_WINDOW_COORDS);
- grVertexLayout(GR_PARAM_XY, GR_VERTEX_X_OFFSET << 2, GR_PARAM_ENABLE);
- grVertexLayout(GR_PARAM_PARGB, GR_VERTEX_PARGB_OFFSET << 2, GR_PARAM_ENABLE);
- grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
- grVertexLayout(GR_PARAM_Z, GR_VERTEX_OOZ_OFFSET << 2, GR_PARAM_ENABLE);
- grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
- grVertexLayout(GR_PARAM_Q0, GR_VERTEX_OOW_TMU0_OFFSET << 2, GR_PARAM_DISABLE);
- grVertexLayout(GR_PARAM_ST1, GR_VERTEX_SOW_TMU1_OFFSET << 2, GR_PARAM_DISABLE);
- grVertexLayout(GR_PARAM_Q1, GR_VERTEX_OOW_TMU1_OFFSET << 2, GR_PARAM_DISABLE);
- END_BOARD_LOCK();
-}
-#else /* FX_USE_PARGB */
void FX_setupGrVertexLayout(void)
{
BEGIN_BOARD_LOCK();
grVertexLayout(GR_PARAM_Q1, GR_VERTEX_OOW_TMU1_OFFSET << 2, GR_PARAM_DISABLE);
END_BOARD_LOCK();
}
-#endif
void FX_grHints_NoLock(GrHint_t hintType, FxU32 hintMask)
{
-/* -*- mode: C; tab-width:8; c-basic-offset:2 -*- */
/*
* Mesa 3-D graphics library
} GrTmuVertex;
-#if FX_USE_PARGB
-
-typedef struct
-{
- float x, y; /* X and Y in screen space */
- float ooz; /* 65535/Z (used for Z-buffering) */
- float oow; /* 1/W (used for W-buffering, texturing) */
- FxU32 argb; /* R, G, B, A [0..255.0] */
- GrTmuVertex tmuvtx[GLIDE_NUM_TMU];
- float z; /* Z is ignored */
-} GrVertex;
-
-#define GR_VERTEX_X_OFFSET 0
-#define GR_VERTEX_Y_OFFSET 1
-#define GR_VERTEX_OOZ_OFFSET 2
-#define GR_VERTEX_OOW_OFFSET 3
-#define GR_VERTEX_PARGB_OFFSET 4
-#define GR_VERTEX_SOW_TMU0_OFFSET 5
-#define GR_VERTEX_TOW_TMU0_OFFSET 6
-#define GR_VERTEX_OOW_TMU0_OFFSET 7
-#define GR_VERTEX_SOW_TMU1_OFFSET 8
-#define GR_VERTEX_TOW_TMU1_OFFSET 9
-#define GR_VERTEX_OOW_TMU1_OFFSET 10
-#define GR_VERTEX_Z_OFFSET 11
-
-#define GET_PARGB(v) ((FxU32*)(v))[GR_VERTEX_PARGB_OFFSET]
-/* GET_PA: returns the alpha component */
-#if GLIDE_ENDIAN == GLIDE_ENDIAN_BIG
- #define GET_PA(v) ((FxU8*)(v))[GR_VERTEX_PARGB_OFFSET*4]
-#else
- #define GET_PA(v) ((FxU8*)(v))[GR_VERTEX_PARGB_OFFSET*4+3]
-#endif
-#define MESACOLOR2PARGB(c) (c[ACOMP] << 24 | c[GCOMP] << 16 | c[GCOMP] << 8 | c[BCOMP])
-#define PACK_4F_ARGB(dest,a,r,g,b) { \
- const GLuint cr = (int)r; \
- const GLuint cg = (int)g; \
- const GLuint ca = (int)a; \
- const GLuint cb = (int)b; \
- dest = ca << 24 | cr << 16 | cg << 8 | cb; \
- }
-
-#else /* FX_USE_PARGB */
-
typedef struct
{
float x, y, z; /* X, Y, and Z of scrn space -- Z is ignored */
#define GR_VERTEX_SOW_TMU1_OFFSET 12
#define GR_VERTEX_TOW_TMU1_OFFSET 13
#define GR_VERTEX_OOW_TMU1_OFFSET 14
-#endif /* FX_USE_PARGB */
#endif
-/* -*- mode: C; tab-width:8; c-basic-offset:2 -*- */
/*
* Mesa 3-D graphics library
/* Texture Combine, Color Combine and Alpha Combine.
*/
- tex2Denabled = (ctx->Texture.ReallyEnabled & TEXTURE0_2D);
+ tex2Denabled = (ctx->Texture._ReallyEnabled & TEXTURE0_2D);
if (fxMesa->emulateTwoTMUs)
- tex2Denabled |= (ctx->Texture.ReallyEnabled & TEXTURE1_2D);
+ tex2Denabled |= (ctx->Texture._ReallyEnabled & TEXTURE1_2D);
switch(tex2Denabled) {
case TEXTURE0_2D:
ymax=fxMesa->height;
check=0;
}
- xmin+=fxMesa->x_offset;
- xmax+=fxMesa->x_offset;
- ymin+=fxMesa->y_delta;
- ymax+=fxMesa->y_delta;
if (xmin<fxMesa->clipMinX) xmin=fxMesa->clipMinX;
if (xmax>fxMesa->clipMaxX) xmax=fxMesa->clipMaxX;
if (ymin<fxMesa->screen_height-fxMesa->clipMaxY)
static void fxSetupScissor(GLcontext *ctx)
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
- if (!fxMesa->needClip) {
BEGIN_BOARD_LOCK();
fxSetScissorValues(ctx);
END_BOARD_LOCK();
- }
}
void fxDDScissor( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h )
break;
}
} else FX_CONTEXT(ctx)->cullMode=GR_CULL_DISABLE;
+
FX_grCullMode(FX_CONTEXT(ctx)->cullMode);
}
if (newstate & FX_NEW_COLOR_MASK)
fxSetupColorMask(ctx);
- if (newstate & FX_NEW_CULL)
+ if (newstate & FX_NEW_CULL) {
+
fxSetupCull(ctx);
+ }
+ fxMesa->draw_point = fxMesa->initial_point;
+ fxMesa->draw_line = fxMesa->initial_line;
+ fxMesa->draw_tri = fxMesa->initial_tri;
fxMesa->new_state = 0;
-/* ctx->Driver.RenderStart = 0; */
}
}
-/* -*- mode: C; tab-width:8; c-basic-offset:2 -*- */
/*
* Mesa 3-D graphics library
ti=fxTMGetTexInfo(tObj);
if (ti && ti->isInTM) {
for (i=0; i<MAX_TEXTURE_UNITS; i++)
- if (ctx->glCtx->Texture.Unit[i].Current==tObj) {
+ if (ctx->glCtx->Texture.Unit[i]._Current==tObj) {
/* Force the texture onto the board, as it could be in use */
where=ti->whichTMU;
fxTMMoveOutTM_NoLock(ctx, tObj);
-/* -*- mode: C; tab-width:8; c-basic-offset:2 -*- */
/*
* Mesa 3-D graphics library