Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>tags/19.1-branchpoint
| @@ -81,12 +81,15 @@ radv_render_pass_compile(struct radv_render_pass *pass) | |||
| pass_att->last_subpass_idx = i; | |||
| } | |||
| subpass->has_color_att = false; | |||
| for (uint32_t j = 0; j < subpass->color_count; j++) { | |||
| struct radv_subpass_attachment *subpass_att = | |||
| &subpass->color_attachments[j]; | |||
| if (subpass_att->attachment == VK_ATTACHMENT_UNUSED) | |||
| continue; | |||
| subpass->has_color_att = true; | |||
| struct radv_render_pass_attachment *pass_att = | |||
| &pass->attachments[subpass_att->attachment]; | |||
| @@ -1375,15 +1375,7 @@ radv_pipeline_init_dynamic_state(struct radv_pipeline *pipeline, | |||
| * disabled or if the subpass of the render pass the pipeline is | |||
| * created against does not use any color attachments. | |||
| */ | |||
| bool uses_color_att = false; | |||
| for (unsigned i = 0; i < subpass->color_count; ++i) { | |||
| if (subpass->color_attachments[i].attachment != VK_ATTACHMENT_UNUSED) { | |||
| uses_color_att = true; | |||
| break; | |||
| } | |||
| } | |||
| if (uses_color_att && states & RADV_DYNAMIC_BLEND_CONSTANTS) { | |||
| if (subpass->has_color_att && states & RADV_DYNAMIC_BLEND_CONSTANTS) { | |||
| assert(pCreateInfo->pColorBlendState); | |||
| typed_memcpy(dynamic->blend_constants, | |||
| pCreateInfo->pColorBlendState->blendConstants, 4); | |||
| @@ -1828,6 +1828,9 @@ struct radv_subpass { | |||
| /** Subpass has at least one resolve attachment */ | |||
| bool has_resolve; | |||
| /** Subpass has at least one color attachment */ | |||
| bool has_color_att; | |||
| struct radv_subpass_barrier start_barrier; | |||
| uint32_t view_mask; | |||