diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2005-09-23 01:20:09 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2005-09-23 01:20:09 +0000 |
commit | 0efc17c105f8239bf4fb128d570f2d343c45d430 (patch) | |
tree | 8ae8f47cecfb54ae1f13a93a81c5a76f37844ba2 /src/mesa/drivers | |
parent | e5fce1694cdfca615022bf7b987835384902aceb (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')
-rw-r--r-- | src/mesa/drivers/x11/xm_line.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/x11/xm_tri.c | 5 |
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 43de9a98ab..6a045c85e6 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 9340ea4974..87989f46f8 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; |