st/mesa: use cso_set_viewport_dims() in try_pbo_upload_common()
authorBrian Paul <brianp@vmware.com>
Tue, 16 Feb 2016 00:27:15 +0000 (17:27 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 17 Feb 2016 18:25:02 +0000 (11:25 -0700)
Note that this results in a different transformation for the viewport's
Z axis (depth range), but that doesn't matter for this case.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/mesa/state_tracker/st_cb_texture.c

index a06cc72bdd2a24b5fa9b95cebff57b1056ef69aa..d09c3609a9e7b06b6c2c7ce13d8e67d14931e730 100644 (file)
@@ -1474,18 +1474,7 @@ try_pbo_upload_common(struct gl_context *ctx,
       pipe_surface_reference(&fb.cbufs[0], NULL);
    }
 
-   /* Viewport state */
-   {
-      struct pipe_viewport_state vp;
-      vp.scale[0] = 0.5f * surface->width;
-      vp.scale[1] = 0.5f * surface->height;
-      vp.scale[2] = 1.0f;
-      vp.translate[0] = 0.5f * surface->width;
-      vp.translate[1] = 0.5f * surface->height;
-      vp.translate[2] = 0.0f;
-
-      cso_set_viewport(cso, &vp);
-   }
+   cso_set_viewport_dims(cso, surface->width, surface->height, FALSE);
 
    /* Blend state */
    cso_set_blend(cso, &st->pbo_upload.blend);