From 67171ed85f3f9486238a994e8a427ddc1ac31069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Fonseca?= Date: Mon, 28 Dec 2009 16:25:48 +0000 Subject: xlib: Integrate the trace driver with all pipe drivers. And not just softpipe. It is particularly convenient to use llvmpipe instead, since it is much faster. It also allows to use rbug with all xlib drivers. --- src/gallium/state_trackers/glx/xlib/xm_api.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'src/gallium/state_trackers/glx/xlib') diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index c76dfb31d2..1783bc504d 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -67,6 +67,10 @@ #include "pipe/p_screen.h" #include "pipe/p_context.h" +#include "trace/tr_screen.h" +#include "trace/tr_context.h" +#include "trace/tr_texture.h" + #include "xm_winsys.h" #include @@ -87,6 +91,8 @@ void xmesa_set_driver( const struct xm_driver *templ ) */ pipe_mutex _xmesa_lock; +static struct pipe_screen *_screen = NULL; +static struct pipe_screen *screen = NULL; /**********************************************************************/ @@ -754,7 +760,7 @@ PUBLIC XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) { static GLboolean firstTime = GL_TRUE; - static struct pipe_screen *screen = NULL; + struct pipe_context *_pipe = NULL; struct pipe_context *pipe = NULL; XMesaContext c; GLcontext *mesaCtx; @@ -762,7 +768,8 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) if (firstTime) { pipe_mutex_init(_xmesa_lock); - screen = driver.create_pipe_screen(); + _screen = driver.create_pipe_screen(); + screen = trace_screen_create( _screen ); firstTime = GL_FALSE; } @@ -781,9 +788,11 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) if (screen == NULL) goto fail; - pipe = driver.create_pipe_context(screen, (void *) c); - if (pipe == NULL) + _pipe = driver.create_pipe_context(_screen, (void *) c); + if (_pipe == NULL) goto fail; + pipe = trace_context_create(screen, _pipe); + pipe->priv = c; c->st = st_create_context(pipe, &v->mesa_visual, @@ -1110,6 +1119,12 @@ void XMesaSwapBuffers( XMesaBuffer b ) st_swapbuffers(b->stfb, &frontLeftSurf, NULL); if (frontLeftSurf) { + if (_screen != screen) { + struct trace_surface *tr_surf = trace_surface( frontLeftSurf ); + struct pipe_surface *surf = tr_surf->surface; + frontLeftSurf = surf; + } + driver.display_surface(b, frontLeftSurf); } -- cgit v1.2.3