Index: /trunk/src/VBox/Additions/3D/mesa/mesa-17.3.9/src/gallium/drivers/svga/svga_pipe_blit.c
===================================================================
--- /trunk/src/VBox/Additions/3D/mesa/mesa-17.3.9/src/gallium/drivers/svga/svga_pipe_blit.c	(revision 79767)
+++ /trunk/src/VBox/Additions/3D/mesa/mesa-17.3.9/src/gallium/drivers/svga/svga_pipe_blit.c	(revision 79768)
@@ -609,18 +609,4 @@
    svga_toggle_render_condition(svga, blit.render_condition_enable, FALSE);
 
-#ifdef VBOX_WITH_MESA3D_SVGA_HALFZ
-   if (svga->curr.rast && svga->curr.rast->templ.clip_halfz)
-   {
-       /* Flip Y because the state tracker uses D3D texture coords:
-        * top,left=0,0; bottom,right = 1,1.
-        * While the blit draws a quad using the source as texture and sets
-        * texcoords for destination vertices using OpenGL coordinates:
-        * bottom,left = 0,0; top,right = 1,1.
-        */
-       blit.dst.box.y = dst->height0 - blit.dst.box.y;
-       blit.dst.box.height = -blit.dst.box.height;
-   }
-#endif
-
    util_blitter_blit(svga->blitter, &blit);
 
Index: /trunk/src/VBox/Additions/3D/mesa/mesa-17.3.9/src/gallium/state_trackers/nine/nine_state.c
===================================================================
--- /trunk/src/VBox/Additions/3D/mesa/mesa-17.3.9/src/gallium/state_trackers/nine/nine_state.c	(revision 79767)
+++ /trunk/src/VBox/Additions/3D/mesa/mesa-17.3.9/src/gallium/state_trackers/nine/nine_state.c	(revision 79768)
@@ -2684,5 +2684,24 @@
     (void) src;
 
+#ifdef VBOX_WITH_MESA3D_NINE_SVGA
+    /* Flip Y because the state tracker uses D3D texture coords:
+     * top,left=0,0; bottom,right = 1,1.
+     * While the blit draws a quad using the source as texture and sets
+     * texcoords for destination vertices using OpenGL coordinates:
+     * bottom,left = 0,0; top,right = 1,1.
+     */
+    {
+        struct pipe_blit_info b = *blit;
+
+        b.dst.box.y = b.dst.resource->height0 - b.dst.box.y - b.dst.box.height;
+
+        b.src.box.y = b.src.resource->height0 - b.src.box.y;
+        b.src.box.height = -b.src.box.height;
+
+        context->pipe->blit(context->pipe, &b);
+    }
+#else
     context->pipe->blit(context->pipe, blit);
+#endif
 }
 
@@ -2701,4 +2720,14 @@
     d3dcolor_to_pipe_color_union(&rgba, color);
     surf = NineSurface9_GetSurface(surface, 0);
+#ifdef VBOX_WITH_MESA3D_NINE_SVGA
+    /* Flip Y because the nine state tracker uses D3D coords:
+     * top,left=0,0; bottom,right = 1,1.
+     * While the clear_render_target draws a quad sets texcoords
+     * for destination vertices using OpenGL coordinates:
+     * bottom,left = 0,0; top,right = 1,1.
+     */
+    /** @todo Figure out how to avoid such mismatches in a generic way. */
+    y = surf->height - y - height;
+#endif
     context->pipe->clear_render_target(context->pipe, surf, &rgba, x, y, width, height, false);
 }
