From aac367f48afc62176faf67aa6f329fbeae2004b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Fri, 11 May 2007 16:11:23 -0400 Subject: Remove screenConfigs from __DRIscreen. The screenConfigs field of __DRIscreen points back to the containing __GLXscreenConfigs struct. This is a serious abstraction violation; it assumes that the loader is libGL and that there *is* a __GLXscreenConfigs type in the loader. Using the containerOf macro, we can get from the __DRIscreen pointer to the containing __GLXscreenConfigs struct, at a place in the stack where the above is a valid assumption. Besides, the __DRI* structs shouldn't hold state other than the private pointer. --- src/mesa/drivers/dri/tdfx/tdfx_screen.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/mesa/drivers/dri/tdfx/tdfx_screen.c') diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c index 899963d06d..e9033c5ef3 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c @@ -75,7 +75,6 @@ tdfxCreateScreen( __DRIscreenPrivate *sPriv ) TDFXDRIPtr fxDRIPriv = (TDFXDRIPtr) sPriv->pDevPriv; PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension")); - void *const psc = sPriv->psc->screenConfigs; if (sPriv->devPrivSize != sizeof(TDFXDRIRec)) { fprintf(stderr,"\nERROR! sizeof(TDFXDRIRec) does not match passed size from device driver\n"); @@ -117,7 +116,7 @@ tdfxCreateScreen( __DRIscreenPrivate *sPriv ) } if (glx_enable_extension != NULL) { - (*glx_enable_extension)(psc, "GLX_SGI_make_current_read"); + (*glx_enable_extension)(sPriv->psc, "GLX_SGI_make_current_read"); } return GL_TRUE; -- cgit v1.2.3