/* Figure out any self-dependencies */
assert(desc->colorAttachmentCount <= 32);
- uint32_t color_self_deps = 0;
- bool has_depth_self_dep = false;
- bool has_stencil_self_dep = false;
for (uint32_t a = 0; a < desc->inputAttachmentCount; a++) {
if (desc->pInputAttachments[a].attachment == VK_ATTACHMENT_UNUSED)
continue;
VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT;
subpass->pipeline_flags |=
VK_PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT;
-
- color_self_deps |= (1u << c);
}
}
VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT;
subpass->pipeline_flags |=
VK_PIPELINE_CREATE_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT;
- has_depth_self_dep = true;
}
if (aspects & VK_IMAGE_ASPECT_STENCIL_BIT) {
subpass->input_attachments[a].stencil_layout =
VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT;
subpass->pipeline_flags |=
VK_PIPELINE_CREATE_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT;
- has_stencil_self_dep = true;
}
}
}
}
}
- subpass->self_dep_info = (VkRenderingSelfDependencyInfoMESA) {
- .sType = VK_STRUCTURE_TYPE_RENDERING_SELF_DEPENDENCY_INFO_MESA,
- .colorSelfDependencies = color_self_deps,
- .depthSelfDependency = has_depth_self_dep,
- .stencilSelfDependency = has_stencil_self_dep,
- };
-
subpass->sample_count_info_amd = (VkAttachmentSampleCountInfoAMD) {
.sType = VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD,
- .pNext = &subpass->self_dep_info,
+ .pNext = NULL,
.colorAttachmentCount = desc->colorAttachmentCount,
.pColorAttachmentSamples = color_samples,
.depthStencilAttachmentSamples = depth_stencil_samples,
.multisampledRenderToSingleSampledEnable = VK_TRUE,
.rasterizationSamples = mrtss->rasterizationSamples,
};
- subpass->self_dep_info.pNext = &subpass->mrtss;
}
}
assert(next_subpass_attachment ==
/* Append this one last because it lives in the subpass and we don't want
* to be changed by appending other structures later.
*/
- __vk_append_struct(&data->rendering, (void *)&subpass->self_dep_info);
+ if (subpass->mrtss.multisampledRenderToSingleSampledEnable)
+ __vk_append_struct(&data->rendering, (void *)&subpass->mrtss);
return &data->rendering;
}
/* Append this one last because it lives in the subpass and we don't want
* to be changed by appending other structures later.
*/
- __vk_append_struct(&rendering, (void *)&subpass->self_dep_info);
+ if (subpass->mrtss.multisampledRenderToSingleSampledEnable)
+ __vk_append_struct(&rendering, (void *)&subpass->mrtss);
disp->CmdBeginRendering(vk_command_buffer_to_handle(cmd_buffer),
&rendering);
#endif
/**
- * Pseudo-extension struct that may be chained into VkRenderingInfo,
- * VkCommandBufferInheritanceRenderingInfo, or VkPipelineRenderingCreateInfo
- * to provide self-dependency information.
- */
-typedef struct VkRenderingSelfDependencyInfoMESA {
- VkStructureType sType;
-#define VK_STRUCTURE_TYPE_RENDERING_SELF_DEPENDENCY_INFO_MESA (VkStructureType)1000044900
-#define VK_STRUCTURE_TYPE_RENDERING_SELF_DEPENDENCY_INFO_MESA_cast VkRenderingSelfDependencyInfoMESA
- const void* pNext;
-
- /** Bitset of which color attachments have self-dependencies */
- uint32_t colorSelfDependencies;
-
- /** True if there is a depth self-dependency */
- VkBool32 depthSelfDependency;
-
- /** True if there is a stencil self-dependency */
- VkBool32 stencilSelfDependency;
-} VkRenderingSelfDependencyInfoMESA;
-
-/**
* Pseudo-extension struct that may be chained into VkRenderingAttachmentInfo
* to indicate an initial layout for the attachment. This is only allowed if
* all of the following conditions are met:
/** Extra VkPipelineCreateFlags for this subpass */
VkPipelineCreateFlagBits pipeline_flags;
- /** VkRenderingSelfDependencyInfoMESA for this subpass
- *
- * This is in the pNext chain of pipeline_info and inheritance_info.
- */
- VkRenderingSelfDependencyInfoMESA self_dep_info;
-
/** VkAttachmentSampleCountInfoAMD for this subpass
*
* This is in the pNext chain of pipeline_info and inheritance_info.