Hi,
I have a project which uses shared display lists and have now been
trying to get this to work with the Windows gdi driver in Mesa-7.0.1.
I have attached a patch which just hooks up wglShareLists with
_mesa_share_state, and adds a patch to (re)-initialise the context with
init_attrib_groups after the new shared context is selected.
I realise that this probably leaks some stuff in the ctx but I wasn't
sure which finalise routines I should and shouldn't be calling.
I happy to refine this patch, add some better cleaning up for the ctx
which is having it's Shared parameter replaced or to make it work with a
suitable example if you want these to happen before inclusion. Please
feel free to point me in the right direction.
Finally I am sorry that I have no familiarity with GIT yet, so the patch
is against 7.0.1, but I didn't see any updates there in the GIT patch
list that seemed to affect it. If you need this patch to be updated to
a more recent GIT version then also let me know.
Thanks,
Shane.
diff -c -r -x '*.o' -x '*.exe' -x lib Mesa-7.0.1/include/GL/wmesa.h Mesa-7.0.1-wglShareLists/include/GL/wmesa.h
*** Mesa-7.0.1/include/GL/wmesa.h Fri Jun 22 10:10:53 2007
--- Mesa-7.0.1-wglShareLists/include/GL/wmesa.h Wed Aug 22 11:56:10 2007
***************
*** 131,136 ****
--- 131,138 ----
extern void WMesaMove(void);
+ extern void WMesaShareLists(WMesaContext ctx_to_share, WMesaContext ctx);
+
#ifdef __cplusplus
}
diff -c -r -x '*.o' -x '*.exe' -x lib Mesa-7.0.1/src/mesa/drivers/windows/gdi/wgl.c Mesa-7.0.1-wglShareLists/src/mesa/drivers/windows/gdi/wgl.c
*** Mesa-7.0.1/src/mesa/drivers/windows/gdi/wgl.c Thu Aug 2 09:50:00 2007
--- Mesa-7.0.1-wglShareLists/src/mesa/drivers/windows/gdi/wgl.c Wed Aug 22 11:55:03 2007
***************
*** 601,608 ****
WINGDIAPI BOOL GLAPIENTRY wglShareLists(HGLRC hglrc1,
HGLRC hglrc2)
{
! (void) hglrc1; (void) hglrc2;
! return(TRUE);
}
--- 601,608 ----
WINGDIAPI BOOL GLAPIENTRY wglShareLists(HGLRC hglrc1,
HGLRC hglrc2)
{
! WMesaShareLists(hglrc1, hglrc2);
! return(TRUE);
}
diff -c -r -x '*.o' -x '*.exe' -x lib Mesa-7.0.1/src/mesa/drivers/windows/gdi/wmesa.c Mesa-7.0.1-wglShareLists/src/mesa/drivers/windows/gdi/wmesa.c
*** Mesa-7.0.1/src/mesa/drivers/windows/gdi/wmesa.c Thu Aug 2 09:50:00 2007
--- Mesa-7.0.1-wglShareLists/src/mesa/drivers/windows/gdi/wmesa.c Wed Aug 22 16:38:24 2007
***************
*** 1401,1406 ****
--- 1401,1411 ----
}
}
+ void WMesaShareLists(WMesaContext ctx_to_share, WMesaContext ctx)
+ {
+ _mesa_share_state(&ctx->gl_ctx, &ctx_to_share->gl_ctx);
+ }
+
/* This is hopefully a temporary hack to define some needed dispatch
* table entries. Hopefully, I'll find a better solution. The
* dispatch table generation scripts ought to be making these dummy
diff -c -r -x '*.o' -x '*.exe' -x lib Mesa-7.0.1/src/mesa/main/context.c Mesa-7.0.1-wglShareLists/src/mesa/main/context.c
*** Mesa-7.0.1/src/mesa/main/context.c Thu Aug 2 09:50:00 2007
--- Mesa-7.0.1-wglShareLists/src/mesa/main/context.c Wed Aug 22 11:53:44 2007
***************
*** 1562,1567 ****
--- 1562,1570 ----
}
ctx->Shared = ctxToShare->Shared;
ctx->Shared->RefCount++;
+
+ init_attrib_groups(ctx);
+
return GL_TRUE;
}
else {
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev