Mesa (7.9): i965: always set tiling for fbo depth buffer on sandybridge

Ian Romanick idr at kemper.freedesktop.org
Thu Sep 30 20:29:17 UTC 2010


Module: Mesa
Branch: 7.9
Commit: 4af00f1a5e12b7e0b2c4024f2480247cb16f836b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4af00f1a5e12b7e0b2c4024f2480247cb16f836b

Author: Zhenyu Wang <zhenyuw at linux.intel.com>
Date:   Thu Sep 30 10:49:47 2010 +0800

i965: always set tiling for fbo depth buffer on sandybridge

Sandybridge requires depth buffer must be tiling.

Fix 'fbo_firecube' demo.
(cherry picked from commit 72b368ae69bc037681ab4e458296c07cb04349be)

---

 src/mesa/drivers/dri/intel/intel_fbo.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 363a5c0..d3f4464 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -102,7 +102,7 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
 {
    struct intel_context *intel = intel_context(ctx);
    struct intel_renderbuffer *irb = intel_renderbuffer(rb);
-   int cpp;
+   int cpp, tiling;
 
    ASSERT(rb->Name != 0);
 
@@ -176,7 +176,13 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
    /* alloc hardware renderbuffer */
    DBG("Allocating %d x %d Intel RBO\n", width, height);
 
-   irb->region = intel_region_alloc(intel->intelScreen, I915_TILING_NONE, cpp,
+   tiling = I915_TILING_NONE;
+
+   /* Gen6 requires depth must be tiling */
+   if (intel->gen >= 6 && rb->Format == MESA_FORMAT_S8_Z24)
+       tiling = I915_TILING_Y;
+
+   irb->region = intel_region_alloc(intel->intelScreen, tiling, cpp,
 				    width, height, GL_TRUE);
    if (!irb->region)
       return GL_FALSE;       /* out of memory? */




More information about the mesa-commit mailing list