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>
(cherry picked from commit b588cb29a3)
This commit is contained in:
Friedrich Vock 2024-02-29 18:43:17 +01:00 committed by Eric Engestrom
parent 8f15da8e97
commit bba7bd12e0
2 changed files with 5 additions and 3 deletions

View file

@ -2904,7 +2904,7 @@
"description": "radv/rt: Handle monolithic pipelines in capture/replay",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -193,7 +193,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) {
@ -942,7 +943,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;
}