/* Gen7 doesn't support packed depth/stencil */
assert(stencil_mt == NULL || depth_mt != stencil_mt);
+ assert(!depth_mt || !_mesa_is_format_packed_depth_stencil(depth_mt->format));
intel_emit_depth_stall_flushes(intel);
return false;
}
- assert(irb->mt->format == MESA_FORMAT_S8_Z24);
+ assert(irb->mt->format == MESA_FORMAT_S8_Z24 ||
+ irb->mt->format == MESA_FORMAT_X8_Z24);
ok = intel_renderbuffer_update_wrapper(intel, depth_irb, irb->mt,
0, 0, /* level, layer */
MESA_FORMAT_X8_Z24,
intel_miptree_release(&mt);
return NULL;
}
+
+ /* Fix up the Z miptree format for how we're splitting out separate
+ * stencil. Gen7 expects there to be no stencil bits in its depth buffer.
+ */
+ if (mt->format == MESA_FORMAT_S8_Z24) {
+ mt->format = MESA_FORMAT_X8_Z24;
+ } else {
+ _mesa_problem("Unknown format %s in separate stencil\n",
+ _mesa_get_format_name(mt->format));
+ }
}
return mt;
GLuint level = intelImage->base.Base.Level;
int width, height, depth;
- if (image->TexFormat != mt->format)
+ if (image->TexFormat != mt->format &&
+ !(image->TexFormat == MESA_FORMAT_S8_Z24 &&
+ mt->format == MESA_FORMAT_X8_Z24 &&
+ mt->stencil_mt)) {
return false;
+ }
intel_miptree_get_dimensions_for_image(image, &width, &height, &depth);
* two miptrees for storing the data. If the depthstencil texture or rb is
* MESA_FORMAT_Z32_FLOAT_X24S8, then mt->format will be
* MESA_FORMAT_Z32_FLOAT, otherwise for MESA_FORMAT_S8_Z24 objects it will be
- * MESA_FORMAT_S8_Z24.
+ * MESA_FORMAT_X8_Z24.
*/
gl_format format;