intel/gen6: Some framebuffers having separate depthstencil should be unsupported
authorChad Versace <chad.versace@linux.intel.com>
Thu, 19 Jan 2012 21:08:48 +0000 (13:08 -0800)
committerChad Versace <chad.versace@linux.intel.com>
Fri, 20 Jan 2012 18:37:19 +0000 (10:37 -0800)
When the framebuffer has separate depth and stencil buffers, and HiZ is
not enabled on the depth buffer, mark the framebuffer as unsupported. This
happens when trying to create a framebuffer with Z16/S8 because we haven't
enabled HiZ on Z16 yet.

Fixes gles2conform test stencil8.

Note: This is a candiate for the 8.0 branch.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44948
Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed--by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/drivers/dri/intel/intel_fbo.c

index c37075c6be9bc04f051b372a30535785bfb0347d..45a682727e45a7269c4f7f5777a587e683521715 100644 (file)
@@ -804,6 +804,15 @@ intel_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
            fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
         if (stencil_mt->format != MESA_FORMAT_S8)
            fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+        if (intel->gen < 7 && depth_mt->hiz_mt == NULL) {
+           /* Before Gen7, separate depth and stencil buffers can be used
+            * only if HiZ is enabled. From the Sandybridge PRM, Volume 2,
+            * Part 1, Bit 3DSTATE_DEPTH_BUFFER.SeparateStencilBufferEnable:
+            *     [DevSNB]: This field must be set to the same value (enabled
+            *     or disabled) as Hierarchical Depth Buffer Enable.
+            */
+           fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED;
+        }
       }
    }