{
struct gl_context *ctx = &intel->ctx;
struct gl_framebuffer *fb = ctx->DrawBuffer;
- struct intel_renderbuffer *irbDepth = NULL, *irbStencil = NULL;
+ struct intel_renderbuffer *irbStencil = NULL;
bool fb_has_hiz = intel_framebuffer_has_hiz(fb);
if (!fb) {
return;
}
- /*
- * If intel_context is using separate stencil, but the depth attachment
- * (gl_framebuffer.Attachment[BUFFER_DEPTH]) has a packed depth/stencil
- * format, then we must install the real depth buffer at fb->_DepthBuffer
- * and set fb->_DepthBuffer->Wrapped before calling _mesa_update_framebuffer.
- * Otherwise, _mesa_update_framebuffer will create and install a swras
- * depth wrapper instead.
- *
- * Ditto for stencil.
- */
- irbDepth = intel_get_renderbuffer(fb, BUFFER_DEPTH);
- if (irbDepth && irbDepth->Base.Format == MESA_FORMAT_X8_Z24) {
- _mesa_reference_renderbuffer(&fb->_DepthBuffer, &irbDepth->Base);
- irbDepth->Base.Wrapped = fb->Attachment[BUFFER_DEPTH].Renderbuffer;
- }
-
irbStencil = intel_get_renderbuffer(fb, BUFFER_STENCIL);
- if (irbStencil && irbStencil->Base.Format == MESA_FORMAT_S8) {
- _mesa_reference_renderbuffer(&fb->_StencilBuffer, &irbStencil->Base);
- irbStencil->Base.Wrapped = fb->Attachment[BUFFER_STENCIL].Renderbuffer;
- }
/* Do this here, not core Mesa, since this function is called from
* many places within the driver.
if (!irb)
return;
- if (irb->wrapped_depth)
- intel_renderbuffer_map(intel, irb->wrapped_depth);
- if (irb->wrapped_stencil)
- intel_renderbuffer_map(intel, irb->wrapped_stencil);
+ if (rb->Data) {
+ /* Renderbuffer is already mapped. This usually happens when a single
+ * buffer is attached to the framebuffer's depth and stencil attachment
+ * points.
+ */
+ return;
+ }
ctx->Driver.MapRenderbuffer(ctx, rb, 0, 0, rb->Width, rb->Height,
GL_MAP_READ_BIT | GL_MAP_WRITE_BIT,
if (!irb)
return;
- if (irb->wrapped_depth)
- intel_renderbuffer_unmap(intel, irb->wrapped_depth);
- if (irb->wrapped_stencil)
- intel_renderbuffer_unmap(intel, irb->wrapped_stencil);
+ if (!rb->Data) {
+ /* Renderbuffer is already unmapped. This usually happens when a single
+ * buffer is attached to the framebuffer's depth and stencil attachment
+ * points.
+ */
+ return;
+ }
ctx->Driver.UnmapRenderbuffer(ctx, rb);