vulkan/runtime: Add driver callbacks for BVH building

All of these are functions that could reasonably be incorporated into a
Vulkan extension, but are currently missing. While we could in theory do
BVH building without them, using them simplifies the code significantly
and both radv and turnip can reasonably implement them.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31433>
This commit is contained in:
Connor Abbott 2024-03-01 13:00:20 -05:00 committed by Marge Bot
parent 8ae5b27ee0
commit c1c39116a7

View file

@ -134,6 +134,37 @@ struct vk_device {
/** Shader vtable for VK_EXT_shader_object and common pipelines */
const struct vk_device_shader_ops *shader_ops;
/**
* Write data to a buffer from the command processor. This is simpler than
* setting up a staging buffer and faster for small writes, but is not
* meant for larger amounts of data. \p data is owned by the caller and the
* driver is expected to write it out directly to the command stream as
* part of an immediate write packet.
*/
void (*write_buffer_cp)(VkCommandBuffer cmdbuf, VkDeviceAddress addr,
void *data, uint32_t size);
/* Flush data written via write_buffer_cp. Users must use a normal pipeline
* barrier in order to read this data, with the appropriate destination
* access, but this replaces the source access mask.
*/
void (*flush_buffer_write_cp)(VkCommandBuffer cmdbuf);
/* An unaligned dispatch function. This launches a number of threads that
* may not be a multiple of the workgroup size, which may result in partial
* workgroups.
*/
void (*cmd_dispatch_unaligned)(VkCommandBuffer cmdbuf,
uint32_t invocations_x,
uint32_t invocations_y,
uint32_t invocations_z);
/* vkCmdFillBuffer but with a device address. */
void (*cmd_fill_buffer_addr)(VkCommandBuffer cmdbuf,
VkDeviceAddress devAddr,
VkDeviceSize size,
uint32_t data);
/** Driver provided callback for capturing traces
*
* Triggers for this callback are: