From: Conor McCarthy cmccarthy@codeweavers.com
--- libs/vkd3d-common/debug.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/libs/vkd3d-common/debug.c b/libs/vkd3d-common/debug.c index 499334a3..a8091161 100644 --- a/libs/vkd3d-common/debug.c +++ b/libs/vkd3d-common/debug.c @@ -105,7 +105,11 @@ void vkd3d_dbg_printf(enum vkd3d_dbg_level level, const char *function, const ch
assert(level < ARRAY_SIZE(debug_level_names));
+#ifdef _WIN32 + vkd3d_dbg_output("%04lx:vkd3d:%s:%s ", GetCurrentThreadId(), debug_level_names[level], function); +#else vkd3d_dbg_output("vkd3d:%s:%s ", debug_level_names[level], function); +#endif va_start(args, fmt); vkd3d_dbg_voutput(fmt, args); va_end(args);
It makes sense to me, given that D3D12 encourages applications to use multiple threads to interact with the driver. Actually, couldn't the same be done for Linux, showing the thread ID obtained with `gettid()`? Or maybe `syscall(SYS_gettid)`, to be compatible with older glibc versions.
This merge request was approved by Giovanni Mascellani.
It would be useful for distinguishing threads using vkd3d, but also a bit confusing because the ids won't match those displayed by Wine.
It would be useful for distinguishing threads using vkd3d, but also a bit confusing because the ids won't match those displayed by Wine.
I think Giovanni's point is to use gettid() on non-Windows platforms? It does seem like it shouldn't block this patch.
For use outside Wine, yes that makes sense. It doesn't look like using a vkd3d ELF build in Wine will return anytime soon.
Linux thread id can be added later though.
I think Giovanni's point is to use gettid() on non-Windows platforms? It does seem like it shouldn't block this patch.
Agree to both.
Linux thread id can be added later though.
I suppose, though I'm not sure there's much of a point in deferring it.
I think the tid should come after the "vkd3d:" prefix? That prefix was added in 58c7c4b8064f4db7d6dc982cf08aa47d986a6913 to distinguish vkd3d output from output from applications or other libraries; I imagine we'd like to keep it at the front.