#include "vkd3d_common.h"
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
|
| enum | vkd3d_dbg_level {
VKD3D_DBG_LEVEL_NONE
, VKD3D_DBG_LEVEL_MESSAGE
, VKD3D_DBG_LEVEL_ERR
, VKD3D_DBG_LEVEL_FIXME
,
VKD3D_DBG_LEVEL_WARN
, VKD3D_DBG_LEVEL_TRACE
, VKD3D_DBG_LEVEL_NONE
, VKD3D_DBG_LEVEL_ERR
,
VKD3D_DBG_LEVEL_FIXME
, VKD3D_DBG_LEVEL_WARN
, VKD3D_DBG_LEVEL_TRACE
} |
| |
|
| enum vkd3d_dbg_level | vkd3d_dbg_get_level (void) |
| |
| void | vkd3d_dbg_printf (enum vkd3d_dbg_level level, const char *function, const char *fmt,...) VKD3D_PRINTF_FUNC(3 |
| |
| void void | vkd3d_dbg_set_log_callback (PFN_vkd3d_log callback) |
| |
| const char * | vkd3d_dbg_sprintf (const char *fmt,...) VKD3D_PRINTF_FUNC(1 |
| |
| const char const char * | vkd3d_dbg_vsprintf (const char *fmt, va_list args) |
| |
| const char * | debugstr_a (const char *str) |
| |
| const char * | debugstr_an (const char *str, size_t n) |
| |
| const char * | debugstr_w (const WCHAR *wstr, size_t wchar_size) |
| |
| static const char * | debugstr_guid (const GUID *guid) |
| |
| static const char * | debugstr_hresult (HRESULT hr) |
| |
| unsigned int | vkd3d_env_var_as_uint (const char *name, unsigned int default_value) |
| |
| bool | vkd3d_debug_list_has_member (const char *string, const char *member) |
| |
| uint64_t | vkd3d_parse_debug_options (const char *string, const struct vkd3d_debug_option *options, unsigned int option_count) |
| |
| void | vkd3d_set_thread_name (const char *name) |
| |
◆ ERR
◆ FIXME_ONCE
◆ TO_STR
◆ VKD3D_DBG_LOG
Value: do { \
#define VKD3D_DBG_PRINTF(...)
Definition at line 58 of file vkd3d_debug.h.
◆ VKD3D_DBG_LOG_ONCE
Value: do { \
static bool vkd3d_dbg_next_time; \
? VKD3D_DBG_LEVEL_##
level : VKD3D_DBG_LEVEL_##first_time_level; \
vkd3d_dbg_next_time = true; \
Definition at line 63 of file vkd3d_debug.h.
◆ VKD3D_DBG_PRINTF
◆ VKD3D_DEBUG_ENV_NAME
◆ vkd3d_dbg_level
| Enumerator |
|---|
| VKD3D_DBG_LEVEL_NONE | |
| VKD3D_DBG_LEVEL_MESSAGE | |
| VKD3D_DBG_LEVEL_ERR | |
| VKD3D_DBG_LEVEL_FIXME | |
| VKD3D_DBG_LEVEL_WARN | |
| VKD3D_DBG_LEVEL_TRACE | |
| VKD3D_DBG_LEVEL_NONE | |
| VKD3D_DBG_LEVEL_ERR | |
| VKD3D_DBG_LEVEL_FIXME | |
| VKD3D_DBG_LEVEL_WARN | |
| VKD3D_DBG_LEVEL_TRACE | |
Definition at line 38 of file vkd3d_debug.h.
◆ debugstr_a()
Definition at line 222 of file debug.c.
223{
225}
const char * debugstr_an(const char *str, size_t n)
◆ debugstr_an()
Definition at line 173 of file debug.c.
174{
176 int escape_char;
178
180 return "(null)";
183
185
188 {
190
192 {
194 *
ptr++ = escape_char;
195 continue;
196 }
197
199 {
201 }
202 else
203 {
207 }
208 }
210
212 {
216 }
218
220}
_ACRTIMP size_t __cdecl strlen(const char *)
#define VKD3D_DEBUG_BUFFER_SIZE
static char * get_buffer(void)
static int get_escape_char(int c)
Referenced by debugstr_a().
◆ debugstr_guid()
Definition at line 100 of file vkd3d_debug.h.
101{
103 return "(null)";
104
109}
const char * vkd3d_dbg_sprintf(const char *fmt,...) VKD3D_PRINTF_FUNC(1
◆ debugstr_hresult()
Definition at line 111 of file vkd3d_debug.h.
112{
114 {
115#define TO_STR(u) case u: return #u;
128#undef TO_STR
129 default:
131 }
132}
#define DXGI_ERROR_NOT_FOUND
#define DXGI_ERROR_UNSUPPORTED
#define DXGI_ERROR_MORE_DATA
◆ debugstr_w()
Definition at line 319 of file debug.c.
320{
321 if (wchar_size == 2)
324}
static const char * debugstr_w32(const uint32_t *wstr)
static const char * debugstr_w16(const uint16_t *wstr)
◆ vkd3d_dbg_get_level()
Definition at line 55 of file debug.c.
56{
57 static unsigned int level = ~0
u;
58 const char *vkd3d_debug;
60
63
65 vkd3d_debug = "";
66
68 {
70 {
73 }
74 }
75
76
79}
char *CDECL getenv(const char *name)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
static const char *const debug_level_names[]
const char *const vkd3d_dbg_env_name
Referenced by vkd3d_dbg_printf().
◆ vkd3d_dbg_printf()
◆ vkd3d_dbg_set_log_callback()
Definition at line 119 of file debug.c.
120{
122}
static IPrintDialogCallback callback
static PFN_vkd3d_log log_callback
◆ vkd3d_dbg_sprintf()
◆ vkd3d_dbg_vsprintf()
◆ vkd3d_debug_list_has_member()
Definition at line 348 of file debug.c.
349{
350 char prev_char, next_char;
352
355 {
357 {
358 prev_char =
p >
string ?
p[-1] : 0;
361
363 return true;
364 }
365 }
366
367 return false;
368}
_ACRTIMP char *__cdecl strstr(const char *, const char *)
static bool is_option_separator(char c)
Referenced by vkd3d_parse_debug_options().
◆ vkd3d_env_var_as_uint()
Definition at line 326 of file debug.c.
327{
330 char *end_ptr;
331
333 {
338 }
339
340 return default_value;
341}
_ACRTIMP __msvcrt_ulong __cdecl strtoul(const char *, char **, int)
GLdouble GLdouble GLdouble r
◆ vkd3d_parse_debug_options()
Definition at line 370 of file debug.c.
372{
375
376 for (
i = 0;
i < option_count; ++
i)
377 {
379
382 }
383
385}
bool vkd3d_debug_list_has_member(const char *string, const char *member)
◆ vkd3d_set_thread_name()
Definition at line 405 of file debug.c.
406{
407#ifdef _WIN32
411
413 if (!pfn_SetThreadDescription)
414 return;
415
417 return;
418
420 return;
421
424
426#elif defined(HAVE_PTHREAD_SETNAME_NP_2)
427 pthread_setname_np(pthread_self(),
name);
428#elif defined(HAVE_PTHREAD_SETNAME_NP_1)
429 pthread_setname_np(
name);
430#endif
431}
#define MultiByteToWideChar
BOOL WINAPI InitOnceExecuteOnce(_Inout_ PINIT_ONCE InitOnce, _In_ __callback PINIT_ONCE_FN InitFn, _Inout_opt_ PVOID Parameter, _Outptr_opt_result_maybenull_ LPVOID *Context)
static INIT_ONCE init_once
static void vkd3d_free(void *ptr)
static void * vkd3d_malloc(size_t size)
HANDLE WINAPI GetCurrentThread(void)
#define INIT_ONCE_STATIC_INIT