mesa/src/broadcom/vulkan
Iago Toral Quiroga bed3f31fc6 v3dv: don't use a dedicated BO for each occlusion query
Dedicated BOs waste memory and are also a significant cause of CPU
overhead when applications use hundreds of them per frame due to
all the work the kernel has to do to page in all these BOs for a job.
The UE4 Vehicle demo was hitting this causing it to freeze and stutter
under 1fps.

The hardware allows us to setup groups of 16 queries in consecutive
4-byte addresses, requiring only that each group of 16 queries is
aligned to a 1024 byte boundary. With this change, we allocate all
the queries in a pool in a single BO and we assign them different
offsets based on the above restriction. This eliminates the freezes
and stutters in the Vehicle sample.

One caveat of this solution is that we can only wait or test for
completion of a query by testing if the GPU is still using its BO,
which basically means that we can only wait for all active queries
in a pool to complete and not just the ones being requested by the
API. Since the Vulkan recommendation is to use a different query
pool per frame this should not be a big issue though.

If this ever becomes a problem (for example if an application does't
follow the recommendation and instead allocates a single pool and
splits its queries between frames), we could try to group queries
in a pool into a number of BOs to try and find a balance, but for
now this should work fine in most cases.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10253>
2021-04-15 12:45:07 +00:00
..
.dir-locals.el
.editorconfig
meson.build vulkan: Track dependencies of Python imports 2021-04-08 14:15:54 +00:00
v3d_tiling.c v3dv: implement vkCreateImage 2020-10-13 21:21:25 +00:00
v3dv_bo.c v3dv: use a bitfield to implement a quick check for job BO tracking 2021-04-15 06:09:34 +00:00
v3dv_bo.h v3dv: use a bitfield to implement a quick check for job BO tracking 2021-04-15 06:09:34 +00:00
v3dv_cl.c v3dv: optimize a few cases of BO job additions 2021-04-15 06:09:34 +00:00
v3dv_cl.h v3dv/descriptor: use descriptor pool bo for image/samplers 2020-10-13 21:21:30 +00:00
v3dv_cmd_buffer.c v3dv: don't use a dedicated BO for each occlusion query 2021-04-15 12:45:07 +00:00
v3dv_debug.c v3dv/debug: add v3dv_debug 2020-10-13 21:21:25 +00:00
v3dv_debug.h v3dv/debug: add v3dv_print_v3d_key 2020-10-13 21:21:33 +00:00
v3dv_descriptor_set.c vulkan: track number of bindings instead of max binding for CreateDescriptorSetLayout 2021-04-05 20:17:53 +00:00
v3dv_device.c v3dv: fix descriptor set limits 2021-04-15 11:26:04 +00:00
v3dv_extensions.py v3dv: implement VK_EXT_private_data 2020-11-17 23:55:14 +00:00
v3dv_extensions_gen.py vulkan: Drop the type_prefix parameter from gen_extensions 2021-02-01 18:54:25 +00:00
v3dv_formats.c v3dv/formats: expose support for BC1-3 compressed formats 2021-02-12 22:04:13 +00:00
v3dv_icd.py
v3dv_image.c v3dv: use the common base object type and struct 2020-11-17 23:55:14 +00:00
v3dv_limits.h v3dv: fix descriptor set limits 2021-04-15 11:26:04 +00:00
v3dv_meta_clear.c v3dv/pipeline: try to get the shader variant directly from the cache 2021-03-22 17:10:47 +00:00
v3dv_meta_copy.c v3dv: avoid some maybe-uninitialized warnings 2021-03-17 10:05:07 +00:00
v3dv_pass.c v3dv: use the common base object type and struct 2020-11-17 23:55:14 +00:00
v3dv_pipeline.c v3dv/debug: use gl stage when checking debug flag 2021-04-15 10:29:44 +00:00
v3dv_pipeline_cache.c v3dv/pipeline_cache: fix assert 2021-03-25 09:25:27 +00:00
v3dv_private.h v3dv: don't use a dedicated BO for each occlusion query 2021-04-15 12:45:07 +00:00
v3dv_query.c v3dv: don't use a dedicated BO for each occlusion query 2021-04-15 12:45:07 +00:00
v3dv_queue.c v3dv: don't use a dedicated BO for each occlusion query 2021-04-15 12:45:07 +00:00
v3dv_uniforms.c v3dv: fix array sizes when tracking BOs during uniform setup 2021-04-15 11:26:04 +00:00
v3dv_util.c v3dv: move error string definition to debug path 2020-12-01 12:10:11 +00:00
v3dv_wsi.c v3dv: port to using common dispatch code. 2021-02-01 18:54:24 +00:00
v3dv_wsi_display.c v3dv: move to subclassing instance/physical device 2021-02-01 18:54:24 +00:00
v3dv_wsi_wayland.c v3dv: move to subclassing instance/physical device 2021-02-01 18:54:24 +00:00
v3dv_wsi_x11.c v3dv: move to subclassing instance/physical device 2021-02-01 18:54:24 +00:00
vk_format_info.h anv: Move vk_format helpers to common code 2021-03-10 18:17:31 +00:00