mirror of https://gitlab.freedesktop.org/mesa/mesa
lavapipe: Implement VK_EXT_pipeline_library_group_handles
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
This commit is contained in:
parent
1f729d9e2d
commit
cede129119
|
@ -211,6 +211,7 @@ static const struct vk_device_extension_table lvp_device_extensions_supported =
|
|||
#endif
|
||||
.EXT_pipeline_creation_feedback = true,
|
||||
.EXT_pipeline_creation_cache_control = true,
|
||||
.EXT_pipeline_library_group_handles = true,
|
||||
.EXT_post_depth_coverage = true,
|
||||
.EXT_private_data = true,
|
||||
.EXT_primitives_generated_query = true,
|
||||
|
@ -502,6 +503,9 @@ lvp_get_features(const struct lvp_physical_device *pdevice,
|
|||
.rayTracingPipelineTraceRaysIndirect = true,
|
||||
.rayTraversalPrimitiveCulling = true,
|
||||
|
||||
/* VK_EXT_pipeline_library_group_handles */
|
||||
.pipelineLibraryGroupHandles = true,
|
||||
|
||||
/* VK_EXT_shader_object */
|
||||
.shaderObject = true,
|
||||
|
||||
|
@ -1653,6 +1657,8 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateDevice(
|
|||
util_dynarray_init(&device->bda_texture_handles, NULL);
|
||||
util_dynarray_init(&device->bda_image_handles, NULL);
|
||||
|
||||
device->group_handle_alloc = 1;
|
||||
|
||||
*pDevice = lvp_device_to_handle(device);
|
||||
|
||||
return VK_SUCCESS;
|
||||
|
|
|
@ -213,6 +213,8 @@ struct lvp_device {
|
|||
struct lp_texture_handle *null_image_handle;
|
||||
struct util_dynarray bda_texture_handles;
|
||||
struct util_dynarray bda_image_handles;
|
||||
|
||||
uint32_t group_handle_alloc;
|
||||
};
|
||||
|
||||
void lvp_device_get_cache_uuid(void *uuid);
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
|
||||
#include "spirv/spirv.h"
|
||||
|
||||
#include "util/mesa-sha1.h"
|
||||
#include "util/simple_mtx.h"
|
||||
|
||||
static void
|
||||
lvp_init_ray_tracing_groups(struct lvp_pipeline *pipeline,
|
||||
const VkRayTracingPipelineCreateInfoKHR *create_info)
|
||||
|
@ -24,8 +27,6 @@ lvp_init_ray_tracing_groups(struct lvp_pipeline *pipeline,
|
|||
const VkRayTracingShaderGroupCreateInfoKHR *group_info = create_info->pGroups + i;
|
||||
struct lvp_ray_tracing_group *dst = pipeline->rt.groups + i;
|
||||
|
||||
dst->handle.index = i;
|
||||
|
||||
dst->recursive_index = VK_SHADER_UNUSED_KHR;
|
||||
dst->ahit_index = VK_SHADER_UNUSED_KHR;
|
||||
dst->isec_index = VK_SHADER_UNUSED_KHR;
|
||||
|
@ -58,6 +59,8 @@ lvp_init_ray_tracing_groups(struct lvp_pipeline *pipeline,
|
|||
default:
|
||||
unreachable("Unimplemented VkRayTracingShaderGroupTypeKHR");
|
||||
}
|
||||
|
||||
dst->handle.index = p_atomic_inc_return(&pipeline->device->group_handle_alloc);
|
||||
}
|
||||
|
||||
if (!create_info->pLibraryInfo)
|
||||
|
@ -70,7 +73,7 @@ lvp_init_ray_tracing_groups(struct lvp_pipeline *pipeline,
|
|||
const struct lvp_ray_tracing_group *src = library->rt.groups + group_index;
|
||||
struct lvp_ray_tracing_group *dst = pipeline->rt.groups + i;
|
||||
|
||||
dst->handle.index = i;
|
||||
dst->handle = src->handle;
|
||||
|
||||
if (src->recursive_index != VK_SHADER_UNUSED_KHR)
|
||||
dst->recursive_index = stage_base_index + src->recursive_index;
|
||||
|
@ -1147,12 +1150,12 @@ lvp_create_ray_tracing_pipeline(VkDevice _device, const VkAllocationCallbacks *a
|
|||
goto fail;
|
||||
}
|
||||
|
||||
lvp_init_ray_tracing_groups(pipeline, create_info);
|
||||
|
||||
result = lvp_compile_ray_tracing_stages(pipeline, create_info);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
|
||||
lvp_init_ray_tracing_groups(pipeline, create_info);
|
||||
|
||||
VkPipelineCreateFlags2KHR create_flags = vk_rt_pipeline_create_flags(create_info);
|
||||
if (!(create_flags & VK_PIPELINE_CREATE_2_LIBRARY_BIT_KHR)) {
|
||||
lvp_compile_ray_tracing_pipeline(pipeline, create_info);
|
||||
|
|
Loading…
Reference in New Issue