vulkan/runtime: add a subpass bit for legacy dithering

v2: use bit only when dithering enabled on device

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19414>
This commit is contained in:
Tapani Pälli 2024-02-26 15:10:21 +02:00 committed by Marge Bot
parent 826d467e40
commit e7ce48557a
2 changed files with 10 additions and 0 deletions

View File

@ -482,6 +482,11 @@ vk_common_CreateRenderPass2(VkDevice _device,
subpass->attachment_count = num_subpass_attachments2(desc);
subpass->attachments = next_subpass_attachment;
if (device->enabled_features.legacyDithering) {
subpass->legacy_dithering_enabled =
desc->flags & VK_SUBPASS_DESCRIPTION_ENABLE_LEGACY_DITHERING_BIT_EXT;
}
/* From the Vulkan 1.3.204 spec:
*
* VUID-VkRenderPassCreateInfo2-viewMask-03058
@ -2114,6 +2119,8 @@ begin_subpass(struct vk_command_buffer *cmd_buffer,
.pColorAttachments = color_attachments,
.pDepthAttachment = &depth_attachment,
.pStencilAttachment = &stencil_attachment,
.flags = subpass->legacy_dithering_enabled ?
VK_RENDERING_ENABLE_LEGACY_DITHERING_BIT_EXT : 0,
};
VkRenderingFragmentShadingRateAttachmentInfoKHR fsr_attachment;

View File

@ -182,6 +182,9 @@ struct vk_subpass {
/** VkMultisampledRenderToSingleSampledInfoEXT for this subpass */
VkMultisampledRenderToSingleSampledInfoEXT mrtss;
/** True if legacy dithering is enabled for this subpass. */
bool legacy_dithering_enabled;
};
/***/