v3dv: implement VK_KHR_buffer_device_address
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 27 Jun 2022 12:12:25 +0000 (14:12 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Tue, 19 Jul 2022 07:47:34 +0000 (09:47 +0200)
commitbec3c83e19ef80617126ebc682aea71dc85877ef
treec35827d21a875393e9fbd2bba8d6e9e565ff0e04
parent90054e9c5d96e38b1cc03ea475c1aab29121dfaf
v3dv: implement VK_KHR_buffer_device_address

This feature allows shaders to use pointers to buffers which may
not be bound via descriptor sets. Access to these buffers is done
via global intrinsics.

Because the buffers are not accessed through descriptor sets, any
live buffer flagged with VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_KHR
can be accessed by any shader using global intrinsics, so the driver
needs to make sure all these buffers are mapped by the kernel when
it submits the job for execution.

We handle this by tracking if any draw call or compute dispatch in
a job uses a pipeline that has any such shaders. If so, the job is
flagged as using buffer device address and the kernel submission
for that job will add all live BOs bound to buffers flagged with the
buffer device address usage flag.

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17275>
docs/features.txt
src/broadcom/ci/broadcom-rpi4-skips.txt
src/broadcom/vulkan/v3dv_cmd_buffer.c
src/broadcom/vulkan/v3dv_device.c
src/broadcom/vulkan/v3dv_pipeline.c
src/broadcom/vulkan/v3dv_private.h
src/broadcom/vulkan/v3dv_queue.c