1 |
From be8c1c89819dd223b15a2c45615e02cbc92e6f88 Mon Sep 17 00:00:00 2001 |
2 |
From: Lionel Landwerlin <lionel.g.landwerlin@intel.com> |
3 |
Date: Mon, 3 Dec 2018 18:40:10 +0000 |
4 |
Subject: [PATCH 42/78] anv: don't do partial resolve on layer > 0 |
5 |
|
6 |
We've made the choice not to use fast clears on layer > 0 with |
7 |
multilayer images. This is partly because we would need to store |
8 |
multiple clear colors for each layer, making the existing memory |
9 |
layout, already including aux surfaces, fast clear color, image state, |
10 |
etc... even more complex. |
11 |
|
12 |
Partial resolves are the operations transfering the clear colors into |
13 |
the auxiliary buffers. This operation is currently implemented in |
14 |
Blorp by loading the clear color from the image's BO, into a shader |
15 |
that then samples from the auxiliary buffer and writes the color only |
16 |
if it isn't there already. |
17 |
|
18 |
The problem here is that because we store only one clear color for all |
19 |
layers and it is used for partial resolves. If you trigger a partial |
20 |
clear on a layer > 0, then you're likely to deal with a color that is |
21 |
not what you actually want. In the particular issues below, we have |
22 |
multiple layers, each cleared with a different color but the partial |
23 |
resolve just writes the wrong color into the auxiliary buffers for |
24 |
layers > 0. |
25 |
|
26 |
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> |
27 |
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108910 |
28 |
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108911 |
29 |
Cc: mesa-stable@lists.freedesktop.org |
30 |
(cherry picked from commit e2ae5f2f0a0dbdae08e026b88e30552728c4abd6) |
31 |
--- |
32 |
src/intel/vulkan/genX_cmd_buffer.c | 8 ++++++++ |
33 |
1 file changed, 8 insertions(+) |
34 |
|
35 |
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c |
36 |
index eea699be8e..4f54533b37 100644 |
37 |
--- a/src/intel/vulkan/genX_cmd_buffer.c |
38 |
+++ b/src/intel/vulkan/genX_cmd_buffer.c |
39 |
@@ -1137,6 +1137,14 @@ transition_color_buffer(struct anv_cmd_buffer *cmd_buffer, |
40 |
level, array_layer, resolve_op, |
41 |
final_fast_clear); |
42 |
} else { |
43 |
+ /* We only support fast-clear on the first layer so partial |
44 |
+ * resolves should not be used on other layers as they will use |
45 |
+ * the clear color stored in memory that is only valid for layer0. |
46 |
+ */ |
47 |
+ if (resolve_op == ISL_AUX_OP_PARTIAL_RESOLVE && |
48 |
+ array_layer != 0) |
49 |
+ continue; |
50 |
+ |
51 |
anv_cmd_predicated_mcs_resolve(cmd_buffer, image, aspect, |
52 |
array_layer, resolve_op, |
53 |
final_fast_clear); |
54 |
-- |
55 |
2.20.1 |
56 |
|