float dst_x1, float dst_y1,
bool mirror_x, bool mirror_y)
{
+ /* Get ready to blit. This includes depth resolving the src and dst
+ * buffers if necessary. Note: it's not necessary to do a color resolve on
+ * the destination buffer because we use the standard render path to render
+ * to destination color buffers, and the standard render path is
+ * fast-color-aware.
+ */
+ intel_miptree_resolve_color(intel, src_mt);
intel_miptree_slice_resolve_depth(intel, src_mt, src_level, src_layer);
intel_miptree_slice_resolve_depth(intel, dst_mt, dst_level, dst_layer);
brw_blorp_resolve_color(struct intel_context *intel, struct intel_mipmap_tree *mt)
{
struct brw_context *brw = brw_context(&intel->ctx);
+
brw_blorp_rt_resolve_params params(brw, mt);
brw_blorp_exec(intel, ¶ms);
mt->mcs_state = INTEL_MCS_STATE_RESOLVED;
#include "swrast_setup/swrast_setup.h"
#include "drivers/common/meta.h"
+#include "brw_blorp.h"
#include "brw_draw.h"
#include "brw_defines.h"
#include "brw_context.h"
if (depth_irb)
intel_renderbuffer_resolve_hiz(intel, depth_irb);
- /* Resolve depth buffer of each enabled depth texture. */
+ /* Resolve depth buffer of each enabled depth texture, and color buffer of
+ * each fast-clear-enabled color texture.
+ */
for (int i = 0; i < BRW_MAX_TEX_UNIT; i++) {
if (!ctx->Texture.Unit[i]._ReallyEnabled)
continue;
if (!tex_obj || !tex_obj->mt)
continue;
intel_miptree_all_slices_resolve_depth(intel, tex_obj->mt);
+ intel_miptree_resolve_color(intel, tex_obj->mt);
}
}
return false;
}
- /* The blitter has no idea about HiZ, so we need to get the real depth
- * data into the two miptrees before we do anything.
+ /* The blitter has no idea about HiZ or fast color clears, so we need to
+ * resolve the miptrees before we do anything.
*/
intel_miptree_slice_resolve_depth(intel, src_mt, src_level, src_slice);
intel_miptree_slice_resolve_depth(intel, dst_mt, dst_level, dst_slice);
+ intel_miptree_resolve_color(intel, src_mt);
+ intel_miptree_resolve_color(intel, dst_mt);
if (src_flip)
src_y = src_mt->level[src_level].height - src_y - height;
GLbitfield fail_mask = 0;
BATCH_LOCALS;
+ /* Note: we don't use this function on Gen7+ hardware, so we can safely
+ * ignore fast color clear issues.
+ */
+ assert(intel->gen < 7);
+
/*
* Compute values for clearing the buffers.
*/
void *
intel_miptree_map_raw(struct intel_context *intel, struct intel_mipmap_tree *mt)
{
+ /* CPU accesses to color buffers don't understand fast color clears, so
+ * resolve any pending fast color clears before we map.
+ */
+ intel_miptree_resolve_color(intel, mt);
+
drm_intel_bo *bo = mt->region->bo;
if (unlikely(INTEL_DEBUG & DEBUG_PERF)) {
#define DY 32
#define DX 32
+ /* The blitter has no idea about fast color clears, so we need to resolve
+ * the miptree before we do anything.
+ */
+ intel_miptree_resolve_color(intel, irb->mt);
+
/* Chop it all into chunks that can be digested by hardware: */
for (py = 0; py < height; py += DY) {
for (px = 0; px < width; px += DX) {
return false;
}
+ /* Since we are going to write raw data to the miptree, we need to resolve
+ * any pending fast color clears before we start.
+ */
+ intel_miptree_resolve_color(intel, image->mt);
+
bo = image->mt->region->bo;
if (drm_intel_bo_references(intel->batch.bo, bo)) {