vkd3d: Add VKD3D_VULKAN_DEVICE 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-03-14 11:34:56 +01:00
committed by Alexandre Julliard
parent 3629bc1ca9
commit 05666d3385
3 changed files with 40 additions and 8 deletions

View File

@@ -20,10 +20,11 @@
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#define VKD3D_DEBUG_BUFFER_COUNT 64
#define VKD3D_DEBUG_BUFFER_SIZE 512
@@ -297,3 +298,20 @@ const char *debugstr_w(const WCHAR *wstr, size_t wchar_size)
return debugstr_w16((const uint16_t *)wstr);
return debugstr_w32((const uint32_t *)wstr);
}
unsigned int vkd3d_env_var_as_uint(const char *name, unsigned int default_value)
{
const char *value = getenv(name);
unsigned long r;
char *end_ptr;
if (value)
{
errno = 0;
r = strtoul(value, &end_ptr, 0);
if (!errno && end_ptr != value)
return r;
}
return default_value;
}