summaryrefslogtreecommitdiff
path: root/src/amd/vulkan/radv_query.c
AgeCommit message (Collapse)AuthorFilesLines
5 daysradv: fix waiting for occlusion queries on GFX6-8Samuel Pitoiset1-16/+44
Occlusion queries don't go through L2 on GFX6-8, and waiting properly in shaders is more complicated to implement. Use the previous WAIT_REG_MEM logic on these GPUs to fix this. This fixes flickering on many games on GFX8. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8954 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9415 Fixes: d44651bfc3c ("radv: wait for occlusion queries in the resolve query shader") Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28796>
13 daysradv/video: don't advertise timestamp bits for decode/encodeDave Airlie1-0/+3
At this point I'm not sure if the queues can support timestamps. Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25900>
13 daysradv: add encoder queue support pieces and encoder queries.Dave Airlie1-0/+53
This is just checks for events and avoiding an assert in the winsys, and adds support for the encoder queries. Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25900>
2024-04-08radv: use SPDX-License-IdentifierSamuel Pitoiset1-18/+1
Only files under src/amd/vulkan/** are concerned. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28599>
2024-04-04radv: remove radv_private.hSamuel Pitoiset1-1/+2
This file was a giant mess and I'm very happy to remove it entirely. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28568>
2024-04-04radv: replace RADV_FROM_HANDLE by VK_FROM_HANDLESamuel Pitoiset1-21/+21
It was exactly the same thing. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28568>
2024-04-04radv: add radv_rmv.hSamuel Pitoiset1-0/+1
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28551>
2024-04-03radv: implement VK_EXT_device_address_binding_reportSamuel Pitoiset1-3/+3
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28373>
2024-04-02radv: add radv_perfcounter.hSamuel Pitoiset1-0/+1
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28510>
2024-04-02radv: add radv_query.hSamuel Pitoiset1-0/+1
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28510>
2024-04-01radv: remove radv_physical_device::instanceSamuel Pitoiset1-3/+5
Get the instance object using the base object. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28500>
2024-04-01radv: remove radv_device::instanceSamuel Pitoiset1-3/+3
Use the physical device to access the instance. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28500>
2024-04-01radv: remove radv_cmd_buffer::deviceSamuel Pitoiset1-57/+66
Get the logical device object using the base object. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28500>
2024-04-01radv: remove radv_device::physical_deviceSamuel Pitoiset1-60/+64
Get the logical device object using the base object. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28500>
2024-04-01radv: rename radv_physical_device::rad_info to infoSamuel Pitoiset1-33/+33
The extra rad_ prefix isn't necessary and it's longer to type. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28500>
2024-03-27radv/rmv: log allocated/destroyed BOs in radv_buffer_{create,destroy}()Samuel Pitoiset1-4/+2
This will likely log more things because a bunch of them were missing. This will also allow us to implement VK_EXT_device_address_binding_report more easily. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28367>
2024-03-27radv: add radv_bo_{create,destroy}() helpersSamuel Pitoiset1-3/+3
This will allow us to easily log all BOs both for RMV and VK_EXT_device_address_binding_report. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28367>
2024-03-27radv/rmv: remove unnecessary is_internal parameter to some helpersSamuel Pitoiset1-3/+3
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28367>
2024-03-27radv: make some create resources helpers staticSamuel Pitoiset1-1/+1
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28367>
2024-03-01radv/winsys: Use radv_buffer_map wrapper.Bas Nieuwenhuizen1-1/+1
So we can have 1 function ptr and then have a version with default args. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27689>
2024-03-01radv: Add winsys argument to buffer map/unmap.Bas Nieuwenhuizen1-1/+1
To use later. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27689>
2024-02-22radv: remove a TODO about adding mesh/task queries on GFX11Samuel Pitoiset1-1/+0
It's implemented and it's passing dEQP-VK.mesh_shader.ext.query.*. Though, it's not enabled yet because task shader can still randomly hang on RDNA3. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26304>
2024-02-22radv: add support for task shader invocations queries on GFX11Samuel Pitoiset1-30/+53
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26304>
2024-02-22radv: add support for mesh primitives queries on GFX11Samuel Pitoiset1-38/+121
This is natively supported with new pipeline statistics. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26304>
2024-02-16radv: fix pipeline stats maskChia-I Wu1-1/+1
Left-shifting by 11*8 or 14*8 is undefined. This fixes many dEQP-VK.query_pool.statistics_query.* failures (but not pre-existing flakes) for release builds using clang. Fixes: 48aabaf225f ("radv: do not harcode the pipeline stats mask for query resolves") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27651>
2024-01-19radv: Ensure vkGetQueryPoolResults returns in finite-timeJoshua Ashton1-13/+53
When a device lost occured, we were not ensuring that vkGetQueryPoolResults with VK_QUERY_RESULT_WAIT_BIT was returning. We could have the caller stuck in our while(...) loop polling the query atomics forever which violates the finite-time guarantees of this function. This solves that by adding a timeout to this call to be double the default TDR timeout for the potential queues relating to this query. Signed-off-by: Joshua Ashton <joshua@froggi.es> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27091>
2024-01-17radv: delay emitting streamout enable at draw timeSamuel Pitoiset1-2/+2
Since Vulkan 1.3.271, the spec allowed vkCmdBeginTransformFeedbackEXT to be called without an active graphics pipeline bound when using shader objects. That means that the last VGT shader would be NULL once VKCTS is updated accordingly. This change delays emitting streamout enable at draw time to make sure the last VGT shader is present, regarldess if ESO is enabled or not. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27075>
2024-01-10radv: move dri options to radv_instance::drircSamuel Pitoiset1-3/+3
To make it clearer that such an option is a per-application option. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26946>
2024-01-04radv: drop si_ prefix from all functionsSamuel Pitoiset1-10/+10
Most of these functions were copied from RadeonSI but they should be prefixed with radv_ instead. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26854>
2024-01-03radv: add support for version 2 of all descriptor binding commandsSamuel Pitoiset1-2/+3
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26757>
2023-12-09radv: Implement vkCmdWriteTimestamp2 on transfer queues.Timur Kristóf1-5/+17
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26580>
2023-12-05util: Fixes note: the alignment of ‘_Atomic long long int’ fields ↵Yonggang Luo1-17/+17
changed in GCC 11. This is a improve of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22121 Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23961>
2023-11-21radv: add support for task shader invocations queries on GFX10.3Samuel Pitoiset1-2/+102
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25950>
2023-11-21radv: rework gfx10_copy_gds_query() slightlySamuel Pitoiset1-23/+27
To prepare for the same function with ACE. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25950>
2023-11-21radv: add support for mesh shader invocations queries on GFX10.3Samuel Pitoiset1-1/+16
Also emulated with a GDS atomic counter in shaders. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25950>
2023-11-21radv: do not harcode the pipeline stats mask for query resolvesSamuel Pitoiset1-1/+1
Otherwise, mesh/task shader invocations would be ignored. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25950>
2023-11-21radv: bump the pipeline state query size to 14 on GFX10.3Samuel Pitoiset1-1/+4
GFX10.3 doesn't natively support mesh/task shader invocations query and they need to be emulated in shaders. In order to share more code between GFX10.3 and GFX11, it's easier to use the same size as GFX11. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25950>
2023-11-21radv: define new pipeline statistics indices for mesh/task on GFX11Samuel Pitoiset1-1/+1
GFX11 uses pipeline statistics for mesh/task queries but on GFX10.3 they need to be emulated. Though the number of mesh/task shader invocations would be copied to the pipeline statistics range to simplify the implementation. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25950>
2023-11-21radv: add support for mesh primitives queries on GFX10.3Samuel Pitoiset1-1/+216
This query is emulated using a GDS atomic counter in shaders. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25950>
2023-11-13radv: add radv_write_timestamp() helperSamuel Pitoiset1-13/+21
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22779>
2023-11-01radv: fix compute shader invocations query on compute queue on GFX6Samuel Pitoiset1-2/+2
Looks like GFX6 always writes the number of compute shader invocations at offset 0 when used on compute queue. This fixes dEQP-VK.query_pool.statistics_query.*_cq on GFX6. Fixes: a9945216ba2 ("radv: fix COMPUTE_SHADER_INVOCATIONS query on compute queue") Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25957>
2023-10-30radv: fix a synchronization issue with primitives generated query on RDNA1-2Samuel Pitoiset1-14/+34
Only RDNA1-2 are affected because RADV needs to handle the legacy vs NGG path for this query, and the NGG results are stored with 2 extra 64-bit values. Fixes flakes with dEQP-VK.transform_feedback.primitives_generated_query.* since VKCTS 1.3.7.0. Cc: mesa-stable Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25862>
2023-10-19radv: Add queue family argument to some functions.Timur Kristóf1-5/+4
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25770>
2023-10-19radv: Refactor WRITE_DATA helper function.Timur Kristóf1-6/+6
Create a version of this function that takes a CS and queue family. move it to radv_cs.h so it can be called from multiple other files. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25770>
2023-10-19radv: Move radv_cp_wait_mem to radv_cs.h and add queue family argument.Timur Kristóf1-5/+6
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25770>
2023-10-12radv: mark GDS as needed for XFB queries with NGG streamout on GFX11Samuel Pitoiset1-0/+3
This doesn't fix anything because gds_needed should already be TRUE because it's initialized at pipeline bind time, but this will be needed for skipping GDS allocation on GFX11. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25284>
2023-10-05radv: fix synchronization with emulated GS primitives/invocations queriesSamuel Pitoiset1-4/+4
Move emitting the EOP even which writes the availability bit after the GDS copy to ensure it's available. This should fix all GS primitives/invocations flakes in CI. Cc: mesa-stable Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25457>
2023-10-04radv: fix emulated geometry shader primitives/invocations queriesSamuel Pitoiset1-4/+6
If both are used together, only the geometry shader primitives were copied. Found by inspection. Cc: mesa-stable Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25543>
2023-09-29radv: fix COMPUTE_SHADER_INVOCATIONS query on compute queueSamuel Pitoiset1-0/+12
The VA needs to be adjusted, otherwise the hw always writes at offset 0. This fixes dEQP-VK.query_pool.statistics_query.*_cq. Cc: mesa-stable Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25406>
2023-09-07radv: fix interactions with primitives generated queries and pipeline statsSamuel Pitoiset1-8/+31
SAMPLE_STREAMOUTSTATS requires PIPELINESTAT_START to be enabled, otherwise the hw doesn't count anything. This fixes dEQP-VK.transform_feedback.primitives_generated_query.concurrent.pipeline_statistics_2.* on GFX8. GFX6-9 are probably also affected by this bug, but with NGG these queries are slightly different and don't use legacy streamout. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25049>