-/* $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
}
}
-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;
}
}
-static void ffbDDStencilMask(GLcontext *ctx, GLuint mask)
+static void
+ffbDDStencilMaskSeparate(GLcontext *ctx, GLenum face, GLuint mask)
{
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
}
}
-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;
static void ffbDDViewport(GLcontext *ctx, GLint x, GLint y,
GLsizei width, GLsizei height)
{
- /* update size of Mesa/software ancillary buffers */
- _mesa_ResizeBuffersMESA();
ffbCalcViewport(ctx);
}
/*
* 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)
{
#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
FFB_MAKE_DIRTY(fmesa, FFB_STATE_FBC, 1);
}
}
+#endif
+
static void ffbDDClearColor(GLcontext *ctx, const GLfloat color[4])
{
new_pmask |= 0x0000ff00;
if (b)
new_pmask |= 0x00ff0000;
+ if (a)
+ new_pmask |= 0xff000000;
if (fmesa->pmask != new_pmask) {
fmesa->pmask = new_pmask;
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]);
_swrast_InvalidateState( ctx, newstate );
_swsetup_InvalidateState( ctx, newstate );
- _ac_InvalidateState( ctx, newstate );
+ _vbo_InvalidateState( ctx, newstate );
_tnl_InvalidateState( ctx, newstate );
if (newstate & _NEW_TEXTURE)
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;
ctx->Driver.ClearIndex = 0;
ctx->Driver.IndexMask = 0;
*/
-
- {
- struct swrast_device_driver *swdd =
- _swrast_GetDeviceDriverReference(ctx);
- swdd->SetBuffer = ffbDDSetBuffer;
- }
-
-
}
void ffbDDInitContextHwState(GLcontext *ctx)