<div dir="auto">R-b for the series</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 18, 2019, 10:27 AM Samuel Pitoiset <<a href="mailto:samuel.pitoiset@gmail.com">samuel.pitoiset@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Samuel Pitoiset <<a href="mailto:samuel.pitoiset@gmail.com" target="_blank" rel="noreferrer">samuel.pitoiset@gmail.com</a>><br>
---<br>
src/amd/vulkan/radv_meta_fast_clear.c | 35 +++++++++++++++------------<br>
1 file changed, 20 insertions(+), 15 deletions(-)<br>
<br>
diff --git a/src/amd/vulkan/radv_meta_fast_clear.c b/src/amd/vulkan/radv_meta_fast_clear.c<br>
index cb7b43d546c..12fea8292c0 100644<br>
--- a/src/amd/vulkan/radv_meta_fast_clear.c<br>
+++ b/src/amd/vulkan/radv_meta_fast_clear.c<br>
@@ -639,9 +639,18 @@ static void<br>
radv_process_color_image(struct radv_cmd_buffer *cmd_buffer,<br>
struct radv_image *image,<br>
const VkImageSubresourceRange *subresourceRange,<br>
- VkPipeline *pipeline)<br>
+ bool decompress_dcc)<br>
{<br>
struct radv_meta_saved_state saved_state;<br>
+ VkPipeline *pipeline;<br>
+<br>
+ if (decompress_dcc && radv_dcc_enabled(image, subresourceRange->baseMipLevel)) {<br>
+ pipeline = &cmd_buffer->device->meta_state.fast_clear_flush.dcc_decompress_pipeline;<br>
+ } else if (radv_image_has_fmask(image)) {<br>
+ pipeline = &cmd_buffer->device->meta_state.fast_clear_flush.fmask_decompress_pipeline;<br>
+ } else {<br>
+ pipeline = &cmd_buffer->device->meta_state.fast_clear_flush.cmask_eliminate_pipeline;<br>
+ }<br>
<br>
if (!*pipeline) {<br>
VkResult ret;<br>
@@ -661,11 +670,15 @@ radv_process_color_image(struct radv_cmd_buffer *cmd_buffer,<br>
VK_PIPELINE_BIND_POINT_GRAPHICS, *pipeline);<br>
<br>
for (uint32_t l = 0; l < radv_get_levelCount(image, subresourceRange); ++l) {<br>
- uint32_t width =<br>
- radv_minify(image->info.width,<br>
+ uint32_t width, height;<br>
+<br>
+ /* Do not decompress levels without DCC. */<br>
+ if (!radv_dcc_enabled(image, subresourceRange->baseMipLevel + l))<br>
+ continue;<br>
+<br>
+ width = radv_minify(image->info.width,<br>
subresourceRange->baseMipLevel + l);<br>
- uint32_t height =<br>
- radv_minify(image->info.height,<br>
+ height = radv_minify(image->info.height,<br>
subresourceRange->baseMipLevel + l);<br>
<br>
radv_CmdSetViewport(radv_cmd_buffer_to_handle(cmd_buffer), 0, 1,<br>
@@ -700,18 +713,9 @@ radv_emit_color_decompress(struct radv_cmd_buffer *cmd_buffer,<br>
bool decompress_dcc)<br>
{<br>
bool old_predicating = false;<br>
- VkPipeline *pipeline;<br>
<br>
assert(cmd_buffer->queue_family_index == RADV_QUEUE_GENERAL);<br>
<br>
- if (decompress_dcc && radv_dcc_enabled(image, subresourceRange->baseMipLevel)) {<br>
- pipeline = &cmd_buffer->device->meta_state.fast_clear_flush.dcc_decompress_pipeline;<br>
- } else if (radv_image_has_fmask(image)) {<br>
- pipeline = &cmd_buffer->device->meta_state.fast_clear_flush.fmask_decompress_pipeline;<br>
- } else {<br>
- pipeline = &cmd_buffer->device->meta_state.fast_clear_flush.cmask_eliminate_pipeline;<br>
- }<br>
-<br>
if (radv_dcc_enabled(image, subresourceRange->baseMipLevel)) {<br>
uint64_t pred_offset = decompress_dcc ? image->dcc_pred_offset :<br>
image->fce_pred_offset;<br>
@@ -723,7 +727,8 @@ radv_emit_color_decompress(struct radv_cmd_buffer *cmd_buffer,<br>
cmd_buffer->state.predicating = true;<br>
}<br>
<br>
- radv_process_color_image(cmd_buffer, image, subresourceRange, pipeline);<br>
+ radv_process_color_image(cmd_buffer, image, subresourceRange,<br>
+ decompress_dcc);<br>
<br>
if (radv_dcc_enabled(image, subresourceRange->baseMipLevel)) {<br>
uint64_t pred_offset = decompress_dcc ? image->dcc_pred_offset :<br>
-- <br>
2.22.0<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank" rel="noreferrer">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a></blockquote></div>