vkd3d: Introduce debug severity MESSAGE.

That's intended for messages that it's pretty important that the
user receives, but that are not proper error messages.
This commit is contained in:
Giovanni Mascellani 2024-07-18 15:17:33 +02:00 committed by Henri Verbeet
parent 021a7f030a
commit a484063cd2
Notes: Henri Verbeet 2024-07-29 13:23:46 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Conor McCarthy (@cmccarthy)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/867
4 changed files with 18 additions and 11 deletions

View File

@ -128,11 +128,13 @@ VKD3D_NORETURN static inline void vkd3d_unreachable_(const char *filename, unsig
#ifdef VKD3D_NO_ERROR_MESSAGES
#define ERR(args...) do { } while (0)
#define MESSAGE(args...) do { } while (0)
#endif
enum vkd3d_dbg_level
{
VKD3D_DBG_LEVEL_NONE,
VKD3D_DBG_LEVEL_MESSAGE,
VKD3D_DBG_LEVEL_ERR,
VKD3D_DBG_LEVEL_FIXME,
VKD3D_DBG_LEVEL_WARN,
@ -167,19 +169,23 @@ const char *debugstr_w(const WCHAR *wstr, size_t wchar_size);
vkd3d_dbg_printf(vkd3d_dbg_level, __FUNCTION__, __VA_ARGS__); } while (0)
#ifndef TRACE
#define TRACE VKD3D_DBG_LOG(TRACE)
#define TRACE VKD3D_DBG_LOG(TRACE)
#endif
#ifndef WARN
#define WARN VKD3D_DBG_LOG(WARN)
#define WARN VKD3D_DBG_LOG(WARN)
#endif
#ifndef FIXME
#define FIXME VKD3D_DBG_LOG(FIXME)
#define FIXME VKD3D_DBG_LOG(FIXME)
#endif
#ifndef ERR
#define ERR VKD3D_DBG_LOG(ERR)
#define ERR VKD3D_DBG_LOG(ERR)
#endif
#ifndef MESSAGE
#define MESSAGE VKD3D_DBG_LOG(MESSAGE)
#endif
#ifndef TRACE_ON

View File

@ -45,11 +45,12 @@ extern const char *const vkd3d_dbg_env_name;
static const char *const debug_level_names[] =
{
[VKD3D_DBG_LEVEL_NONE ] = "none",
[VKD3D_DBG_LEVEL_ERR ] = "err",
[VKD3D_DBG_LEVEL_FIXME] = "fixme",
[VKD3D_DBG_LEVEL_WARN ] = "warn",
[VKD3D_DBG_LEVEL_TRACE] = "trace",
[VKD3D_DBG_LEVEL_NONE ] = "none",
[VKD3D_DBG_LEVEL_MESSAGE] = "message",
[VKD3D_DBG_LEVEL_ERR ] = "err",
[VKD3D_DBG_LEVEL_FIXME] = "fixme",
[VKD3D_DBG_LEVEL_WARN ] = "warn",
[VKD3D_DBG_LEVEL_TRACE] = "trace",
};
enum vkd3d_dbg_level vkd3d_dbg_get_level(void)

View File

@ -10541,7 +10541,7 @@ int dxil_parse(const struct vkd3d_shader_compile_info *compile_info, uint64_t co
uint32_t *byte_code = NULL;
int ret;
ERR("Creating a DXIL parser. This is unsupported; you get to keep all the pieces if it breaks.\n");
MESSAGE("Creating a DXIL parser. This is unsupported; you get to keep all the pieces if it breaks.\n");
dxbc_desc.is_dxil = true;
if ((ret = shader_extract_from_dxbc(&compile_info->source, message_context, compile_info->source_name,

View File

@ -97,7 +97,7 @@ static int vkd3d_glsl_generator_generate(struct vkd3d_glsl_generator *gen, struc
unsigned int i;
void *code;
ERR("Generating a GLSL shader. This is unsupported; you get to keep all the pieces if it breaks.\n");
MESSAGE("Generating a GLSL shader. This is unsupported; you get to keep all the pieces if it breaks.\n");
vkd3d_string_buffer_printf(buffer, "#version 440\n\n");