Mesa (9.1): nvc0: restore viewport after blit
Maarten Lankhorst
mlankhorst at kemper.freedesktop.org
Thu Sep 5 10:24:48 UTC 2013
Module: Mesa
Branch: 9.1
Commit: 93670a73ff6e91cf16ffc265faaca0315dcd23a6
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=93670a73ff6e91cf16ffc265faaca0315dcd23a6
Author: Maarten Lankhorst <maarten.lankhorst at canonical.com>
Date: Mon Sep 2 17:08:48 2013 +0200
nvc0: restore viewport after blit
Based on calim's original fix in the nine branch.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at canonical.com>
Cc: "9.2 and 9.1" <mesa-stable at lists.freedesktop.org>
(cherry picked from commit ad4dc7723199b3052231f5b4aed1bd1ba1505025)
Conflicts:
src/gallium/drivers/nvc0/nvc0_context.h
---
src/gallium/drivers/nvc0/nvc0_context.h | 2 ++
src/gallium/drivers/nvc0/nvc0_state_validate.c | 6 ++++--
src/gallium/drivers/nvc0/nvc0_surface.c | 4 ++--
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/gallium/drivers/nvc0/nvc0_context.h b/src/gallium/drivers/nvc0/nvc0_context.h
index f5b0b6b..d2e7aed 100644
--- a/src/gallium/drivers/nvc0/nvc0_context.h
+++ b/src/gallium/drivers/nvc0/nvc0_context.h
@@ -169,6 +169,8 @@ struct nvc0_context {
struct nvc0_blitctx *blit;
+ uint32_t vport_int[2];
+
#ifdef NVC0_WITH_DRAW_MODULE
struct draw_context *draw;
#endif
diff --git a/src/gallium/drivers/nvc0/nvc0_state_validate.c b/src/gallium/drivers/nvc0/nvc0_state_validate.c
index 80a8c01..54aba25 100644
--- a/src/gallium/drivers/nvc0/nvc0_state_validate.c
+++ b/src/gallium/drivers/nvc0/nvc0_state_validate.c
@@ -243,9 +243,11 @@ nvc0_validate_viewport(struct nvc0_context *nvc0)
zmin = vp->translate[2] - fabsf(vp->scale[2]);
zmax = vp->translate[2] + fabsf(vp->scale[2]);
+ nvc0->vport_int[0] = (w << 16) | x;
+ nvc0->vport_int[1] = (h << 16) | y;
BEGIN_NVC0(push, NVC0_3D(VIEWPORT_HORIZ(0)), 2);
- PUSH_DATA (push, (w << 16) | x);
- PUSH_DATA (push, (h << 16) | y);
+ PUSH_DATA (push, nvc0->vport_int[0]);
+ PUSH_DATA (push, nvc0->vport_int[1]);
BEGIN_NVC0(push, NVC0_3D(DEPTH_RANGE_NEAR(0)), 2);
PUSH_DATAf(push, zmin);
PUSH_DATAf(push, zmax);
diff --git a/src/gallium/drivers/nvc0/nvc0_surface.c b/src/gallium/drivers/nvc0/nvc0_surface.c
index 66154a4..79b49b4 100644
--- a/src/gallium/drivers/nvc0/nvc0_surface.c
+++ b/src/gallium/drivers/nvc0/nvc0_surface.c
@@ -937,8 +937,8 @@ nvc0_blit_3d(struct nvc0_context *nvc0, const struct pipe_blit_info *info)
/* restore viewport */
BEGIN_NVC0(push, NVC0_3D(VIEWPORT_HORIZ(0)), 2);
- PUSH_DATA (push, nvc0->framebuffer.width << 16);
- PUSH_DATA (push, nvc0->framebuffer.height << 16);
+ PUSH_DATA (push, nvc0->vport_int[0]);
+ PUSH_DATA (push, nvc0->vport_int[1]);
IMMED_NVC0(push, NVC0_3D(VIEWPORT_TRANSFORM_EN), 1);
}
More information about the mesa-commit
mailing list