if (!layered) {
irb->layer_count = 1;
- } else if (image->TexObject->NumLayers > 0) {
+ } else if (mt->target != GL_TEXTURE_3D && image->TexObject->NumLayers > 0) {
irb->layer_count = image->TexObject->NumLayers;
} else {
irb->layer_count = mt->level[level].depth / layer_multiplier;
return mask;
}
+ if (ctx->Color.sRGBEnabled &&
+ _mesa_get_format_color_encoding(src_irb->mt->format) !=
+ _mesa_get_format_color_encoding(dst_irb->mt->format)) {
+ perf_debug("glBlitFramebuffer() with sRGB conversion cannot be "
+ "handled by BLT path.\n");
+ return mask;
+ }
+
if (!intel_miptree_blit(brw,
src_irb->mt,
src_irb->mt_level, src_irb->mt_layer,
return;
if (brw->gen >= 8 && (mask & GL_STENCIL_BUFFER_BIT)) {
- brw_meta_fbo_stencil_blit(brw_context(ctx), readFb, drawFb,
- srcX0, srcY0, srcX1, srcY1,
- dstX0, dstY0, dstX1, dstY1);
- mask &= ~GL_STENCIL_BUFFER_BIT;
- if (mask == 0x0)
- return;
+ assert(!"Invalid blit");
}
/* Try using the BLT engine. */
if (!_mesa_set_search(brw->render_cache, bo))
return;
- brw_emit_mi_flush(brw);
+ if (brw->gen >= 6) {
+ brw_emit_pipe_control_flush(brw,
+ PIPE_CONTROL_DEPTH_CACHE_FLUSH |
+ PIPE_CONTROL_RENDER_TARGET_FLUSH |
+ PIPE_CONTROL_CS_STALL);
+
+ brw_emit_pipe_control_flush(brw,
+ PIPE_CONTROL_TEXTURE_CACHE_INVALIDATE |
+ PIPE_CONTROL_CONST_CACHE_INVALIDATE);
+ } else {
+ brw_emit_mi_flush(brw);
+ }
+
+ brw_render_cache_set_clear(brw);
}
/**