summaryrefslogtreecommitdiff
path: root/src/intel
diff options
context:
space:
mode:
authorSviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>2024-08-09 00:01:44 +0300
committerEric Engestrom <eric@engestrom.ch>2024-08-28 14:26:48 +0200
commit97fdcffb0cb5588ad97e9bce680b99129f252f88 (patch)
treeed4af443183b03bf8f497fd7a32ff985469baaa9 /src/intel
parentf6432697e7bd32b2646269463c266f700e3f5c28 (diff)
anv: Release correct BO in anv_cmd_buffer_set_ray_query_buffer
If p_atomic_cmpxchg doesn't set the ray_query_shadow_bos[bucket] to new_bo allocated by this thread, it returns the bucket BO allocated by the other thread and we use it. But due to a mistake, we also release that BO, not the candidate just allocated by this thread and never used again. Fixes: 5d3e4193 ("anv: enable ray queries") Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30581> (cherry picked from commit 1904fe118624b25817873271fea6285cf2dbbaf5)
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/vulkan/anv_cmd_buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_cmd_buffer.c b/src/intel/vulkan/anv_cmd_buffer.c
index 67de1c855ef..5bf5a783b1e 100644
--- a/src/intel/vulkan/anv_cmd_buffer.c
+++ b/src/intel/vulkan/anv_cmd_buffer.c
@@ -463,7 +463,7 @@ anv_cmd_buffer_set_ray_query_buffer(struct anv_cmd_buffer *cmd_buffer,
bo = p_atomic_cmpxchg(&device->ray_query_shadow_bos[bucket], NULL, new_bo);
if (bo != NULL) {
- anv_device_release_bo(device, bo);
+ anv_device_release_bo(device, new_bo);
} else {
bo = new_bo;
}