vulkan: Plumb rendering flags through vk_graphics_pipeline_state
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Connor Abbott <cwabbott0@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22191>
This commit is contained in:
committed by
Marge Bot
parent
f4b534d50f
commit
f3876db1ee
@@ -976,17 +976,34 @@ vk_render_pass_state_init(struct vk_render_pass_state *rp,
|
|||||||
const struct vk_subpass_info *sp_info,
|
const struct vk_subpass_info *sp_info,
|
||||||
VkGraphicsPipelineLibraryFlagsEXT lib)
|
VkGraphicsPipelineLibraryFlagsEXT lib)
|
||||||
{
|
{
|
||||||
|
VkPipelineCreateFlags valid_pipeline_flags = 0;
|
||||||
|
if (lib & VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT) {
|
||||||
|
valid_pipeline_flags |=
|
||||||
|
VK_PIPELINE_CREATE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR |
|
||||||
|
VK_PIPELINE_CREATE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT;
|
||||||
|
}
|
||||||
|
if (lib & VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT) {
|
||||||
|
valid_pipeline_flags |=
|
||||||
|
VK_PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT |
|
||||||
|
VK_PIPELINE_CREATE_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT;
|
||||||
|
}
|
||||||
|
const VkPipelineCreateFlags pipeline_flags =
|
||||||
|
vk_get_pipeline_rendering_flags(info) & valid_pipeline_flags;
|
||||||
|
|
||||||
/* If we already have render pass state and it has attachment info, then
|
/* If we already have render pass state and it has attachment info, then
|
||||||
* it's complete and we don't need a new one.
|
* it's complete and we don't need a new one. The one caveat here is that
|
||||||
|
* we may need to add in some rendering flags.
|
||||||
*/
|
*/
|
||||||
if (old_rp != NULL && vk_render_pass_state_is_complete(old_rp)) {
|
if (old_rp != NULL && vk_render_pass_state_is_complete(old_rp)) {
|
||||||
*rp = *old_rp;
|
*rp = *old_rp;
|
||||||
|
rp->pipeline_flags |= pipeline_flags;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
*rp = (struct vk_render_pass_state) {
|
*rp = (struct vk_render_pass_state) {
|
||||||
.render_pass = info->renderPass,
|
.render_pass = info->renderPass,
|
||||||
.subpass = info->subpass,
|
.subpass = info->subpass,
|
||||||
|
.pipeline_flags = pipeline_flags,
|
||||||
.depth_attachment_format = VK_FORMAT_UNDEFINED,
|
.depth_attachment_format = VK_FORMAT_UNDEFINED,
|
||||||
.stencil_attachment_format = VK_FORMAT_UNDEFINED,
|
.stencil_attachment_format = VK_FORMAT_UNDEFINED,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -650,6 +650,13 @@ struct vk_render_pass_state {
|
|||||||
/** VkPipelineRenderingCreateInfo::viewMask */
|
/** VkPipelineRenderingCreateInfo::viewMask */
|
||||||
uint32_t view_mask;
|
uint32_t view_mask;
|
||||||
|
|
||||||
|
/** Render pass flags from VkGraphicsPipelineCreateInfo::flags
|
||||||
|
*
|
||||||
|
* For drivers which use vk_render_pass, this will also include flags
|
||||||
|
* generated based on subpass self-dependencies and fragment density map.
|
||||||
|
*/
|
||||||
|
VkPipelineCreateFlags pipeline_flags;
|
||||||
|
|
||||||
/** VkRenderingSelfDependencyInfoMESA::colorSelfDependencies */
|
/** VkRenderingSelfDependencyInfoMESA::colorSelfDependencies */
|
||||||
uint8_t color_self_dependencies;
|
uint8_t color_self_dependencies;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user