vkd3d-common: Add support for naming debug environment variable.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2019-01-31 11:29:28 +01:00 committed by Alexandre Julliard
parent 1ae1f831f6
commit 52015b30b3
5 changed files with 11 additions and 1 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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);

View File

@ -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);

View File

@ -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)
{