mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-23 12:40:29 +01:00
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.
This commit is contained in:
parent
94136651c3
commit
7a10d66590
1 changed files with 11 additions and 8 deletions
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue