Skip to content

Commit 78a7a39

Browse files
committed
Main thread has id UINT32_MAX
1 parent dcd46e6 commit 78a7a39

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/engine/renderer-vulkan/SrcDebug/Tag.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ std::string Tagged( const std::string& message, const bool useThreadID,
5858
Allows either specifying a custom name for an object, or otherwise automatically using the class name */
5959
std::string Tag::Tagged( const std::string& message, const bool useThreadID,
6060
const std::source_location& loc ) {
61-
const std::string threadID = useThreadID ? Str::Format( "Thread %u:", TLM.id ) : "";
61+
const std::string threadID = useThreadID ?
62+
( TLM.id == ThreadMemory::MAIN_ID ? "main" : Str::Format( "Thread %u:", TLM.id ) )
63+
: "";
6264

6365
switch ( r_vkLogExtendedFunctionNames.Get() ) {
6466
case LogExtendedFunctionMode::GLOBAL_NAME:

src/engine/renderer-vulkan/Thread/ThreadMemory.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ struct ChunkAllocator {
8080

8181
class ThreadMemory {
8282
public:
83-
uint32_t id;
83+
static constexpr uint32_t MAIN_ID = UINT32_MAX;
84+
uint32_t id = MAIN_ID;
85+
8486
ChunkAllocator chunkAllocators[MAX_MEMORY_AREAS];
8587

8688
GlobalTimer fetchOuterTimer;

0 commit comments

Comments
 (0)