Mesa's Raspberry Pi V3DV Vulkan Driver Lands New Occlusion Queries Implementation
Iago Toral rewrote the V3DV occlusion queries code to be much improved over the prior implementation of this VideoCore Vulkan driver. He explained in the merge request:
"Our implementation was mostly CPU-based, with things such as query resets and result copying handled in the CPU, as well as some aspects of query availability tracking.
This new implementation handles all GPU-side query functions by dispatching compute shaders to push the work to the GPU. This involves query availability, reset and result copying.
For now, only occlusion queries are managed this way. Performance queries can also be implemented in a similar fashion in the future with some additional work, however, for timestamp queries our only option to improve this would be to execute the actual timestamp in the kernel, since we can't take a timestamp from a shader."
That over thousand lines of reworked code for the V3DV driver has now been merged for Mesa 23.0 as another enhancement on the open-source Raspberry Pi graphics driver front.