radv/rt: Handle monolithic pipelines in capture/replay

If monolithic shaders were inlined, there might not be a radv_shader
associated with some stages. Zero out the shader allocation info in that
case, the shader will get identified by hash instead.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27890>
This commit is contained in:
Friedrich Vock 2024-02-29 18:43:17 +01:00 committed by Marge Bot
parent 7f72eb9e6c
commit b588cb29a3

View file

@ -196,7 +196,8 @@ radv_rt_fill_group_info(struct radv_device *device, const struct radv_ray_tracin
} else if (groups[idx].recursive_shader != VK_SHADER_UNUSED_KHR) {
struct radv_shader *library_shader = stages[groups[idx].recursive_shader].shader;
simple_mtx_lock(&library_shader->replay_mtx);
if (!library_shader->has_replay_alloc) {
/* If arena_va is 0, the pipeline is monolithic and the shader was inlined into raygen */
if (!library_shader->has_replay_alloc && handle->recursive_shader_alloc.arena_va) {
union radv_shader_arena_block *new_block =
radv_replay_shader_arena_block(device, &handle->recursive_shader_alloc, library_shader);
if (!new_block) {
@ -956,7 +957,8 @@ radv_GetRayTracingCaptureReplayShaderGroupHandlesKHR(VkDevice device, VkPipeline
uint32_t recursive_shader = rt_pipeline->groups[firstGroup + i].recursive_shader;
if (recursive_shader != VK_SHADER_UNUSED_KHR) {
struct radv_shader *shader = rt_pipeline->stages[recursive_shader].shader;
data[i].recursive_shader_alloc = radv_serialize_shader_arena_block(shader->alloc);
if (shader)
data[i].recursive_shader_alloc = radv_serialize_shader_arena_block(shader->alloc);
}
data[i].non_recursive_idx = rt_pipeline->groups[firstGroup + i].handle.any_hit_index;
}