Mesa (staging/18.2): anv: don't do partial resolve on layer > 0

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Dec 24 12:35:41 UTC 2018


Module: Mesa
Branch: staging/18.2
Commit: 6aa6e995977747153964a6aed125c2d74dd3a86f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6aa6e995977747153964a6aed125c2d74dd3a86f

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Mon Dec  3 18:40:10 2018 +0000

anv: don't do partial resolve on layer > 0

We've made the choice not to use fast clears on layer > 0 with
multilayer images. This is partly because we would need to store
multiple clear colors for each layer, making the existing memory
layout, already including aux surfaces, fast clear color, image state,
etc... even more complex.

Partial resolves are the operations transfering the clear colors into
the auxiliary buffers. This operation is currently implemented in
Blorp by loading the clear color from the image's BO, into a shader
that then samples from the auxiliary buffer and writes the color only
if it isn't there already.

The problem here is that because we store only one clear color for all
layers and it is used for partial resolves. If you trigger a partial
clear on a layer > 0, then you're likely to deal with a color that is
not what you actually want. In the particular issues below, we have
multiple layers, each cleared with a different color but the partial
resolve just writes the wrong color into the auxiliary buffers for
layers > 0.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108910
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108911
Cc: mesa-stable at lists.freedesktop.org
(cherry picked from commit e2ae5f2f0a0dbdae08e026b88e30552728c4abd6)

---

 src/intel/vulkan/genX_cmd_buffer.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
index adee409393..f75aca0f5c 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -1125,6 +1125,14 @@ transition_color_buffer(struct anv_cmd_buffer *cmd_buffer,
                                            level, array_layer, resolve_op,
                                            final_fast_clear);
          } else {
+            /* We only support fast-clear on the first layer so partial
+             * resolves should not be used on other layers as they will use
+             * the clear color stored in memory that is only valid for layer0.
+             */
+            if (resolve_op == ISL_AUX_OP_PARTIAL_RESOLVE &&
+                array_layer != 0)
+               continue;
+
             anv_cmd_predicated_mcs_resolve(cmd_buffer, image, aspect,
                                            array_layer, resolve_op,
                                            final_fast_clear);




More information about the mesa-commit mailing list