summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/x11/xm_dd.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2004-03-21 17:05:03 +0000
committerBrian Paul <[email protected]>2004-03-21 17:05:03 +0000
commit894844a8d956a0ee5f95836331dc318f49fdb845 (patch)
tree92aab765e7c82edf310ce1a5d3f1b25cfabc5156 /src/mesa/drivers/x11/xm_dd.c
parent009501642533c7378fc4f061f1abe2ed4473a3f6 (diff)
Implemented support for software-based AUX color buffers.
Only available with Xlib driver for now. Assorted clean-ups related to Draw/ReadBuffer(). Renamed FRONT_LEFT_BIT -> DD_FRONT_LEFT_BIT, etc.
Diffstat (limited to 'src/mesa/drivers/x11/xm_dd.c')
-rw-r--r--src/mesa/drivers/x11/xm_dd.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c
index 1178b71b74f..b58188e2003 100644
--- a/src/mesa/drivers/x11/xm_dd.c
+++ b/src/mesa/drivers/x11/xm_dd.c
@@ -41,6 +41,7 @@
#include "xmesaP.h"
#include "array_cache/acache.h"
#include "swrast/swrast.h"
+#include "swrast/s_auxbuffer.h"
#include "swrast/s_context.h"
#include "swrast/s_drawpix.h"
#include "swrast/s_alphabuf.h"
@@ -167,10 +168,11 @@ xmesa_set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit )
/*
* Now determine front vs back color buffer.
*/
- if (bufferBit == FRONT_LEFT_BIT) {
+ if (bufferBit == DD_FRONT_LEFT_BIT) {
target->buffer = target->frontbuffer;
+ xmesa_update_span_funcs(ctx);
}
- else if (bufferBit == BACK_LEFT_BIT) {
+ else if (bufferBit == DD_BACK_LEFT_BIT) {
ASSERT(target->db_state);
if (target->backpixmap) {
/* back buffer is a pixmap */
@@ -184,12 +186,15 @@ xmesa_set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit )
/* No back buffer!!!! Must be out of memory, use front buffer */
target->buffer = target->frontbuffer;
}
+ xmesa_update_span_funcs(ctx);
}
+ else if (bufferBit & (DD_AUX0_BIT | DD_AUX1_BIT | DD_AUX2_BIT | DD_AUX3_BIT)) {
+ _swrast_use_aux_buffer(ctx, buffer, bufferBit);
+ }
else {
_mesa_problem(ctx, "invalid buffer 0x%x in set_buffer() in xm_dd.c");
return;
}
- xmesa_update_span_funcs(ctx);
}
@@ -1105,7 +1110,9 @@ void xmesa_update_state( GLcontext *ctx, GLuint new_state )
break;
}
- xmesa_update_span_funcs(ctx);
+ if (ctx->Color._DrawDestMask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) {
+ xmesa_update_span_funcs(ctx);
+ }
}