summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_meta_clear.c
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2017-07-23 21:59:01 +0200
committerBas Nieuwenhuizen <[email protected]>2017-07-24 01:50:52 +0200
commitea08a296fe226f5e67366b4db420c2322f38774c (patch)
treea52007d0342ab27b86a54b565be7dd545b36a363 /src/amd/vulkan/radv_meta_clear.c
parentbfe8134472f90a1790ca37ed2aaad420efe5dff5 (diff)
radv: Handle VK_ATTACHMENT_UNUSED in color attachments.
This just sets them to INVALID COLOR, instead of shifting the attachments together. This also fixes a number of cases where we use it first and only then check if it is VK_ATTACHMENT_UNUSED. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Fixes: f4e499ec791 "radv: add initial non-conformant radv vulkan driver" Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_meta_clear.c')
-rw-r--r--src/amd/vulkan/radv_meta_clear.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/amd/vulkan/radv_meta_clear.c b/src/amd/vulkan/radv_meta_clear.c
index 353e8382ca1..e9021915343 100644
--- a/src/amd/vulkan/radv_meta_clear.c
+++ b/src/amd/vulkan/radv_meta_clear.c
@@ -1080,7 +1080,8 @@ subpass_needs_clear(const struct radv_cmd_buffer *cmd_buffer)
ds = cmd_state->subpass->depth_stencil_attachment.attachment;
for (uint32_t i = 0; i < cmd_state->subpass->color_count; ++i) {
uint32_t a = cmd_state->subpass->color_attachments[i].attachment;
- if (cmd_state->attachments[a].pending_clear_aspects) {
+ if (a != VK_ATTACHMENT_UNUSED &&
+ cmd_state->attachments[a].pending_clear_aspects) {
return true;
}
}
@@ -1120,7 +1121,8 @@ radv_cmd_buffer_clear_subpass(struct radv_cmd_buffer *cmd_buffer)
for (uint32_t i = 0; i < cmd_state->subpass->color_count; ++i) {
uint32_t a = cmd_state->subpass->color_attachments[i].attachment;
- if (!cmd_state->attachments[a].pending_clear_aspects)
+ if (a == VK_ATTACHMENT_UNUSED ||
+ !cmd_state->attachments[a].pending_clear_aspects)
continue;
assert(cmd_state->attachments[a].pending_clear_aspects ==