vk/graphics_state: Remove vk_subpass_info
It only has a subset of the renderpass state, whereas with turnip we need to use pretty much all of it at one point or another. Just allow the driver to pass in the entire vk_render_pass_state if it's using its own renderpass implementation. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22301>
This commit is contained in:
@@ -1012,8 +1012,8 @@ vk_render_pass_state_is_complete(const struct vk_render_pass_state *rp)
|
||||
static void
|
||||
vk_render_pass_state_init(struct vk_render_pass_state *rp,
|
||||
const struct vk_render_pass_state *old_rp,
|
||||
const struct vk_render_pass_state *driver_rp,
|
||||
const VkGraphicsPipelineCreateInfo *info,
|
||||
const struct vk_subpass_info *sp_info,
|
||||
VkGraphicsPipelineLibraryFlagsEXT lib)
|
||||
{
|
||||
VkPipelineCreateFlags valid_pipeline_flags = 0;
|
||||
@@ -1048,9 +1048,10 @@ vk_render_pass_state_init(struct vk_render_pass_state *rp,
|
||||
.stencil_attachment_format = VK_FORMAT_UNDEFINED,
|
||||
};
|
||||
|
||||
if (info->renderPass != VK_NULL_HANDLE && sp_info != NULL) {
|
||||
rp->attachment_aspects = sp_info->attachment_aspects;
|
||||
rp->view_mask = sp_info->view_mask;
|
||||
if (info->renderPass != VK_NULL_HANDLE && driver_rp != NULL) {
|
||||
assert(driver_rp->render_pass == info->renderPass);
|
||||
assert(driver_rp->subpass == info->subpass);
|
||||
*rp = *driver_rp;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1187,7 +1188,7 @@ VkResult
|
||||
vk_graphics_pipeline_state_fill(const struct vk_device *device,
|
||||
struct vk_graphics_pipeline_state *state,
|
||||
const VkGraphicsPipelineCreateInfo *info,
|
||||
const struct vk_subpass_info *sp_info,
|
||||
const struct vk_render_pass_state *driver_rp,
|
||||
struct vk_graphics_pipeline_all_state *all,
|
||||
const VkAllocationCallbacks *alloc,
|
||||
VkSystemAllocationScope scope,
|
||||
@@ -1307,7 +1308,7 @@ vk_graphics_pipeline_state_fill(const struct vk_device *device,
|
||||
if (lib & (VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT |
|
||||
VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT |
|
||||
VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT)) {
|
||||
vk_render_pass_state_init(&rp, state->rp, info, sp_info, lib);
|
||||
vk_render_pass_state_init(&rp, state->rp, driver_rp, info, lib);
|
||||
|
||||
needs |= MESA_VK_GRAPHICS_STATE_RENDER_PASS_BIT;
|
||||
|
||||
|
||||
@@ -867,26 +867,6 @@ struct vk_graphics_pipeline_state {
|
||||
const struct vk_render_pass_state *rp;
|
||||
};
|
||||
|
||||
/** Struct for extra information that we need from the subpass.
|
||||
*
|
||||
* This struct need only be provided if the driver has its own render pass
|
||||
* implementation. If the driver uses the common render pass implementation,
|
||||
* we can get this information ourselves.
|
||||
*/
|
||||
struct vk_subpass_info {
|
||||
/** VkSubpassDescription2::viewMask */
|
||||
uint32_t view_mask;
|
||||
|
||||
/**
|
||||
* Aspects of all attachments used as color or depth/stencil attachments
|
||||
* in the subpass. Input and resolve attachments should not be considered
|
||||
* when computing the attachments aspect mask. This is used to determine
|
||||
* whether or not depth/stencil and color blend state are required for a
|
||||
* pipeline.
|
||||
*/
|
||||
VkImageAspectFlags attachment_aspects;
|
||||
};
|
||||
|
||||
/** Populate a vk_graphics_pipeline_state from VkGraphicsPipelineCreateInfo
|
||||
*
|
||||
* This function crawls the provided VkGraphicsPipelineCreateInfo and uses it
|
||||
@@ -913,7 +893,7 @@ struct vk_subpass_info {
|
||||
* @param[in] device The Vulkan device
|
||||
* @param[out] state The graphics pipeline state to populate
|
||||
* @param[in] info The pCreateInfo from vkCreateGraphicsPipelines
|
||||
* @param[in] sp_info Subpass info if the driver implements render
|
||||
* @param[in] driver_rp Renderpass state if the driver implements render
|
||||
* passes itself. This should be NULL for drivers
|
||||
* that use the common render pass infrastructure
|
||||
* built on top of dynamic rendering.
|
||||
@@ -933,7 +913,7 @@ VkResult
|
||||
vk_graphics_pipeline_state_fill(const struct vk_device *device,
|
||||
struct vk_graphics_pipeline_state *state,
|
||||
const VkGraphicsPipelineCreateInfo *info,
|
||||
const struct vk_subpass_info *sp_info,
|
||||
const struct vk_render_pass_state *rp_info,
|
||||
struct vk_graphics_pipeline_all_state *all,
|
||||
const VkAllocationCallbacks *alloc,
|
||||
VkSystemAllocationScope scope,
|
||||
|
||||
Reference in New Issue
Block a user