[Mesa-dev] [PATCH v3 10/16] anv/cmd_buffer: Always enable CCS_D in render passes
Nanley Chery
nanleychery at gmail.com
Wed Jun 28 21:14:43 UTC 2017
The lifespan of the fast-clear data will surpass the render pass scope.
We need CCS_D to be enabled in order to invalidate blocks previously
marked as cleared and to sample cleared data correctly.
v2: Avoid refactoring.
Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
---
src/intel/vulkan/anv_blorp.c | 5 ++++-
src/intel/vulkan/genX_cmd_buffer.c | 5 +----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c
index 84b01e8792..7ae07808bc 100644
--- a/src/intel/vulkan/anv_blorp.c
+++ b/src/intel/vulkan/anv_blorp.c
@@ -1608,8 +1608,11 @@ ccs_resolve_attachment(struct anv_cmd_buffer *cmd_buffer,
cmd_buffer->state.pending_pipe_bits |=
ANV_PIPE_RENDER_TARGET_CACHE_FLUSH_BIT | ANV_PIPE_CS_STALL_BIT;
+ const uint32_t aux_layers =
+ anv_image_aux_layers(image, iview->isl.base_level);
anv_ccs_resolve(cmd_buffer, att_state->color_rt_state, image,
- iview->isl.base_level, fb->layers, resolve_op);
+ iview->isl.base_level, MIN2(fb->layers, aux_layers),
+ resolve_op);
cmd_buffer->state.pending_pipe_bits |=
ANV_PIPE_RENDER_TARGET_CACHE_FLUSH_BIT | ANV_PIPE_CS_STALL_BIT;
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
index 4bd38d0310..49ad41edbd 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -329,7 +329,7 @@ color_attachment_compute_aux_usage(struct anv_device * device,
if (iview->image->aux_usage == ISL_AUX_USAGE_CCS_E) {
att_state->aux_usage = ISL_AUX_USAGE_CCS_E;
att_state->input_aux_usage = ISL_AUX_USAGE_CCS_E;
- } else if (att_state->fast_clear) {
+ } else {
att_state->aux_usage = ISL_AUX_USAGE_CCS_D;
/* From the Sky Lake PRM, RENDER_SURFACE_STATE::AuxiliarySurfaceMode:
*
@@ -346,9 +346,6 @@ color_attachment_compute_aux_usage(struct anv_device * device,
att_state->input_aux_usage = ISL_AUX_USAGE_CCS_D;
else
att_state->input_aux_usage = ISL_AUX_USAGE_NONE;
- } else {
- att_state->aux_usage = ISL_AUX_USAGE_NONE;
- att_state->input_aux_usage = ISL_AUX_USAGE_NONE;
}
}
--
2.13.1
More information about the mesa-dev
mailing list