[Bug 91433] piglit: fbo-depth copypixels GL_DEPTH_COMPONENT32F

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Jul 22 14:25:22 PDT 2015


https://bugs.freedesktop.org/show_bug.cgi?id=91433

--- Comment #1 from Chris Wilson <chris at chris-wilson.co.uk> ---
The right answer must be to fix the pixel transfer routines to do the copy
properly, but we can workaround the issue and ignore it for another day:

diff --git a/src/mesa/drivers/dri/i965/intel_pixel_copy.c
b/src/mesa/drivers/dri/i965/intel_pixel_copy.c
index 4313588..910f334 100644
--- a/src/mesa/drivers/dri/i965/intel_pixel_copy.c
+++ b/src/mesa/drivers/dri/i965/intel_pixel_copy.c
@@ -81,12 +81,38 @@ do_blit_copypixels(struct gl_context * ctx,
       read_irb =
         intel_renderbuffer(read_fb->Attachment[BUFFER_DEPTH].Renderbuffer);
       break;
+
+      /* We can only blit between separate depth/stencil buffers of identical
+       * pitches (so that W-tiling anomalies are hidden by identical swizzling
+       * on both sides).
+       */
    case GL_DEPTH:
-      perf_debug("glCopyPixels() fallback: GL_DEPTH\n");
-      return false;
+      draw_irb =
+         intel_renderbuffer(fb->Attachment[BUFFER_DEPTH].Renderbuffer);
+      read_irb =
+        intel_renderbuffer(read_fb->Attachment[BUFFER_DEPTH].Renderbuffer);
+      if (draw_irb->mt->format != MESA_FORMAT_Z_FLOAT32 ||
+          read_irb->mt->format != MESA_FORMAT_Z_FLOAT32) {
+         perf_debug("glCopyPixels() fallback: GL_DEPTH\n");
+         return false;
+      }
+      break;
    case GL_STENCIL:
-      perf_debug("glCopyPixels() fallback: GL_STENCIL\n");
-      return false;
+      draw_irb =
+         intel_renderbuffer(fb->Attachment[BUFFER_STENCIL].Renderbuffer);
+      read_irb =
+        intel_renderbuffer(read_fb->Attachment[BUFFER_STENCIL].Renderbuffer);
+      if (draw_irb->mt->format != MESA_FORMAT_S_UINT8 ||
+          read_irb->mt->format != MESA_FORMAT_S_UINT8) {
+         perf_debug("glCopyPixels() fallback: GL_STENCIL\n");
+         return false;
+      }
+      if (draw_irb->mt->stencil_mt || read_irb->mt->stencil_mt) {
+         /* Too much complexity for proof-of-principle */
+         perf_debug("glCopyPixels() fallback: GL_STENCIL\n");
+         return false;
+      }
+      break;
    default:
       perf_debug("glCopyPixels(): Unknown type\n");
       return false;
@@ -112,7 +138,7 @@ do_blit_copypixels(struct gl_context * ctx,
       return false;
    }

-   if (ctx->Depth.Test) {
+   if (ctx->Depth.Test && ctx->Depth.Func != GL_ALWAYS) {
       perf_debug("glCopyPixels(): Unsupported depth test state\n");
       return false;
    }

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20150722/56b45c0b/attachment.html>


More information about the intel-3d-bugs mailing list