summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i915
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-05-04 20:11:35 +0000
committerBrian Paul <[email protected]>2005-05-04 20:11:35 +0000
commite4b2356c07d31fbeeabb13b2fb47db703b473080 (patch)
treed8b7f1c7c9e7c84d84349485f942dd205dd4c16d /src/mesa/drivers/dri/i915
parentebef61f5c0950572f9c6a81b08f447957461675c (diff)
Major check-in of changes for GL_EXT_framebuffer_object extension.
Main driver impacts: - new code for creating the Mesa GLframebuffer - new span/pixel read/write code Some drivers not yet updated/tested.
Diffstat (limited to 'src/mesa/drivers/dri/i915')
-rw-r--r--src/mesa/drivers/dri/i915/i830_metaops.c6
-rw-r--r--src/mesa/drivers/dri/i915/i915_metaops.c6
-rw-r--r--src/mesa/drivers/dri/i915/intel_batchbuffer.c20
-rw-r--r--src/mesa/drivers/dri/i915/intel_context.c17
-rw-r--r--src/mesa/drivers/dri/i915/intel_ioctl.c26
-rw-r--r--src/mesa/drivers/dri/i915/intel_screen.c58
-rw-r--r--src/mesa/drivers/dri/i915/intel_span.c78
-rw-r--r--src/mesa/drivers/dri/i915/intel_span.h5
-rw-r--r--src/mesa/drivers/dri/i915/intel_state.c6
9 files changed, 176 insertions, 46 deletions
diff --git a/src/mesa/drivers/dri/i915/i830_metaops.c b/src/mesa/drivers/dri/i915/i830_metaops.c
index 751d8e75edf..dd238378b00 100644
--- a/src/mesa/drivers/dri/i915/i830_metaops.c
+++ b/src/mesa/drivers/dri/i915/i830_metaops.c
@@ -386,7 +386,7 @@ i830ClearWithTris(intelContextPtr intel, GLbitfield mask,
* The active cliprects will be applied as for any other geometry.
*/
- if(mask & DD_FRONT_LEFT_BIT) {
+ if(mask & BUFFER_BIT_FRONT_LEFT) {
set_no_depth_stencil_write( i830 );
set_color_mask( i830, GL_TRUE );
set_draw_offset( i830, screen->frontOffset );
@@ -396,7 +396,7 @@ i830ClearWithTris(intelContextPtr intel, GLbitfield mask,
0, 0, 0, 0);
}
- if(mask & DD_BACK_LEFT_BIT) {
+ if(mask & BUFFER_BIT_BACK_LEFT) {
set_no_depth_stencil_write( i830 );
set_color_mask( i830, GL_TRUE );
set_draw_offset( i830, screen->backOffset );
@@ -407,7 +407,7 @@ i830ClearWithTris(intelContextPtr intel, GLbitfield mask,
0, 0, 0, 0);
}
- if(mask & DD_STENCIL_BIT) {
+ if(mask & BUFFER_BIT_STENCIL) {
set_stencil_replace( i830,
intel->ctx.Stencil.WriteMask[0],
intel->ctx.Stencil.Clear);
diff --git a/src/mesa/drivers/dri/i915/i915_metaops.c b/src/mesa/drivers/dri/i915/i915_metaops.c
index 3176c727d04..2e9063edf0b 100644
--- a/src/mesa/drivers/dri/i915/i915_metaops.c
+++ b/src/mesa/drivers/dri/i915/i915_metaops.c
@@ -475,7 +475,7 @@ i915ClearWithTris(intelContextPtr intel, GLbitfield mask,
* The active cliprects will be applied as for any other geometry.
*/
- if (mask & DD_FRONT_LEFT_BIT) {
+ if (mask & BUFFER_BIT_FRONT_LEFT) {
set_no_depth_stencil_write( i915 );
set_color_mask( i915, GL_TRUE );
set_draw_offset( i915, screen->frontOffset );
@@ -486,7 +486,7 @@ i915ClearWithTris(intelContextPtr intel, GLbitfield mask,
0, 0, 0, 0);
}
- if(mask & DD_BACK_LEFT_BIT) {
+ if (mask & BUFFER_BIT_BACK_LEFT) {
set_no_depth_stencil_write( i915 );
set_color_mask( i915, GL_TRUE );
set_draw_offset( i915, screen->backOffset );
@@ -497,7 +497,7 @@ i915ClearWithTris(intelContextPtr intel, GLbitfield mask,
0, 0, 0, 0);
}
- if(mask & DD_STENCIL_BIT) {
+ if (mask & BUFFER_BIT_STENCIL) {
set_stencil_replace( i915,
intel->ctx.Stencil.WriteMask[0],
intel->ctx.Stencil.Clear);
diff --git a/src/mesa/drivers/dri/i915/intel_batchbuffer.c b/src/mesa/drivers/dri/i915/intel_batchbuffer.c
index 2062c9079ea..7c9ad87bed6 100644
--- a/src/mesa/drivers/dri/i915/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/i915/intel_batchbuffer.c
@@ -512,11 +512,11 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
clear_color = intel->ClearColor;
clear_depth = 0;
- if (flags & DD_DEPTH_BIT) {
+ if (flags & BUFFER_BIT_DEPTH) {
clear_depth = (GLuint)(ctx->Depth.Clear * intel->ClearDepth);
}
- if (flags & DD_STENCIL_BIT) {
+ if (flags & BUFFER_BIT_STENCIL) {
clear_depth |= (ctx->Stencil.Clear & 0xff) << 24;
}
@@ -531,8 +531,8 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
XY_COLOR_BLT_WRITE_ALPHA |
XY_COLOR_BLT_WRITE_RGB);
D_CMD = XY_COLOR_BLT_CMD;
- if (flags & DD_DEPTH_BIT) D_CMD |= XY_COLOR_BLT_WRITE_RGB;
- if (flags & DD_STENCIL_BIT) D_CMD |= XY_COLOR_BLT_WRITE_ALPHA;
+ if (flags & BUFFER_BIT_DEPTH) D_CMD |= XY_COLOR_BLT_WRITE_RGB;
+ if (flags & BUFFER_BIT_STENCIL) D_CMD |= XY_COLOR_BLT_WRITE_ALPHA;
break;
default:
BR13 = (0xF0 << 16) | (pitch * cpp) | (1<<24);
@@ -552,9 +552,9 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
if ( intel->sarea->pf_current_page == 1 ) {
GLuint tmp = flags;
- flags &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT);
- if ( tmp & DD_FRONT_LEFT_BIT ) flags |= DD_BACK_LEFT_BIT;
- if ( tmp & DD_BACK_LEFT_BIT ) flags |= DD_FRONT_LEFT_BIT;
+ flags &= ~(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT);
+ if ( tmp & BUFFER_BIT_FRONT_LEFT ) flags |= BUFFER_BIT_BACK_LEFT;
+ if ( tmp & BUFFER_BIT_BACK_LEFT ) flags |= BUFFER_BIT_FRONT_LEFT;
}
for (i = 0 ; i < intel->numClipRects ; i++)
@@ -590,7 +590,7 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
b.y2 > intelScreen->height)
continue;
- if ( flags & DD_FRONT_LEFT_BIT ) {
+ if ( flags & BUFFER_BIT_FRONT_LEFT ) {
BEGIN_BATCH( 6);
OUT_BATCH( CMD );
OUT_BATCH( BR13 );
@@ -601,7 +601,7 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
ADVANCE_BATCH();
}
- if ( flags & DD_BACK_LEFT_BIT ) {
+ if ( flags & BUFFER_BIT_BACK_LEFT ) {
BEGIN_BATCH( 6);
OUT_BATCH( CMD );
OUT_BATCH( BR13 );
@@ -612,7 +612,7 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
ADVANCE_BATCH();
}
- if ( flags & (DD_STENCIL_BIT | DD_DEPTH_BIT) ) {
+ if ( flags & (BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH) ) {
BEGIN_BATCH( 6);
OUT_BATCH( D_CMD );
OUT_BATCH( BR13 );
diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c
index 97e8933c21a..0dabfad5ffd 100644
--- a/src/mesa/drivers/dri/i915/intel_context.c
+++ b/src/mesa/drivers/dri/i915/intel_context.c
@@ -31,6 +31,7 @@
#include "matrix.h"
#include "simple_list.h"
#include "extensions.h"
+#include "framebuffer.h"
#include "imports.h"
#include "swrast/swrast.h"
@@ -235,7 +236,7 @@ void intelInitDriverFunctions( struct dd_function_table *functions )
functions->Clear = intelClear;
functions->Finish = intelFinish;
functions->GetBufferSize = intelBufferSize;
- functions->ResizeBuffers = _swrast_alloc_buffers;
+ functions->ResizeBuffers = _mesa_resize_framebuffer;
functions->GetString = intelGetString;
functions->UpdateState = intelInvalidateState;
functions->CopyColorTable = _swrast_CopyColorTable;
@@ -493,11 +494,11 @@ void intelSetBackClipRects( intelContextPtr intel )
void intelWindowMoved( intelContextPtr intel )
{
- switch (intel->ctx.Color._DrawDestMask[0]) {
- case DD_FRONT_LEFT_BIT:
+ switch (intel->ctx.DrawBuffer->_ColorDrawBufferMask[0]) {
+ case BUFFER_BIT_FRONT_LEFT:
intelSetFrontClipRects( intel );
break;
- case DD_BACK_LEFT_BIT:
+ case BUFFER_BIT_BACK_LEFT:
intelSetBackClipRects( intel );
break;
default:
@@ -525,11 +526,11 @@ GLboolean intelMakeCurrent(__DRIcontextPrivate *driContextPriv,
intelWindowMoved( intel );
}
- _mesa_make_current2(&intel->ctx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate);
+ _mesa_make_current(&intel->ctx,
+ (GLframebuffer *) driDrawPriv->driverPrivate,
+ (GLframebuffer *) driReadPriv->driverPrivate);
} else {
- _mesa_make_current(0,0);
+ _mesa_make_current(NULL, NULL, NULL);
}
return GL_TRUE;
diff --git a/src/mesa/drivers/dri/i915/intel_ioctl.c b/src/mesa/drivers/dri/i915/intel_ioctl.c
index 3662918dd84..9691627ebc3 100644
--- a/src/mesa/drivers/dri/i915/intel_ioctl.c
+++ b/src/mesa/drivers/dri/i915/intel_ioctl.c
@@ -348,41 +348,41 @@ void intelClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
*/
intelFlush( &intel->ctx );
- if (mask & DD_FRONT_LEFT_BIT) {
+ if (mask & BUFFER_BIT_FRONT_LEFT) {
if (colorMask == ~0) {
- blit_mask |= DD_FRONT_LEFT_BIT;
+ blit_mask |= BUFFER_BIT_FRONT_LEFT;
}
else {
- tri_mask |= DD_FRONT_LEFT_BIT;
+ tri_mask |= BUFFER_BIT_FRONT_LEFT;
}
}
- if (mask & DD_BACK_LEFT_BIT) {
+ if (mask & BUFFER_BIT_BACK_LEFT) {
if (colorMask == ~0) {
- blit_mask |= DD_BACK_LEFT_BIT;
+ blit_mask |= BUFFER_BIT_BACK_LEFT;
}
else {
- tri_mask |= DD_BACK_LEFT_BIT;
+ tri_mask |= BUFFER_BIT_BACK_LEFT;
}
}
- if (mask & DD_DEPTH_BIT) {
- blit_mask |= DD_DEPTH_BIT;
+ if (mask & BUFFER_BIT_DEPTH) {
+ blit_mask |= BUFFER_BIT_DEPTH;
}
- if (mask & DD_STENCIL_BIT) {
+ if (mask & BUFFER_BIT_STENCIL) {
if (!intel->hw_stencil) {
- swrast_mask |= DD_STENCIL_BIT;
+ swrast_mask |= BUFFER_BIT_STENCIL;
}
else if (ctx->Stencil.WriteMask[0] != 0xff) {
- tri_mask |= DD_STENCIL_BIT;
+ tri_mask |= BUFFER_BIT_STENCIL;
}
else {
- blit_mask |= DD_STENCIL_BIT;
+ blit_mask |= BUFFER_BIT_STENCIL;
}
}
- swrast_mask |= (mask & DD_ACCUM_BIT);
+ swrast_mask |= (mask & BUFFER_BIT_ACCUM);
if (blit_mask)
intelClearWithBlit( ctx, blit_mask, all, cx, cy, cw, ch );
diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c
index 82367184774..06caa1a6bea 100644
--- a/src/mesa/drivers/dri/i915/intel_screen.c
+++ b/src/mesa/drivers/dri/i915/intel_screen.c
@@ -27,7 +27,9 @@
#include "glheader.h"
#include "context.h"
+#include "framebuffer.h"
#include "matrix.h"
+#include "renderbuffer.h"
#include "simple_list.h"
#include "utils.h"
#include "xmlpool.h"
@@ -233,24 +235,78 @@ static void intelDestroyScreen(__DRIscreenPrivate *sPriv)
sPriv->private = NULL;
}
+
static GLboolean intelCreateBuffer( __DRIscreenPrivate *driScrnPriv,
__DRIdrawablePrivate *driDrawPriv,
const __GLcontextModes *mesaVis,
GLboolean isPixmap )
{
+ intelScreenPrivate *screen = (intelScreenPrivate *) driScrnPriv->private;
+
if (isPixmap) {
return GL_FALSE; /* not implemented */
} else {
GLboolean swStencil = (mesaVis->stencilBits > 0 &&
mesaVis->depthBits != 24);
+#if 0
driDrawPriv->driverPrivate = (void *)
_mesa_create_framebuffer(mesaVis,
GL_FALSE, /* software depth buffer? */
swStencil,
mesaVis->accumRedBits > 0,
GL_FALSE /* s/w alpha planes */);
-
+#else
+ struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
+
+ {
+ driRenderbuffer *frontRb
+ = driNewRenderbuffer(GL_RGBA, screen->cpp,
+ screen->frontOffset, screen->frontPitch);
+ intelSetSpanFunctions(frontRb, mesaVis);
+ _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
+ }
+
+ if (mesaVis->doubleBufferMode) {
+ driRenderbuffer *backRb
+ = driNewRenderbuffer(GL_RGBA, screen->cpp,
+ screen->backOffset, screen->backPitch);
+ intelSetSpanFunctions(backRb, mesaVis);
+ _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
+ }
+
+ if (mesaVis->depthBits == 16) {
+ driRenderbuffer *depthRb
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
+ screen->depthOffset, screen->depthPitch);
+ intelSetSpanFunctions(depthRb, mesaVis);
+ _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
+ }
+ else if (mesaVis->depthBits == 24) {
+ driRenderbuffer *depthRb
+ = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp,
+ screen->depthOffset, screen->depthPitch);
+ intelSetSpanFunctions(depthRb, mesaVis);
+ _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
+ }
+
+ if (mesaVis->stencilBits > 0 && !swStencil) {
+ driRenderbuffer *stencilRb
+ = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp,
+ screen->depthOffset, screen->depthPitch);
+ intelSetSpanFunctions(stencilRb, mesaVis);
+ _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
+ }
+
+ _mesa_add_soft_renderbuffers(fb,
+ GL_FALSE, /* color */
+ GL_FALSE, /* depth */
+ swStencil,
+ mesaVis->accumRedBits > 0,
+ GL_FALSE, /* alpha */
+ GL_FALSE /* aux */);
+ driDrawPriv->driverPrivate = (void *) fb;
+#endif
return (driDrawPriv->driverPrivate != NULL);
}
}
diff --git a/src/mesa/drivers/dri/i915/intel_span.c b/src/mesa/drivers/dri/i915/intel_span.c
index 494022b2957..7a051718aa2 100644
--- a/src/mesa/drivers/dri/i915/intel_span.c
+++ b/src/mesa/drivers/dri/i915/intel_span.c
@@ -247,10 +247,10 @@ static void intelSetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer,
GLuint bufferBit)
{
intelContextPtr intel = INTEL_CONTEXT(ctx);
- if (bufferBit == DD_FRONT_LEFT_BIT) {
+ if (bufferBit == BUFFER_BIT_FRONT_LEFT) {
intel->drawMap = (char *)intel->driScreen->pFB;
intel->readMap = (char *)intel->driScreen->pFB;
- } else if (bufferBit == DD_BACK_LEFT_BIT) {
+ } else if (bufferBit == BUFFER_BIT_BACK_LEFT) {
intel->drawMap = intel->intelScreen->back.map;
intel->readMap = intel->intelScreen->back.map;
} else {
@@ -288,6 +288,7 @@ void intelInitSpanFuncs( GLcontext *ctx )
switch (intelScreen->fbFormat) {
case DV_PF_555:
+#if 0
swdd->WriteRGBASpan = intelWriteRGBASpan_555;
swdd->WriteRGBSpan = intelWriteRGBSpan_555;
swdd->WriteMonoRGBASpan = intelWriteMonoRGBASpan_555;
@@ -295,14 +296,15 @@ void intelInitSpanFuncs( GLcontext *ctx )
swdd->WriteMonoRGBAPixels = intelWriteMonoRGBAPixels_555;
swdd->ReadRGBASpan = intelReadRGBASpan_555;
swdd->ReadRGBAPixels = intelReadRGBAPixels_555;
-
swdd->ReadDepthSpan = intelReadDepthSpan_16;
swdd->WriteDepthSpan = intelWriteDepthSpan_16;
swdd->ReadDepthPixels = intelReadDepthPixels_16;
swdd->WriteDepthPixels = intelWriteDepthPixels_16;
+#endif
break;
case DV_PF_565:
+#if 0
swdd->WriteRGBASpan = intelWriteRGBASpan_565;
swdd->WriteRGBSpan = intelWriteRGBSpan_565;
swdd->WriteMonoRGBASpan = intelWriteMonoRGBASpan_565;
@@ -310,14 +312,15 @@ void intelInitSpanFuncs( GLcontext *ctx )
swdd->WriteMonoRGBAPixels = intelWriteMonoRGBAPixels_565;
swdd->ReadRGBASpan = intelReadRGBASpan_565;
swdd->ReadRGBAPixels = intelReadRGBAPixels_565;
-
swdd->ReadDepthSpan = intelReadDepthSpan_16;
swdd->WriteDepthSpan = intelWriteDepthSpan_16;
swdd->ReadDepthPixels = intelReadDepthPixels_16;
swdd->WriteDepthPixels = intelWriteDepthPixels_16;
+#endif
break;
case DV_PF_8888:
+#if 0
swdd->WriteRGBASpan = intelWriteRGBASpan_8888;
swdd->WriteRGBSpan = intelWriteRGBSpan_8888;
swdd->WriteMonoRGBASpan = intelWriteMonoRGBASpan_8888;
@@ -325,7 +328,6 @@ void intelInitSpanFuncs( GLcontext *ctx )
swdd->WriteMonoRGBAPixels = intelWriteMonoRGBAPixels_8888;
swdd->ReadRGBASpan = intelReadRGBASpan_8888;
swdd->ReadRGBAPixels = intelReadRGBAPixels_8888;
-
swdd->ReadDepthSpan = intelReadDepthSpan_24_8;
swdd->WriteDepthSpan = intelWriteDepthSpan_24_8;
swdd->ReadDepthPixels = intelReadDepthPixels_24_8;
@@ -335,9 +337,75 @@ void intelInitSpanFuncs( GLcontext *ctx )
swdd->ReadStencilSpan = intelReadStencilSpan_24_8;
swdd->WriteStencilPixels = intelWriteStencilPixels_24_8;
swdd->ReadStencilPixels = intelReadStencilPixels_24_8;
+#endif
break;
}
swdd->SpanRenderStart = intelSpanRenderStart;
swdd->SpanRenderFinish = intelSpanRenderFinish;
}
+
+
+/**
+ * Plug in the Get/Put routines for the given driRenderbuffer.
+ */
+void
+intelSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
+{
+ if (drb->Base.InternalFormat == GL_RGBA) {
+ if (vis->redBits == 5 && vis->greenBits == 5 && vis->blueBits == 5) {
+ drb->Base.GetRow = intelReadRGBASpan_555;
+ drb->Base.GetValues = intelReadRGBAPixels_555;
+ drb->Base.PutRow = intelWriteRGBASpan_555;
+ drb->Base.PutRowRGB = intelWriteRGBSpan_555;
+ drb->Base.PutMonoRow = intelWriteMonoRGBASpan_555;
+ drb->Base.PutValues = intelWriteRGBAPixels_555;
+ drb->Base.PutMonoValues = intelWriteMonoRGBAPixels_555;
+ }
+ else if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
+ drb->Base.GetRow = intelReadRGBASpan_565;
+ drb->Base.GetValues = intelReadRGBAPixels_565;
+ drb->Base.PutRow = intelWriteRGBASpan_565;
+ drb->Base.PutRowRGB = intelWriteRGBSpan_565;
+ drb->Base.PutMonoRow = intelWriteMonoRGBASpan_565;
+ drb->Base.PutValues = intelWriteRGBAPixels_565;
+ drb->Base.PutMonoValues = intelWriteMonoRGBAPixels_565;
+ }
+ else {
+ assert(vis->redBits == 8);
+ assert(vis->greenBits == 8);
+ assert(vis->blueBits == 8);
+ drb->Base.GetRow = intelReadRGBASpan_8888;
+ drb->Base.GetValues = intelReadRGBAPixels_8888;
+ drb->Base.PutRow = intelWriteRGBASpan_8888;
+ drb->Base.PutRowRGB = intelWriteRGBSpan_8888;
+ drb->Base.PutMonoRow = intelWriteMonoRGBASpan_8888;
+ drb->Base.PutValues = intelWriteRGBAPixels_8888;
+ drb->Base.PutMonoValues = intelWriteMonoRGBAPixels_8888;
+ }
+ }
+ else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
+ drb->Base.GetRow = intelReadDepthSpan_16;
+ drb->Base.GetValues = intelReadDepthPixels_16;
+ drb->Base.PutRow = intelWriteDepthSpan_16;
+ drb->Base.PutMonoRow = intelWriteMonoDepthSpan_16;
+ drb->Base.PutValues = intelWriteDepthPixels_16;
+ drb->Base.PutMonoValues = NULL;
+ }
+ else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) {
+ drb->Base.GetRow = intelReadDepthSpan_24_8;
+ drb->Base.GetValues = intelReadDepthPixels_24_8;
+ drb->Base.PutRow = intelWriteDepthSpan_24_8;
+ drb->Base.PutMonoRow = intelWriteMonoDepthSpan_24_8;
+ drb->Base.PutValues = intelWriteDepthPixels_24_8;
+ drb->Base.PutMonoValues = NULL;
+ }
+ else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) {
+ drb->Base.GetRow = intelReadStencilSpan_24_8;
+ drb->Base.GetValues = intelReadStencilPixels_24_8;
+ drb->Base.PutRow = intelWriteStencilSpan_24_8;
+ drb->Base.PutMonoRow = intelWriteMonoStencilSpan_24_8;
+ drb->Base.PutValues = intelWriteStencilPixels_24_8;
+ drb->Base.PutMonoValues = NULL;
+ }
+}
diff --git a/src/mesa/drivers/dri/i915/intel_span.h b/src/mesa/drivers/dri/i915/intel_span.h
index 3ff710b9c47..2d4f8589d0f 100644
--- a/src/mesa/drivers/dri/i915/intel_span.h
+++ b/src/mesa/drivers/dri/i915/intel_span.h
@@ -28,9 +28,14 @@
#ifndef _INTEL_SPAN_H
#define _INTEL_SPAN_H
+#include "drirenderbuffer.h"
+
extern void intelInitSpanFuncs( GLcontext *ctx );
extern void intelSpanRenderFinish( GLcontext *ctx );
extern void intelSpanRenderStart( GLcontext *ctx );
+extern void
+intelSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis);
+
#endif
diff --git a/src/mesa/drivers/dri/i915/intel_state.c b/src/mesa/drivers/dri/i915/intel_state.c
index 76bfaec18f5..db6a140d2d5 100644
--- a/src/mesa/drivers/dri/i915/intel_state.c
+++ b/src/mesa/drivers/dri/i915/intel_state.c
@@ -170,12 +170,12 @@ static void intelDrawBuffer(GLcontext *ctx, GLenum mode )
intelScreenPrivate *screen = intel->intelScreen;
int front = 0;
- switch ( ctx->Color._DrawDestMask[0] ) {
- case DD_FRONT_LEFT_BIT:
+ switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) {
+ case BUFFER_BIT_FRONT_LEFT:
front = 1;
FALLBACK( intel, INTEL_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
- case DD_BACK_LEFT_BIT:
+ case BUFFER_BIT_BACK_LEFT:
front = 0;
FALLBACK( intel, INTEL_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;