[Mesa-dev] [PATCH] i965: fast clear depth only if depth equals to color buffer depth

Tapani Pälli tapani.palli at intel.com
Tue Oct 30 02:06:28 PDT 2012


Patch makes GLBenchmark 2.1.1 , An3DBenchXL and BasemarkES2 work with
Android on Ivybridge. In all failing cases color buffer is 16bit and
depth buffer 24bit. I did not find this kind of limitation from the
available HW specs though, bug does not happen with Sandybridge.

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
 src/mesa/drivers/dri/i965/brw_clear.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_clear.c b/src/mesa/drivers/dri/i965/brw_clear.c
index 53d8e54..cbaaf26 100644
--- a/src/mesa/drivers/dri/i965/brw_clear.c
+++ b/src/mesa/drivers/dri/i965/brw_clear.c
@@ -138,6 +138,14 @@ brw_fast_clear_depth(struct gl_context *ctx)
       return false;
    }
 
+   /* check that colorbuffer depth equals to depthbuffer depth on IVB */
+   if(intel->gen == 7) {
+      struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0];
+      if (_mesa_get_format_bytes(rb->Format) !=
+         _mesa_get_format_bytes(intel_rb_format(depth_irb)))
+         return false;
+   }
+
    uint32_t depth_clear_value;
    switch (mt->format) {
    case MESA_FORMAT_Z32_FLOAT_X24S8:
-- 
1.7.11.7



More information about the mesa-dev mailing list