Module: Mesa
Branch: main
Commit: 7da66f8f25f89132b2aa62f9a39981f1c4872b0b
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7da66f8f25f89132b2aa62f9a39981f1c4872b0b

Author: Konstantin Seurer <[email protected]>
Date:   Sun Sep 11 13:28:55 2022 +0200

radv/rra: Replace aliasing assert with a warning

Signed-off-by: Konstantin Seurer <[email protected]>
Reviewed-by: Friedrich Vock <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18530>

---

 src/amd/vulkan/layers/radv_rra_layer.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/amd/vulkan/layers/radv_rra_layer.c 
b/src/amd/vulkan/layers/radv_rra_layer.c
index 5ea2df7c870..4f05e204e79 100644
--- a/src/amd/vulkan/layers/radv_rra_layer.c
+++ b/src/amd/vulkan/layers/radv_rra_layer.c
@@ -116,8 +116,12 @@ rra_CreateAccelerationStructureKHR(VkDevice _device,
    RADV_FROM_HANDLE(radv_acceleration_structure, structure, 
*pAccelerationStructure);
    simple_mtx_lock(&device->rra_trace.data_mtx);
 
-   assert(!_mesa_hash_table_u64_search(device->rra_trace.accel_struct_vas,
-                                       radv_accel_struct_get_va(structure)));
+   if (_mesa_hash_table_u64_search(device->rra_trace.accel_struct_vas,
+                                   radv_accel_struct_get_va(structure)) != 
NULL) {
+      fprintf(stderr, "radv: Memory aliasing between acceleration structures 
detected. RRA "
+                      "captures might not work correctly.\n");
+      goto end;
+   }
 
    VkEvent _build_submit_event;
    radv_CreateEvent(radv_device_to_handle(device),
@@ -132,6 +136,7 @@ rra_CreateAccelerationStructureKHR(VkDevice _device,
    _mesa_hash_table_u64_insert(device->rra_trace.accel_struct_vas,
                                radv_accel_struct_get_va(structure), structure);
 
+end:
    simple_mtx_unlock(&device->rra_trace.data_mtx);
    return VK_SUCCESS;
 }

Reply via email to