i965g: add constant buffer setter
[mesa.git] / src / mesa / swrast / s_readpix.c
index f26304517075e2e3a90d711718e85fad2ce9f1cc..a1aeb2e01fbb8882685595e49f7a2287b11c5636 100644 (file)
@@ -555,26 +555,26 @@ _swrast_ReadPixels( GLcontext *ctx,
    SWcontext *swrast = SWRAST_CONTEXT(ctx);
    struct gl_pixelstore_attrib clippedPacking = *packing;
 
-   /* Need to do RENDER_START before clipping or anything else since this
-    * is where a driver may grab the hw lock and get an updated window
-    * size.
-    */
-   RENDER_START(swrast, ctx);
-
    if (ctx->NewState)
       _mesa_update_state(ctx);
 
+   /* Need to do swrast_render_start() before clipping or anything else
+    * since this is where a driver may grab the hw lock and get an updated
+    * window size.
+    */
+   swrast_render_start(ctx);
+
    if (swrast->NewState)
       _swrast_validate_derived( ctx );
 
    /* Do all needed clipping here, so that we can forget about it later */
    if (!_mesa_clip_readpixels(ctx, &x, &y, &width, &height, &clippedPacking)) {
       /* The ReadPixels region is totally outside the window bounds */
-      RENDER_FINISH(swrast, ctx);
+      swrast_render_finish(ctx);
       return;
    }
 
-   pixels = _mesa_map_readpix_pbo(ctx, &clippedPacking, pixels);
+   pixels = _mesa_map_pbo_dest(ctx, &clippedPacking, pixels);
    if (!pixels)
       return;
   
@@ -614,7 +614,7 @@ _swrast_ReadPixels( GLcontext *ctx,
          /* don't return yet, clean-up */
    }
 
-   RENDER_FINISH(swrast, ctx);
+   swrast_render_finish(ctx);
 
-   _mesa_unmap_readpix_pbo(ctx, &clippedPacking);
+   _mesa_unmap_pbo_dest(ctx, &clippedPacking);
 }