summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIago Toral Quiroga <itoral@igalia.com>2020-03-31 12:56:16 +0200
committerMarge Bot <eric+marge@anholt.net>2020-10-13 21:21:29 +0000
commit152a64185b2a3e9b92478e22a164851e661c1c08 (patch)
treefb16b698f2c12d8de4fe6eb58a3f862d9a06aa24
parentc6dca4c5290db8391b68daabffd37ea35b82f7b5 (diff)
v3dv: improve asserts for VkPipelineColorBlendStateCreateInfo handling
According to the Vulkan 1.0 spec: "attachmentCount is the number of VkPipelineColorBlendAttachmentState elements in pAttachments. This value must equal the colorAttachmentCount for the subpass in which this pipeline is used." so let's assert exactly that. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
-rw-r--r--src/broadcom/vulkan/v3dv_pipeline.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/broadcom/vulkan/v3dv_pipeline.c b/src/broadcom/vulkan/v3dv_pipeline.c
index 653a0e9be4a..c0ce412340e 100644
--- a/src/broadcom/vulkan/v3dv_pipeline.c
+++ b/src/broadcom/vulkan/v3dv_pipeline.c
@@ -1577,14 +1577,14 @@ pack_blend(struct v3dv_pipeline *pipeline,
if (pipeline->subpass->color_count == 0)
return;
+ assert(pipeline->subpass->color_count == cb_info->attachmentCount);
+
pipeline->blend.needs_color_constants = false;
uint32_t color_write_masks = 0;
- for (uint32_t i = 0; i < cb_info->attachmentCount; i++) {
+ for (uint32_t i = 0; i < pipeline->subpass->color_count; i++) {
const VkPipelineColorBlendAttachmentState *b_state =
&cb_info->pAttachments[i];
- assert(i < pipeline->subpass->color_count);
-
uint32_t attachment_idx =
pipeline->subpass->color_attachments[i].attachment;
if (attachment_idx == VK_ATTACHMENT_UNUSED)