From a0db9d5a1f4b8b7795e50f2ddf39a93fb56aeff6 Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Fri, 3 Oct 2025 15:20:57 +0100 Subject: [PATCH] Comment about thread safety requirements in Spirv debugger ids container --- renderdoc/driver/shaders/spirv/spirv_common.h | 1 + renderdoc/driver/shaders/spirv/spirv_debug.cpp | 1 + renderdoc/driver/shaders/spirv/spirv_debug.h | 1 + 3 files changed, 3 insertions(+) diff --git a/renderdoc/driver/shaders/spirv/spirv_common.h b/renderdoc/driver/shaders/spirv/spirv_common.h index a2b0630a0..d7863c7b5 100644 --- a/renderdoc/driver/shaders/spirv/spirv_common.h +++ b/renderdoc/driver/shaders/spirv/spirv_common.h @@ -209,6 +209,7 @@ private: T dummy; }; +// This must be a thread safe container template class DenseIdMap : public rdcarray { diff --git a/renderdoc/driver/shaders/spirv/spirv_debug.cpp b/renderdoc/driver/shaders/spirv/spirv_debug.cpp index b0c695bfe..821aa8c50 100644 --- a/renderdoc/driver/shaders/spirv/spirv_debug.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_debug.cpp @@ -329,6 +329,7 @@ void ThreadState::EnterFunction(const rdcarray &arguments) SkipIgnoredInstructions(); } +// This must be thread safe : it is called from multiple threads const ShaderVariable &ThreadState::GetSrc(Id id) const { return ids[id]; diff --git a/renderdoc/driver/shaders/spirv/spirv_debug.h b/renderdoc/driver/shaders/spirv/spirv_debug.h index 2856355a1..62bf8882c 100644 --- a/renderdoc/driver/shaders/spirv/spirv_debug.h +++ b/renderdoc/driver/shaders/spirv/spirv_debug.h @@ -286,6 +286,7 @@ struct ThreadState // thread-local private variables rdcarray privates; + // This must be a thread safe container // every ID's variable, if a pointer it may be pointing at a ShaderVariable stored elsewhere DenseIdMap ids;