summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2019-02-06 17:48:38 +0000
committerLionel Landwerlin <[email protected]>2019-02-08 00:18:16 +0000
commitf1bcb9be46898580c9928c3dc9078f9f3e0be67d (patch)
tree17e3d845e1a8c533dcb3eeacf96c93c98e4c13f9 /src/amd/vulkan
parenta934a3d1245d823650a18830bab2f6b7b4b4dbbe (diff)
radv: assert that colorAttachment is valid for CmdClearAttachment
This partially reverts a change from b7a93cbdede05a ("radv: Handle VK_ATTACHMENT_UNUSED in CmdClearAttachment") which fixed actual issues but also started to accept invalid values for the colorAttachment field. This change asserts that the field is valid for the current pass. Signed-off-by: Lionel Landwerlin <[email protected]> Fixes: b7a93cbdede05a ("radv: Handle VK_ATTACHMENT_UNUSED in CmdClearAttachment") Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan')
-rw-r--r--src/amd/vulkan/radv_meta_clear.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/amd/vulkan/radv_meta_clear.c b/src/amd/vulkan/radv_meta_clear.c
index 35da5fb1a6a..4f557092838 100644
--- a/src/amd/vulkan/radv_meta_clear.c
+++ b/src/amd/vulkan/radv_meta_clear.c
@@ -1522,9 +1522,7 @@ emit_clear(struct radv_cmd_buffer *cmd_buffer,
if (aspects & VK_IMAGE_ASPECT_COLOR_BIT) {
const uint32_t subpass_att = clear_att->colorAttachment;
- if (subpass_att == VK_ATTACHMENT_UNUSED)
- return;
-
+ assert(subpass_att < subpass->color_count);
const uint32_t pass_att = subpass->color_attachments[subpass_att].attachment;
if (pass_att == VK_ATTACHMENT_UNUSED)
return;