From f2bf8ccb2e5ea55c23c035e75ced1160416ed48a Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Fri, 9 May 2025 11:15:00 -0700 Subject: [PATCH] layer color coverage / usage in thread colors --- src/async/async.c | 3 +++ src/base/base_inc.c | 4 ++-- src/base/base_markup.h | 7 ++++-- src/base/base_profile.h | 40 ++++++++++++++----------------- src/base/base_thread_context.h | 2 +- src/ctrl/ctrl_inc.c | 3 +++ src/dasm_cache/dasm_cache.c | 3 +++ src/dbg_engine/dbg_engine_core.c | 4 ++-- src/dbgi/dbgi.c | 3 +++ src/file_stream/file_stream.c | 3 +++ src/geo_cache/geo_cache.c | 3 +++ src/hash_store/hash_store.c | 3 +++ src/mutable_text/mutable_text.c | 3 +++ src/raddbg/raddbg_core.c | 4 ++-- src/render/d3d11/render_d3d11.c | 3 --- src/render/render_inc.c | 3 +++ src/text_cache/text_cache.c | 3 +++ src/texture_cache/texture_cache.c | 3 +++ src/ui/ui_core.c | 3 --- src/ui/ui_inc.c | 4 ++-- 20 files changed, 65 insertions(+), 39 deletions(-) diff --git a/src/async/async.c b/src/async/async.c index 9e8cda09..75c1318e 100644 --- a/src/async/async.c +++ b/src/async/async.c @@ -1,6 +1,9 @@ // Copyright (c) 2024 Epic Games Tools // Licensed under the MIT license (https://opensource.org/license/mit/) +#undef LAYER_COLOR +#define LAYER_COLOR 0x59b6c3ff + //////////////////////////////// //~ rjf: Top-Level Layer Initialization diff --git a/src/base/base_inc.c b/src/base/base_inc.c index dc2916bf..299d9042 100644 --- a/src/base/base_inc.c +++ b/src/base/base_inc.c @@ -4,8 +4,8 @@ //////////////////////////////// //~ rjf: Base Includes -#undef MARKUP_LAYER_COLOR -#define MARKUP_LAYER_COLOR 0.20f, 0.60f, 0.80f +#undef LAYER_COLOR +#define LAYER_COLOR 0.20f, 0.60f, 0.80f #include "base_core.c" #include "base_profile.c" diff --git a/src/base/base_markup.h b/src/base/base_markup.h index 8a1c6578..db63f545 100644 --- a/src/base/base_markup.h +++ b/src/base/base_markup.h @@ -8,9 +8,12 @@ #define RADDBG_MARKUP_VSNPRINTF raddbg_vsnprintf #include "lib_raddbg_markup/raddbg_markup.h" +#if !defined(LAYER_COLOR) +# define LAYER_COLOR 0x404040ff +#endif + internal void set_thread_name(String8 string); internal void set_thread_namef(char *fmt, ...); -#define ThreadNameF(...) (set_thread_namef(__VA_ARGS__)) -#define ThreadName(str) (set_thread_name(str)) +#define ThreadNameF(...) (set_thread_namef(__VA_ARGS__), raddbg_thread_color_u32(LAYER_COLOR)) #endif // BASE_MARKUP_H diff --git a/src/base/base_profile.h b/src/base/base_profile.h index 098270f4..b39a2fc5 100644 --- a/src/base/base_profile.h +++ b/src/base/base_profile.h @@ -11,10 +11,6 @@ # define PROFILE_TELEMETRY 0 #endif -#if !defined(MARKUP_LAYER_COLOR) -# define MARKUP_LAYER_COLOR 1.00f, 0.00f, 1.00f -#endif - //////////////////////////////// //~ rjf: Third Party Includes @@ -44,25 +40,25 @@ # define ProfLockDrop(...) tmReleasedLock(0, __VA_ARGS__) # define ProfColor(color) tmZoneColorSticky(color) # define ProfBeginV(...) \ - if (TM_API_PTR) { \ - static tm_uint64 file_id = 0; TM_API_PTR->_tmStaticString(&file_id, __FILE__); \ - Temp scratch = scratch_begin(0,0); \ - String8 string = push_str8f(scratch.arena, __VA_ARGS__); \ - tm_uint64 hash = TM_API_PTR->_tmHash((char*)string.str, string.size); \ - hash = TM_API_PTR->_tmSendDynamicString(hash, (char*)string.str); \ - TM_API_PTR->_tmEnterZoneFast_Core(0, 0, file_id, __LINE__, hash); \ - scratch_end(scratch); \ - } +if (TM_API_PTR) { \ +static tm_uint64 file_id = 0; TM_API_PTR->_tmStaticString(&file_id, __FILE__); \ +Temp scratch = scratch_begin(0,0); \ +String8 string = push_str8f(scratch.arena, __VA_ARGS__); \ +tm_uint64 hash = TM_API_PTR->_tmHash((char*)string.str, string.size); \ +hash = TM_API_PTR->_tmSendDynamicString(hash, (char*)string.str); \ +TM_API_PTR->_tmEnterZoneFast_Core(0, 0, file_id, __LINE__, hash); \ +scratch_end(scratch); \ +} # define ProfNoteV(...) \ - if (TM_API_PTR) { \ - static tm_uint64 file_id = 0; TM_API_PTR->_tmStaticString(&file_id, __FILE__); \ - Temp scratch = scratch_begin(0,0); \ - String8 string = push_str8f(scratch.arena, __VA_ARGS__); \ - tm_uint64 hash = TM_API_PTR->_tmHash((char*)string.str, string.size); \ - hash = TM_API_PTR->_tmSendDynamicString(hash, (char*)string.str); \ - TM_API_PTR->_tmMessageFast_Core(0, TMMF_ICON_NOTE, file_id, __LINE__, hash); \ - scratch_end(scratch); \ - } +if (TM_API_PTR) { \ +static tm_uint64 file_id = 0; TM_API_PTR->_tmStaticString(&file_id, __FILE__); \ +Temp scratch = scratch_begin(0,0); \ +String8 string = push_str8f(scratch.arena, __VA_ARGS__); \ +tm_uint64 hash = TM_API_PTR->_tmHash((char*)string.str, string.size); \ +hash = TM_API_PTR->_tmSendDynamicString(hash, (char*)string.str); \ +TM_API_PTR->_tmMessageFast_Core(0, TMMF_ICON_NOTE, file_id, __LINE__, hash); \ +scratch_end(scratch); \ +} #endif //////////////////////////////// diff --git a/src/base/base_thread_context.h b/src/base/base_thread_context.h index b2515c93..90a396fe 100644 --- a/src/base/base_thread_context.h +++ b/src/base/base_thread_context.h @@ -26,7 +26,7 @@ internal void tctx_init_and_equip(TCTX *tctx); internal void tctx_release(void); internal TCTX* tctx_get_equipped(void); -internal Arena* tctx_get_scratch(Arena **conflicts, U64 countt); +internal Arena* tctx_get_scratch(Arena **conflicts, U64 count); internal void tctx_set_thread_name(String8 name); internal String8 tctx_get_thread_name(void); diff --git a/src/ctrl/ctrl_inc.c b/src/ctrl/ctrl_inc.c index ce59e6dc..d2dcdb61 100644 --- a/src/ctrl/ctrl_inc.c +++ b/src/ctrl/ctrl_inc.c @@ -1,4 +1,7 @@ // Copyright (c) 2024 Epic Games Tools // Licensed under the MIT license (https://opensource.org/license/mit/) +#undef LAYER_COLOR +#define LAYER_COLOR 0x969696ff + #include "ctrl_core.c" diff --git a/src/dasm_cache/dasm_cache.c b/src/dasm_cache/dasm_cache.c index d3360793..3c937b37 100644 --- a/src/dasm_cache/dasm_cache.c +++ b/src/dasm_cache/dasm_cache.c @@ -1,6 +1,9 @@ // Copyright (c) 2024 Epic Games Tools // Licensed under the MIT license (https://opensource.org/license/mit/) +#undef LAYER_COLOR +#define LAYER_COLOR 0xe34cd4ff + //////////////////////////////// //~ rjf: Instruction Decoding/Disassembling Type Functions diff --git a/src/dbg_engine/dbg_engine_core.c b/src/dbg_engine/dbg_engine_core.c index 62e34f2b..f8b15ef2 100644 --- a/src/dbg_engine/dbg_engine_core.c +++ b/src/dbg_engine/dbg_engine_core.c @@ -1,8 +1,8 @@ // Copyright (c) 2024 Epic Games Tools // Licensed under the MIT license (https://opensource.org/license/mit/) -#undef MARKUP_LAYER_COLOR -#define MARKUP_LAYER_COLOR 0.70f, 0.50f, 0.25f +#undef LAYER_COLOR +#define LAYER_COLOR 0x4d9ae3ff //////////////////////////////// //~ rjf: Generated Code diff --git a/src/dbgi/dbgi.c b/src/dbgi/dbgi.c index f790a166..4aea445c 100644 --- a/src/dbgi/dbgi.c +++ b/src/dbgi/dbgi.c @@ -1,6 +1,9 @@ // Copyright (c) 2024 Epic Games Tools // Licensed under the MIT license (https://opensource.org/license/mit/) +#undef LAYER_COLOR +#define LAYER_COLOR 0x7c4ce3ff + //////////////////////////////// //~ rjf: Basic Helpers diff --git a/src/file_stream/file_stream.c b/src/file_stream/file_stream.c index 792bc6d7..3229a321 100644 --- a/src/file_stream/file_stream.c +++ b/src/file_stream/file_stream.c @@ -1,6 +1,9 @@ // Copyright (c) 2024 Epic Games Tools // Licensed under the MIT license (https://opensource.org/license/mit/) +#undef LAYER_COLOR +#define LAYER_COLOR 0xfffa00ff + //////////////////////////////// //~ rjf: Basic Helpers diff --git a/src/geo_cache/geo_cache.c b/src/geo_cache/geo_cache.c index 530e6f7a..1af64fec 100644 --- a/src/geo_cache/geo_cache.c +++ b/src/geo_cache/geo_cache.c @@ -1,6 +1,9 @@ // Copyright (c) 2024 Epic Games Tools // Licensed under the MIT license (https://opensource.org/license/mit/) +#undef LAYER_COLOR +#define LAYER_COLOR 0xe34cd4ff + //////////////////////////////// //~ rjf: Main Layer Initialization diff --git a/src/hash_store/hash_store.c b/src/hash_store/hash_store.c index 587a45c0..8296ec38 100644 --- a/src/hash_store/hash_store.c +++ b/src/hash_store/hash_store.c @@ -1,6 +1,9 @@ // Copyright (c) 2024 Epic Games Tools // Licensed under the MIT license (https://opensource.org/license/mit/) +#undef LAYER_COLOR +#define LAYER_COLOR 0x684123ff + //////////////////////////////// //~ rjf: Basic Helpers diff --git a/src/mutable_text/mutable_text.c b/src/mutable_text/mutable_text.c index 61b6dc9b..006ea601 100644 --- a/src/mutable_text/mutable_text.c +++ b/src/mutable_text/mutable_text.c @@ -1,6 +1,9 @@ // Copyright (c) 2024 Epic Games Tools // Licensed under the MIT license (https://opensource.org/license/mit/) +#undef LAYER_COLOR +#define LAYER_COLOR 0xb8a06bff + //////////////////////////////// //~ rjf: Main Layer Initialization diff --git a/src/raddbg/raddbg_core.c b/src/raddbg/raddbg_core.c index 273dce16..535c8f68 100644 --- a/src/raddbg/raddbg_core.c +++ b/src/raddbg/raddbg_core.c @@ -1,8 +1,8 @@ // Copyright (c) 2024 Epic Games Tools // Licensed under the MIT license (https://opensource.org/license/mit/) -#undef MARKUP_LAYER_COLOR -#define MARKUP_LAYER_COLOR 0.10f, 0.20f, 0.25f +#undef LAYER_COLOR +#define LAYER_COLOR 0xf0a215ff //////////////////////////////// //~ rjf: Generated Code diff --git a/src/render/d3d11/render_d3d11.c b/src/render/d3d11/render_d3d11.c index d4cdd22c..f3ba394c 100644 --- a/src/render/d3d11/render_d3d11.c +++ b/src/render/d3d11/render_d3d11.c @@ -1,9 +1,6 @@ // Copyright (c) 2024 Epic Games Tools // Licensed under the MIT license (https://opensource.org/license/mit/) -#undef MARKUP_LAYER_COLOR -#define MARKUP_LAYER_COLOR 0.80f, 0.60f, 0.20f - //////////////////////////////// //~ rjf: Input Layout Element Tables diff --git a/src/render/render_inc.c b/src/render/render_inc.c index 84612fa8..52e5c365 100644 --- a/src/render/render_inc.c +++ b/src/render/render_inc.c @@ -1,6 +1,9 @@ // Copyright (c) 2024 Epic Games Tools // Licensed under the MIT license (https://opensource.org/license/mit/) +#undef LAYER_COLOR +#define LAYER_COLOR 0xc22121ff + #include "render_core.c" #if R_BACKEND == R_BACKEND_STUB diff --git a/src/text_cache/text_cache.c b/src/text_cache/text_cache.c index 7a1fae94..e8c5da5c 100644 --- a/src/text_cache/text_cache.c +++ b/src/text_cache/text_cache.c @@ -1,6 +1,9 @@ // Copyright (c) 2024 Epic Games Tools // Licensed under the MIT license (https://opensource.org/license/mit/) +#undef LAYER_COLOR +#define LAYER_COLOR 0xe34cd4ff + //////////////////////////////// //~ rjf: Basic Helpers diff --git a/src/texture_cache/texture_cache.c b/src/texture_cache/texture_cache.c index 8a663a5c..bca74e24 100644 --- a/src/texture_cache/texture_cache.c +++ b/src/texture_cache/texture_cache.c @@ -1,6 +1,9 @@ // Copyright (c) 2024 Epic Games Tools // Licensed under the MIT license (https://opensource.org/license/mit/) +#undef LAYER_COLOR +#define LAYER_COLOR 0xe34cd4ff + //////////////////////////////// //~ rjf: Basic Helpers diff --git a/src/ui/ui_core.c b/src/ui/ui_core.c index 75a7cb3a..37887e5d 100644 --- a/src/ui/ui_core.c +++ b/src/ui/ui_core.c @@ -1,9 +1,6 @@ // Copyright (c) 2024 Epic Games Tools // Licensed under the MIT license (https://opensource.org/license/mit/) -#undef MARKUP_LAYER_COLOR -#define MARKUP_LAYER_COLOR 0.80f, 0.40f, 0.35f - //////////////////////////////// //~ rjf: Globals diff --git a/src/ui/ui_inc.c b/src/ui/ui_inc.c index 7d4e8378..c9bed64e 100644 --- a/src/ui/ui_inc.c +++ b/src/ui/ui_inc.c @@ -1,8 +1,8 @@ // Copyright (c) 2024 Epic Games Tools // Licensed under the MIT license (https://opensource.org/license/mit/) -#undef MARKUP_LAYER_COLOR -#define MARKUP_LAYER_COLOR 0.70f, 0.30f, 0.15f +#undef LAYER_COLOR +#define LAYER_COLOR 0xb5438dff #include "ui_core.c" #include "ui_basic_widgets.c"