+
+ 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];
+
+ color_sample_count = pass_att->samples;
+ }
+
+ if (subpass->depth_stencil_attachment) {
+ const uint32_t a =
+ subpass->depth_stencil_attachment->attachment;
+ struct radv_render_pass_attachment *pass_att =
+ &pass->attachments[a];
+ depth_sample_count = pass_att->samples;
+ }
+
+ subpass->max_sample_count = MAX2(color_sample_count,
+ depth_sample_count);
+
+ /* We have to handle resolve attachments specially */
+ subpass->has_resolve = false;
+ if (subpass->resolve_attachments) {
+ for (uint32_t j = 0; j < subpass->color_count; j++) {
+ struct radv_subpass_attachment *resolve_att =
+ &subpass->resolve_attachments[j];
+
+ if (resolve_att->attachment == VK_ATTACHMENT_UNUSED)
+ continue;
+
+ subpass->has_resolve = true;
+ }
+ }