diff options
Diffstat (limited to 'src/mesa/drivers/dri/i915tex/intel_context.c')
-rw-r--r-- | src/mesa/drivers/dri/i915tex/intel_context.c | 78 |
1 files changed, 25 insertions, 53 deletions
diff --git a/src/mesa/drivers/dri/i915tex/intel_context.c b/src/mesa/drivers/dri/i915tex/intel_context.c index 61842da29d9..5ab919ecb60 100644 --- a/src/mesa/drivers/dri/i915tex/intel_context.c +++ b/src/mesa/drivers/dri/i915tex/intel_context.c @@ -196,6 +196,7 @@ const struct dri_extension card_extensions[] = { #if 1 /* XXX FBO temporary? */ {"GL_EXT_packed_depth_stencil", NULL}, #endif + {"GL_EXT_pixel_buffer_object", NULL}, {"GL_EXT_secondary_color", GL_EXT_secondary_color_functions}, {"GL_EXT_stencil_wrap", NULL}, {"GL_EXT_texture_edge_clamp", NULL}, @@ -295,16 +296,14 @@ static void intelCheckFrontUpdate(GLcontext * ctx) { struct intel_context *intel = intel_context(ctx); + /* rely on _ColorDrawBufferMask being kept up to date by mesa + even for window-fbos. */ + /* not sure. Might need that for all masks including + BUFFER_BIT_FRONT_LEFT maybe? */ if (intel->ctx.DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT) { - intelScreenPrivate *screen = intel->intelScreen; __DRIdrawablePrivate *dPriv = intel->driDrawable; - if (screen->current_rotation != 0) { - intelRotateWindow(intel, dPriv, BUFFER_BIT_FRONT_LEFT); - } - else { - intelCopyBuffer(dPriv, NULL); - } + intelCopyBuffer(dPriv, NULL); } } @@ -377,7 +376,7 @@ intelInitContext(struct intel_context *intel, if (!havePools) return GL_FALSE; - + if (!_mesa_initialize_context(&intel->ctx, mesaVis, shareCtx, functions, (void *) intel)) @@ -388,10 +387,6 @@ intelInitContext(struct intel_context *intel, intel->driScreen = sPriv; intel->sarea = saPriv; - intel->width = intelScreen->width; - intel->height = intelScreen->height; - intel->current_rotation = intelScreen->current_rotation; - if (!lockMutexInit) { lockMutexInit = GL_TRUE; _glthread_INIT_MUTEX(lockMutex); @@ -576,6 +571,11 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv) GLboolean intelUnbindContext(__DRIcontextPrivate * driContextPriv) { + struct intel_context *intel = (struct intel_context *) driContextPriv->driverPrivate; + /* XXX UnbindContext is called AFTER the new context is made current. + Hopefully shouldn't be a problem ? */ + FLUSH_VERTICES((&intel->ctx), 0); + intelFlush(&intel->ctx); return GL_TRUE; } @@ -603,43 +603,14 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv, is done. Need a per-screen context? */ intel->intelScreen->dummyctxptr = intel; - /* XXX FBO temporary fix-ups! */ - /* if the renderbuffers don't have regions, init them from the context */ - { - struct intel_renderbuffer *irbDepth - = intel_get_renderbuffer(&intel_fb->Base, BUFFER_DEPTH); - struct intel_renderbuffer *irbStencil - = intel_get_renderbuffer(&intel_fb->Base, BUFFER_STENCIL); - - if (intel_fb->color_rb[0] && !intel_fb->color_rb[0]->region) { - intel_region_reference(&intel_fb->color_rb[0]->region, - intel->intelScreen->front_region); - } - if (intel_fb->color_rb[1] && !intel_fb->color_rb[1]->region) { - intel_region_reference(&intel_fb->color_rb[1]->region, - intel->intelScreen->back_region); - } - if (intel_fb->color_rb[2] && !intel_fb->color_rb[2]->region) { - intel_region_reference(&intel_fb->color_rb[2]->region, - intel->intelScreen->third_region); - } - if (irbDepth && !irbDepth->region) { - intel_region_reference(&irbDepth->region, intel->intelScreen->depth_region); - } - if (irbStencil && !irbStencil->region) { - intel_region_reference(&irbStencil->region, intel->intelScreen->depth_region); - } - } - - /* set GLframebuffer size to match window, if needed */ + /* update GLframebuffer size to match window if needed */ driUpdateFramebufferSize(&intel->ctx, driDrawPriv); if (driReadPriv != driDrawPriv) { - driUpdateFramebufferSize(&intel->ctx, driReadPriv); + driUpdateFramebufferSize(&intel->ctx, driReadPriv); } _mesa_make_current(&intel->ctx, &intel_fb->Base, readFb); - intel->intelScreen->dummyctxptr = &intel->ctx; /* The drawbuffer won't always be updated by _mesa_make_current: */ @@ -658,17 +629,21 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv, &intel_fb->vbl_seq); intel_fb->vbl_waited = intel_fb->vbl_seq; - for (i = 0; i < (intel->intelScreen->third.handle ? 3 : 2); i++) { + for (i = 0; i < 2; i++) { if (intel_fb->color_rb[i]) intel_fb->color_rb[i]->vbl_pending = intel_fb->vbl_seq; } } - intel->driDrawable = driDrawPriv; - intelWindowMoved(intel); } + } - intel_draw_buffer(&intel->ctx, &intel_fb->Base); + if ((intel->driDrawable != driDrawPriv) || + (intel->lastStamp != driDrawPriv->lastStamp)) { + intel->driDrawable = driDrawPriv; + intelWindowMoved(intel); + intel->lastStamp = driDrawPriv->lastStamp; } + } else { _mesa_make_current(NULL, NULL, NULL); @@ -696,12 +671,10 @@ intelContendedLock(struct intel_context *intel, GLuint flags) * checking must be done *after* this call: */ if (dPriv) - intel->revalidateDrawable = GL_TRUE; -// DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv); + DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv); if (sarea->width != intelScreen->width || - sarea->height != intelScreen->height || - sarea->rotation != intelScreen->current_rotation) { + sarea->height != intelScreen->height) { intelUpdateScreenRotation(sPriv, sarea); } @@ -743,8 +716,7 @@ intelContendedLock(struct intel_context *intel, GLuint flags) } - -/* Lock the hardware and validate our state. +/* Lock the hardware and validate our state. */ void LOCK_HARDWARE( struct intel_context *intel ) { |