v3dv: handle VkPipelineCreateFlags2CreateInfoKHR

This is added with VK_KHR_maintenance5 to allow 64-bit
for pipeline creation flags.

The flags are backwards compatible so we don't need to
change the flag enum values by the new ones.

This patch also addresses a small issue where compute pipelines
where not initializing the flags field in the pipeline object.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29449>
This commit is contained in:
Iago Toral Quiroga
2024-05-28 11:25:14 +02:00
committed by Marge Bot
parent 5ff01962fc
commit 3f3c83a6b7
2 changed files with 20 additions and 6 deletions

View File

@@ -2461,7 +2461,7 @@ pipeline_compile_graphics(struct v3dv_pipeline *pipeline,
* compile).
*/
bool needs_executable_info =
pCreateInfo->flags & VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR;
pipeline->flags & VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR;
if (!needs_executable_info) {
struct v3dv_pipeline_key pipeline_key;
pipeline_populate_graphics_key(pipeline, &pipeline_key, pCreateInfo);
@@ -2492,7 +2492,7 @@ pipeline_compile_graphics(struct v3dv_pipeline *pipeline,
}
}
if (pCreateInfo->flags & VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT)
if (pipeline->flags & VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT)
return VK_PIPELINE_COMPILE_REQUIRED;
/* Otherwise we try to get the NIR shaders (either from the original SPIR-V
@@ -2848,7 +2848,14 @@ pipeline_init(struct v3dv_pipeline *pipeline,
VkResult result = VK_SUCCESS;
pipeline->device = device;
pipeline->flags = pCreateInfo->flags;
const VkPipelineCreateFlags2CreateInfoKHR *flags2 =
vk_find_struct_const(pCreateInfo->pNext,
PIPELINE_CREATE_FLAGS_2_CREATE_INFO_KHR);
if (flags2)
pipeline->flags = flags2->flags;
else
pipeline->flags = pCreateInfo->flags;
V3DV_FROM_HANDLE(v3dv_pipeline_layout, layout, pCreateInfo->layout);
pipeline->layout = layout;
@@ -3125,7 +3132,7 @@ pipeline_compile_compute(struct v3dv_pipeline *pipeline,
* compile).
*/
bool needs_executable_info =
info->flags & VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR;
pipeline->flags & VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR;
if (!needs_executable_info) {
struct v3dv_pipeline_key pipeline_key;
pipeline_populate_compute_key(pipeline, &pipeline_key, info);
@@ -3145,7 +3152,7 @@ pipeline_compile_compute(struct v3dv_pipeline *pipeline,
}
}
if (info->flags & VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT)
if (pipeline->flags & VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT)
return VK_PIPELINE_COMPILE_REQUIRED;
pipeline->shared_data = v3dv_pipeline_shared_data_new_empty(pipeline->sha1,
@@ -3216,6 +3223,13 @@ compute_pipeline_init(struct v3dv_pipeline *pipeline,
pipeline->layout = layout;
v3dv_pipeline_layout_ref(pipeline->layout);
const VkPipelineCreateFlags2CreateInfoKHR *flags2 =
vk_find_struct_const(info->pNext, PIPELINE_CREATE_FLAGS_2_CREATE_INFO_KHR);
if (flags2)
pipeline->flags = flags2->flags;
else
pipeline->flags = info->flags;
VkResult result = pipeline_compile_compute(pipeline, cache, info, alloc);
if (result != VK_SUCCESS)
return result;

View File

@@ -2234,7 +2234,7 @@ struct v3dv_pipeline {
struct v3dv_device *device;
VkShaderStageFlags active_stages;
VkPipelineCreateFlags flags;
VkPipelineCreateFlagBits2KHR flags;
struct v3dv_render_pass *pass;
struct v3dv_subpass *subpass;