mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
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:
committed by
Alexandre Julliard
parent
3629bc1ca9
commit
05666d3385
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user