1 |
From 666ffbbae591da56fecee04afa1240b044e636c2 Mon Sep 17 00:00:00 2001 |
2 |
From: Jason Ekstrand <jason.ekstrand@intel.com> |
3 |
Date: Fri, 4 Jan 2019 11:32:40 -0600 |
4 |
Subject: [PATCH 54/78] intel/blorp: Be more conservative about copying clear |
5 |
colors |
6 |
|
7 |
In 92eb5bbc68d7324 we attempted to avoid copying clear colors whenever |
8 |
we weren't doing a resolve. However, this broke MSAA resolves because |
9 |
we need the clear color in the source. This patch makes blorp much more |
10 |
conservative such that it only avoids the clear color copy if either |
11 |
aux_usage == NONE or it's explicitly doing a fast-clear. |
12 |
|
13 |
Fixes: 92eb5bbc68d7 "intel/blorp: Only copy clear color when doing..." |
14 |
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107728 |
15 |
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com> |
16 |
(cherry picked from commit 19c608fe43ae7e1578920326690a361ff1be9d88) |
17 |
--- |
18 |
src/intel/blorp/blorp_genX_exec.h | 9 ++++++--- |
19 |
1 file changed, 6 insertions(+), 3 deletions(-) |
20 |
|
21 |
diff --git a/src/intel/blorp/blorp_genX_exec.h b/src/intel/blorp/blorp_genX_exec.h |
22 |
index 065980616e..01bea99d3d 100644 |
23 |
--- a/src/intel/blorp/blorp_genX_exec.h |
24 |
+++ b/src/intel/blorp/blorp_genX_exec.h |
25 |
@@ -1326,7 +1326,7 @@ blorp_emit_memcpy(struct blorp_batch *batch, |
26 |
static void |
27 |
blorp_emit_surface_state(struct blorp_batch *batch, |
28 |
const struct brw_blorp_surface_info *surface, |
29 |
- enum isl_aux_op op, |
30 |
+ enum isl_aux_op aux_op, |
31 |
void *state, uint32_t state_offset, |
32 |
const bool color_write_disables[4], |
33 |
bool is_render_target) |
34 |
@@ -1382,7 +1382,7 @@ blorp_emit_surface_state(struct blorp_batch *batch, |
35 |
surface->aux_addr, *aux_addr); |
36 |
} |
37 |
|
38 |
- if (surface->clear_color_addr.buffer) { |
39 |
+ if (aux_usage != ISL_AUX_USAGE_NONE && surface->clear_color_addr.buffer) { |
40 |
#if GEN_GEN >= 10 |
41 |
assert((surface->clear_color_addr.offset & 0x3f) == 0); |
42 |
uint32_t *clear_addr = state + isl_dev->ss.clear_color_state_offset; |
43 |
@@ -1390,7 +1390,10 @@ blorp_emit_surface_state(struct blorp_batch *batch, |
44 |
isl_dev->ss.clear_color_state_offset, |
45 |
surface->clear_color_addr, *clear_addr); |
46 |
#elif GEN_GEN >= 7 |
47 |
- if (op == ISL_AUX_OP_FULL_RESOLVE || op == ISL_AUX_OP_PARTIAL_RESOLVE) { |
48 |
+ /* Fast clears just whack the AUX surface and don't actually use the |
49 |
+ * clear color for anything. We can avoid the MI memcpy on that case. |
50 |
+ */ |
51 |
+ if (aux_op != ISL_AUX_OP_FAST_CLEAR) { |
52 |
struct blorp_address dst_addr = blorp_get_surface_base_address(batch); |
53 |
dst_addr.offset += state_offset + isl_dev->ss.clear_value_offset; |
54 |
blorp_emit_memcpy(batch, dst_addr, surface->clear_color_addr, |
55 |
-- |
56 |
2.20.1 |
57 |
|