From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- include/private/vkd3d_debug.h | 2 ++ libs/vkd3d-common/debug.c | 4 +++- libs/vkd3d-shader/vkd3d_shader_main.c | 2 ++ libs/vkd3d-utils/vkd3d_utils_main.c | 2 ++ libs/vkd3d/vkd3d_main.c | 2 ++ 5 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/include/private/vkd3d_debug.h b/include/private/vkd3d_debug.h index e5e938dbb3f3..8b4c77db291d 100644 --- a/include/private/vkd3d_debug.h +++ b/include/private/vkd3d_debug.h @@ -57,6 +57,8 @@ const char *debugstr_w(const WCHAR *wstr, size_t wchar_size) DECLSPEC_HIDDEN;
#define TRACE_ON() (vkd3d_dbg_get_level() == VKD3D_DBG_LEVEL_TRACE)
+#define VKD3D_DEBUG_ENV_NAME(name) const char *vkd3d_dbg_env_name = name + static inline const char *debugstr_guid(const GUID *guid) { if (!guid) diff --git a/libs/vkd3d-common/debug.c b/libs/vkd3d-common/debug.c index b8380457058d..ee23ab0f49a8 100644 --- a/libs/vkd3d-common/debug.c +++ b/libs/vkd3d-common/debug.c @@ -28,6 +28,8 @@ #define VKD3D_DEBUG_BUFFER_COUNT 64 #define VKD3D_DEBUG_BUFFER_SIZE 512
+extern const char *vkd3d_dbg_env_name DECLSPEC_HIDDEN; + static const char *debug_level_names[] = { /* VKD3D_DBG_LEVEL_NONE */ "none", @@ -46,7 +48,7 @@ enum vkd3d_dbg_level vkd3d_dbg_get_level(void) if (level != ~0u) return level;
- if (!(vkd3d_debug = getenv("VKD3D_DEBUG"))) + if (!(vkd3d_debug = getenv(vkd3d_dbg_env_name))) vkd3d_debug = "";
for (i = 0; i < ARRAY_SIZE(debug_level_names); ++i) diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index dfd6b726d1d6..071880808755 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -20,6 +20,8 @@
#include <stdio.h>
+VKD3D_DEBUG_ENV_NAME("VKD3D_DEBUG"); + STATIC_ASSERT(MEMBER_SIZE(struct vkd3d_shader_scan_info, uav_counter_mask) * CHAR_BIT >= VKD3D_SHADER_MAX_UNORDERED_ACCESS_VIEWS); STATIC_ASSERT(MEMBER_SIZE(struct vkd3d_shader_scan_info, uav_read_mask) * CHAR_BIT >= VKD3D_SHADER_MAX_UNORDERED_ACCESS_VIEWS);
diff --git a/libs/vkd3d-utils/vkd3d_utils_main.c b/libs/vkd3d-utils/vkd3d_utils_main.c index fa6e5f8f1616..03f9f52261ad 100644 --- a/libs/vkd3d-utils/vkd3d_utils_main.c +++ b/libs/vkd3d-utils/vkd3d_utils_main.c @@ -18,6 +18,8 @@
#include "vkd3d_utils_private.h"
+VKD3D_DEBUG_ENV_NAME("VKD3D_DEBUG"); + HRESULT WINAPI D3D12GetDebugInterface(REFIID iid, void **debug) { FIXME("iid %s, debug %p stub!\n", debugstr_guid(iid), debug); diff --git a/libs/vkd3d/vkd3d_main.c b/libs/vkd3d/vkd3d_main.c index 63dabda06395..ba55056d11f7 100644 --- a/libs/vkd3d/vkd3d_main.c +++ b/libs/vkd3d/vkd3d_main.c @@ -19,6 +19,8 @@ #define INITGUID #include "vkd3d_private.h"
+VKD3D_DEBUG_ENV_NAME("VKD3D_DEBUG"); + HRESULT vkd3d_create_device(const struct vkd3d_device_create_info *create_info, REFIID iid, void **device) {