From 4cf56a418399c142335e0cab3fe3b8e54bfc703c Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 6 Nov 2007 10:19:27 -0700 Subject: [PATCH] implement context sharing code --- .../drivers/dri/intel_winsys/intel_context.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/mesa/drivers/dri/intel_winsys/intel_context.c b/src/mesa/drivers/dri/intel_winsys/intel_context.c index ed6448646a4..26420c848ae 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_context.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_context.c @@ -35,7 +35,7 @@ #include "intel_batchbuffer.h" #include "state_tracker/st_public.h" -#include "state_tracker/st_context.h" /* XXX temporary */ +#include "state_tracker/st_context.h" #include "pipe/p_defines.h" #include "pipe/p_context.h" @@ -75,18 +75,22 @@ static const struct dri_debug_control debug_control[] = { GLboolean -intelCreateContext(const __GLcontextModes * mesaVis, +intelCreateContext(const __GLcontextModes * visual, __DRIcontextPrivate * driContextPriv, void *sharedContextPrivate) { struct intel_context *intel = CALLOC_STRUCT(intel_context); - __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; struct intel_screen *intelScreen = intel_screen(sPriv); drmI830Sarea *saPriv = intelScreen->sarea; int fthrottle_mode; GLboolean havePools; struct pipe_context *pipe; + struct st_context *st_share = NULL; + + if (sharedContextPrivate) { + st_share = ((struct intel_context *) sharedContextPrivate)->st; + } driContextPriv->driverPrivate = intel; intel->intelScreen = intelScreen; @@ -144,15 +148,15 @@ intelCreateContext(const __GLcontextModes * mesaVis, pipe = intel_create_i915simple( intel ); break; default: - _mesa_printf("Unknown PCIID %x in %s, using software driver\n", - intel->intelScreen->deviceID, __FUNCTION__); + fprintf(stderr, "Unknown PCIID %x in %s, using software driver\n", + intel->intelScreen->deviceID, __FUNCTION__); pipe = intel_create_softpipe( intel ); break; } } - intel->st = st_create_context(pipe, mesaVis, NULL); + intel->st = st_create_context(pipe, visual, st_share); intel->st->ctx->DriverCtx = intel; /* hope to get rid of this... */ return GL_TRUE; -- 2.30.2