Remove CVS keywords.
[mesa.git] / src / mesa / drivers / dri / ffb / ffb_state.c
index 53d56d204369639b5e8dba799c52a5c5396d3766..ee0fe4e0dbe73ed1362c0b6e71a030d676cb0994 100644 (file)
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_state.c,v 1.5 2002/10/30 12:51:27 alanh Exp $
+/* 
  *
  * GLX Hardware Device Driver for Sun Creator/Creator3D
  * Copyright (C) 2000, 2001 David S. Miller
  *    David S. Miller <davem@redhat.com>
  */
 
-#include "mtypes.h"
-#include "buffers.h"
-#include "colormac.h"
-#include "mm.h"
+#include "main/mtypes.h"
+#include "main/colormac.h"
+#include "main/mm.h"
+#include "main/extensions.h"
+#include "main/enums.h"
+
+#include "vbo/vbo.h"
+#include "tnl/tnl.h"
+#include "tnl/t_pipeline.h"
+#include "swrast/swrast.h"
+#include "swrast_setup/swrast_setup.h"
+
 #include "ffb_dd.h"
 #include "ffb_span.h"
 #include "ffb_depth.h"
 #include "ffb_tris.h"
 #include "ffb_state.h"
 #include "ffb_lock.h"
-#include "extensions.h"
-#include "enums.h"
-
-#include "swrast/swrast.h"
-#include "array_cache/acache.h"
-#include "tnl/tnl.h"
-#include "swrast_setup/swrast_setup.h"
-
-#include "tnl/t_pipeline.h"
 
 #undef STATE_TRACE
 
@@ -266,7 +265,9 @@ static void ffbDDDepthMask(GLcontext *ctx, GLboolean flag)
        }
 }
 
-static void ffbDDStencilFunc(GLcontext *ctx, GLenum func, GLint ref, GLuint mask)
+static void
+ffbDDStencilFuncSeparate(GLcontext *ctx, GLenum face, GLenum func,
+                         GLint ref, GLuint mask)
 {
        ffbContextPtr fmesa = FFB_CONTEXT(ctx);
        unsigned int stencil, stencilctl, consty;
@@ -310,7 +311,8 @@ static void ffbDDStencilFunc(GLcontext *ctx, GLenum func, GLint ref, GLuint mask
        }
 }
 
-static void ffbDDStencilMask(GLcontext *ctx, GLuint mask)
+static void
+ffbDDStencilMaskSeparate(GLcontext *ctx, GLenum face, GLuint mask)
 {
        ffbContextPtr fmesa = FFB_CONTEXT(ctx);
 
@@ -321,7 +323,9 @@ static void ffbDDStencilMask(GLcontext *ctx, GLuint mask)
        }
 }
 
-static void ffbDDStencilOp(GLcontext *ctx, GLenum fail, GLenum zfail, GLenum zpass)
+static void
+ffbDDStencilOpSeparate(GLcontext *ctx, GLenum face, GLenum fail,
+                       GLenum zfail, GLenum zpass)
 {
        ffbContextPtr fmesa = FFB_CONTEXT(ctx);
        unsigned int stencilctl;
@@ -445,8 +449,6 @@ void ffbCalcViewport(GLcontext *ctx)
 static void ffbDDViewport(GLcontext *ctx, GLint x, GLint y,
                          GLsizei width, GLsizei height)
 {
-       /* update size of Mesa/software ancillary buffers */
-       _mesa_ResizeBuffersMESA();
        ffbCalcViewport(ctx);
 }
 
@@ -510,6 +512,13 @@ static void ffbDDReadBuffer(GLcontext *ctx, GLenum buffer)
 /*
  * Specifies buffer for sw fallbacks (spans)
  */
+#if 000
+/* XXX
+ * This function is obsolete.  It's not clear how this really effected
+ * span reading/writing above.  The span functions should use the
+ * incoming driRenderbuffer (gl_renderbuffer) pointer to determine how
+ * to read from the specified bufer.
+ */
 static void ffbDDSetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer,
                           GLuint bufferBit)
 {
@@ -522,14 +531,14 @@ static void ffbDDSetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer,
 #endif
        fbc &= ~(FFB_FBC_RB_MASK);
        switch (bufferBit) {
-       case DD_FRONT_LEFT_BIT:
+       case BUFFER_BIT_FRONT_LEFT:
                if (fmesa->back_buffer == 0)
                        fbc |= FFB_FBC_RB_B;
                else
                        fbc |= FFB_FBC_RB_A;
                break;
 
-       case DD_BACK_LEFT_BIT:
+       case BUFFER_BIT_BACK_LEFT:
                if (fmesa->back_buffer == 0)
                        fbc |= FFB_FBC_RB_A;
                else
@@ -546,6 +555,8 @@ static void ffbDDSetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer,
                FFB_MAKE_DIRTY(fmesa, FFB_STATE_FBC, 1);
        }
 }
+#endif
+
 
 static void ffbDDClearColor(GLcontext *ctx, const GLfloat color[4])
 {
@@ -592,6 +603,8 @@ static void ffbDDColorMask(GLcontext *ctx,
                new_pmask |= 0x0000ff00;
        if (b)
                new_pmask |= 0x00ff0000;
+       if (a)
+               new_pmask |= 0xff000000;
 
        if (fmesa->pmask != new_pmask) {
                fmesa->pmask = new_pmask;
@@ -849,12 +862,13 @@ static void ffbDDEnable(GLcontext *ctx, GLenum cap, GLboolean state)
 
                tmp = fmesa->fbc & ~FFB_FBC_YE_MASK;
                if (state) {
-                       ffbDDStencilFunc(ctx,
+                       ffbDDStencilFuncSeparate(ctx, GL_FRONT,
                                         ctx->Stencil.Function[0],
                                         ctx->Stencil.Ref[0],
                                         ctx->Stencil.ValueMask[0]);
-                       ffbDDStencilMask(ctx, ctx->Stencil.WriteMask[0]);
-                       ffbDDStencilOp(ctx,
+                       ffbDDStencilMaskSeparate(ctx, GL_FRONT,
+                                                 ctx->Stencil.WriteMask[0]);
+                       ffbDDStencilOpSeparate(ctx, GL_FRONT,
                                       ctx->Stencil.FailFunc[0],
                                       ctx->Stencil.ZFailFunc[0],
                                       ctx->Stencil.ZPassFunc[0]);
@@ -1020,7 +1034,7 @@ static void ffbDDUpdateState(GLcontext *ctx, GLuint newstate)
 
        _swrast_InvalidateState( ctx, newstate );
        _swsetup_InvalidateState( ctx, newstate );
-       _ac_InvalidateState( ctx, newstate );
+       _vbo_InvalidateState( ctx, newstate );
        _tnl_InvalidateState( ctx, newstate );
 
        if (newstate & _NEW_TEXTURE)
@@ -1073,9 +1087,9 @@ void ffbDDInitStateFuncs(GLcontext *ctx)
        ctx->Driver.DepthRange = ffbDDDepthRange;
 
        if (fmesa->ffb_sarea->flags & FFB_DRI_FFB2PLUS) {
-               ctx->Driver.StencilFunc = ffbDDStencilFunc;
-               ctx->Driver.StencilMask = ffbDDStencilMask;
-               ctx->Driver.StencilOp = ffbDDStencilOp;
+               ctx->Driver.StencilFuncSeparate = ffbDDStencilFuncSeparate;
+               ctx->Driver.StencilMaskSeparate = ffbDDStencilMaskSeparate;
+               ctx->Driver.StencilOpSeparate = ffbDDStencilOpSeparate;
        }
 
        ctx->Driver.DrawBuffer = ffbDDDrawBuffer;
@@ -1089,14 +1103,6 @@ void ffbDDInitStateFuncs(GLcontext *ctx)
        ctx->Driver.ClearIndex = 0;
        ctx->Driver.IndexMask = 0;
         */
-
-       {
-               struct swrast_device_driver *swdd = 
-                       _swrast_GetDeviceDriverReference(ctx);
-               swdd->SetBuffer = ffbDDSetBuffer;
-       }
-   
-
 }
 
 void ffbDDInitContextHwState(GLcontext *ctx)