diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2006-12-07 11:03:48 +0100 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2006-12-07 11:03:48 +0100 |
commit | 7a10d66590a4cebd2b453218e75fe82b02a3edcc (patch) | |
tree | ee3be82f6f75cc4996ff84c959f14bb26e11e3bc /src/mesa | |
parent | 94136651c3442a1e8ad14d63dedeb296aefd89f1 (diff) |
i915tex: Recalculate viewport related hardware state in intelWindowMoved().
This fixes vertically displaced rendering with some apps like Google Earth.
Simplify other parts of the function somewhat.
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i915tex/intel_buffers.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i915tex/intel_buffers.c b/src/mesa/drivers/dri/i915tex/intel_buffers.c index a6b3298623..1ded0b5417 100644 --- a/src/mesa/drivers/dri/i915tex/intel_buffers.c +++ b/src/mesa/drivers/dri/i915tex/intel_buffers.c @@ -36,6 +36,7 @@ #include "intel_batchbuffer.h" #include "context.h" #include "utils.h" +#include "drirenderbuffer.h" #include "framebuffer.h" #include "swrast/swrast.h" #include "vblank.h" @@ -183,6 +184,8 @@ void intelWindowMoved(struct intel_context *intel) { GLcontext *ctx = &intel->ctx; + __DRIdrawablePrivate *dPriv = intel->driDrawable; + GLframebuffer *drawFb = (GLframebuffer *) dPriv->driverPrivate; if (!intel->ctx.DrawBuffer) { /* when would this happen? -BP */ @@ -194,7 +197,7 @@ intelWindowMoved(struct intel_context *intel) } else { /* drawing to a window */ - switch (intel->ctx.DrawBuffer->_ColorDrawBufferMask[0]) { + switch (drawFb->_ColorDrawBufferMask[0]) { case BUFFER_BIT_FRONT_LEFT: intelSetFrontClipRects(intel); break; @@ -207,14 +210,11 @@ intelWindowMoved(struct intel_context *intel) } } - /* this update Mesa's notion of window size */ - if (ctx->WinSysDrawBuffer) { - _mesa_resize_framebuffer(ctx, ctx->WinSysDrawBuffer, - intel->driDrawable->w, intel->driDrawable->h); - } + /* Update Mesa's notion of window size */ + driUpdateFramebufferSize(ctx, dPriv); + drawFb->Initialized = GL_TRUE; /* XXX remove someday */ - if (intel->intelScreen->driScrnPriv->ddxMinor >= 7 && intel->driDrawable) { - __DRIdrawablePrivate *dPriv = intel->driDrawable; + if (intel->intelScreen->driScrnPriv->ddxMinor >= 7) { drmI830Sarea *sarea = intel->sarea; drm_clip_rect_t drw_rect = { .x1 = dPriv->x, .x2 = dPriv->x + dPriv->w, .y1 = dPriv->y, .y2 = dPriv->y + dPriv->h }; @@ -245,6 +245,9 @@ intelWindowMoved(struct intel_context *intel) /* Update hardware scissor */ ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y, ctx->Scissor.Width, ctx->Scissor.Height); + + /* Re-calculate viewport related state */ + ctx->Driver.DepthRange( ctx, ctx->Viewport.Near, ctx->Viewport.Far ); } |