fix assertion, z/stencil swarst readback, (still looks suspicious) copyTexSubimage
authorRoland Scheidegger <sroland@tungstengraphics.com>
Sat, 14 Jul 2007 12:24:20 +0000 (14:24 +0200)
committerRoland Scheidegger <sroland@tungstengraphics.com>
Sat, 14 Jul 2007 12:24:20 +0000 (14:24 +0200)
src/mesa/drivers/dri/common/drirenderbuffer.c
src/mesa/drivers/dri/i915tex/intel_pixel_read.c
src/mesa/drivers/dri/i915tex/intel_span.c
src/mesa/drivers/dri/i915tex/intel_tex_copy.c

index d36af3e5bee3667fff7901cce3fcf701c0a34d48..d4f7f2527bbd077f21f0ff830f51fe15cce41c85 100644 (file)
@@ -209,7 +209,11 @@ driUpdateFramebufferSize(GLcontext *ctx, const __DRIdrawablePrivate *dPriv)
    struct gl_framebuffer *fb = (struct gl_framebuffer *) dPriv->driverPrivate;
    if (fb && (dPriv->w != fb->Width || dPriv->h != fb->Height)) {
       ctx->Driver.ResizeBuffers(ctx, fb, dPriv->w, dPriv->h);
+#if 0
+      /* if the driver needs the hw lock for ResizeBuffers, the drawable
+         might have changed again by now */
       assert(fb->Width == dPriv->w);
       assert(fb->Height == dPriv->h);
+#endif
    }
 }
index 9481cb4800f532acd4691c8820d06e2f65c6fec9..c7bdb6bc855bfc56fa8d60d0bc6a07e0eeba0813 100644 (file)
@@ -183,7 +183,7 @@ do_blit_readpixels(GLcontext * ctx,
        */
       if (!_mesa_validate_pbo_access(2, pack, width, height, 1,
                                      format, type, pixels)) {
-         _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawPixels");
+         _mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels");
          return GL_TRUE;
       }
    }
index 368e0ec3c09fa1d1b922a9e9a2f64debccb14610..74f118121c1e8e329d806402d903eeaa58b1ccd7 100644 (file)
@@ -264,7 +264,7 @@ intel_map_unmap_buffers(struct intel_context *intel, GLboolean map)
    /* depth buffer (Note wrapper!) */
    if (ctx->DrawBuffer->_DepthBuffer) {
       irb = intel_renderbuffer(ctx->DrawBuffer->_DepthBuffer->Wrapped);
-      if (irb && irb->region && irb->Base.Name != 0) {
+      if (irb && irb->region) {
          if (map) {
             intel_region_map(intel->intelScreen, irb->region);
             irb->pfMap = irb->region->map;
@@ -281,7 +281,7 @@ intel_map_unmap_buffers(struct intel_context *intel, GLboolean map)
    /* stencil buffer (Note wrapper!) */
    if (ctx->DrawBuffer->_StencilBuffer) {
       irb = intel_renderbuffer(ctx->DrawBuffer->_StencilBuffer->Wrapped);
-      if (irb && irb->region && irb->Base.Name != 0) {
+      if (irb && irb->region) {
          if (map) {
             intel_region_map(intel->intelScreen, irb->region);
             irb->pfMap = irb->region->map;
index 90c2b9ebb511c78061e3558dcce117b53184952b..8d7f8f9d91b1b01ca3eca72cc4faadc09b617787 100644 (file)
@@ -118,9 +118,11 @@ do_copy_texsubimage(struct intel_context *intel,
          dstx += x - orig_x;
          dsty += y - orig_y;
 
-         /* invert Y */
-         y = ctx->ReadBuffer->Height - y - 1;
-
+         if (!(ctx->ReadBuffer->Name == 0)) {
+           /* XXX this looks bogus ? */
+           /* FBO: invert Y */
+           y = ctx->ReadBuffer->Height - y - 1;
+         }
 
          /* A bit of fiddling to get the blitter to work with -ve
           * pitches.  But we get a nice inverted blit this way, so it's