summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/x11
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-09-23 01:20:09 +0000
committerBrian Paul <[email protected]>2005-09-23 01:20:09 +0000
commit0efc17c105f8239bf4fb128d570f2d343c45d430 (patch)
tree8ae8f47cecfb54ae1f13a93a81c5a76f37844ba2 /src/mesa/drivers/x11
parente5fce1694cdfca615022bf7b987835384902aceb (diff)
Add Wrapper field to gl_renderbuffer. Used for wrapping one renderbuffer
with another, such as wrapping a hardware/win-sys RGB renderbuffer with a software-based alpha buffer. Previous alpha buffer wrapping was conflicting with the X driver's xmesa_renderbuffer structure containment/inheritance. That lead to memory corruption.
Diffstat (limited to 'src/mesa/drivers/x11')
-rw-r--r--src/mesa/drivers/x11/xm_line.c2
-rw-r--r--src/mesa/drivers/x11/xm_tri.c5
2 files changed, 3 insertions, 4 deletions
diff --git a/src/mesa/drivers/x11/xm_line.c b/src/mesa/drivers/x11/xm_line.c
index 43de9a98ab7..6a045c85e6c 100644
--- a/src/mesa/drivers/x11/xm_line.c
+++ b/src/mesa/drivers/x11/xm_line.c
@@ -118,7 +118,7 @@ void xmesa_choose_point( GLcontext *ctx )
#define GET_XRB(XRB) struct xmesa_renderbuffer *XRB = \
- (struct xmesa_renderbuffer *) ctx->DrawBuffer->_ColorDrawBuffers[0][0]
+ (struct xmesa_renderbuffer *) ctx->DrawBuffer->_ColorDrawBuffers[0][0]->Wrapped
/*
diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c
index 9340ea49743..87989f46f89 100644
--- a/src/mesa/drivers/x11/xm_tri.c
+++ b/src/mesa/drivers/x11/xm_tri.c
@@ -45,7 +45,7 @@
#define GET_XRB(XRB) struct xmesa_renderbuffer *XRB = \
- (struct xmesa_renderbuffer *) ctx->DrawBuffer->_ColorDrawBuffers[0][0]
+ (struct xmesa_renderbuffer *) ctx->DrawBuffer->_ColorDrawBuffers[0][0]->Wrapped
/**********************************************************************/
@@ -1430,8 +1430,7 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx )
SWcontext *swrast = SWRAST_CONTEXT(ctx);
XMesaContext xmesa = XMESA_CONTEXT(ctx);
int depth = GET_VISUAL_DEPTH(xmesa->xm_visual);
- struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *)
- ctx->DrawBuffer->_ColorDrawBuffers[0][0];
+ GET_XRB(xrb);
#ifdef DEBUG
triFuncName = NULL;