nvc0: restore viewport after blit
authorMaarten Lankhorst <maarten.lankhorst@canonical.com>
Mon, 2 Sep 2013 15:08:48 +0000 (17:08 +0200)
committerMaarten Lankhorst <maarten.lankhorst@canonical.com>
Mon, 2 Sep 2013 15:09:21 +0000 (17:09 +0200)
Based on calim's original fix in the nine branch.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
src/gallium/drivers/nvc0/nvc0_context.h
src/gallium/drivers/nvc0/nvc0_state_validate.c
src/gallium/drivers/nvc0/nvc0_surface.c

index a175f0acc9a85670fb17d43833f2e93ce1328bfd..0baf811f3d787e66beb8a55b350c570da6630eec 100644 (file)
@@ -198,6 +198,7 @@ struct nvc0_context {
    struct pipe_surface *surfaces[2][NVC0_MAX_SURFACE_SLOTS];
    uint16_t surfaces_dirty[2];
    uint16_t surfaces_valid[2];
+   uint32_t vport_int[2];
 
    struct util_dynarray global_residents;
 
index 4b50b43cf76c06ad1125f64935dff00d95a8ae03..2b55adeb0a87afe5b2e4ce1e6afeb7dd0e8daaa3 100644 (file)
@@ -245,9 +245,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);
index 606a2b577ff22fdabf3abdec8853b64aef106475..4ef1a4459148332aa434846850abb6a6ef5bbe44 100644 (file)
@@ -948,8 +948,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);
 }