mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-04 19:20:38 +01:00
vulkan: add vk_shader_ops::replay_at vfunc stub
Add a new vfunction to support shader capture/replay, needed for RT pipeline capture/replay. Signed-off-by: Michael Cheng <michael.cheng@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33022>
This commit is contained in:
parent
9e4d9d3f35
commit
51966cc452
2 changed files with 25 additions and 0 deletions
|
|
@ -3682,6 +3682,19 @@ vk_create_rt_pipeline(struct vk_device *device,
|
||||||
assert(group->stages[s].shader != NULL);
|
assert(group->stages[s].shader != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Activate replay if needed */
|
||||||
|
if (pipeline_flags &
|
||||||
|
VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR) {
|
||||||
|
const struct vk_device_shader_ops *ops = device->shader_ops;
|
||||||
|
struct vk_shader *shaders[3] = {};
|
||||||
|
for (uint32_t s = 0; s < group->stage_count; s++)
|
||||||
|
shaders[s] = group->stages[s].shader;
|
||||||
|
ops->replay_rt_shader_group(
|
||||||
|
device, group_info->type,
|
||||||
|
group->stage_count, shaders,
|
||||||
|
group_info->pShaderGroupCaptureReplayHandle);
|
||||||
|
}
|
||||||
|
|
||||||
pipeline->group_count++;
|
pipeline->group_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -313,6 +313,18 @@ struct vk_device_shader_ops {
|
||||||
uint32_t shader_count,
|
uint32_t shader_count,
|
||||||
void *output);
|
void *output);
|
||||||
|
|
||||||
|
/** Enable a RT shader for replay
|
||||||
|
*
|
||||||
|
* The @replay_data pointer is the pointer handed to
|
||||||
|
* VkRayTracingShaderGroupCreateInfoKHR::pShaderGroupCaptureReplayHandle on
|
||||||
|
* replay or NULL on capture.
|
||||||
|
*/
|
||||||
|
void (*replay_rt_shader_group)(struct vk_device *vk_device,
|
||||||
|
VkRayTracingShaderGroupTypeKHR type,
|
||||||
|
uint32_t shader_count,
|
||||||
|
struct vk_shader **vk_shaders,
|
||||||
|
const void *replay_data);
|
||||||
|
|
||||||
/** Bind a set of shaders
|
/** Bind a set of shaders
|
||||||
*
|
*
|
||||||
* This is roughly equivalent to vkCmdBindShadersEXT()
|
* This is roughly equivalent to vkCmdBindShadersEXT()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue