mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader: Also output vkd3d_shader_vwarning() messages using WARN.
This commit is contained in:
Notes:
Henri Verbeet
2025-05-24 21:47:11 +02:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1494
@@ -358,7 +358,10 @@ void vkd3d_shader_vnote(struct vkd3d_shader_message_context *context, const stru
|
||||
void vkd3d_shader_vwarning(struct vkd3d_shader_message_context *context, const struct vkd3d_shader_location *location,
|
||||
enum vkd3d_shader_error error, const char *format, va_list args)
|
||||
{
|
||||
if (context->log_level < VKD3D_SHADER_LOG_WARNING)
|
||||
struct vkd3d_string_buffer *messages = &context->messages;
|
||||
size_t pos = messages->content_size;
|
||||
|
||||
if (!WARN_ON() && context->log_level < VKD3D_SHADER_LOG_WARNING)
|
||||
return;
|
||||
|
||||
if (location)
|
||||
@@ -366,17 +369,21 @@ void vkd3d_shader_vwarning(struct vkd3d_shader_message_context *context, const s
|
||||
const char *source_name = location->source_name ? location->source_name : "<anonymous>";
|
||||
|
||||
if (location->line)
|
||||
vkd3d_string_buffer_printf(&context->messages, "%s:%u:%u: W%04u: ",
|
||||
vkd3d_string_buffer_printf(messages, "%s:%u:%u: W%04u: ",
|
||||
source_name, location->line, location->column, error);
|
||||
else
|
||||
vkd3d_string_buffer_printf(&context->messages, "%s: W%04u: ", source_name, error);
|
||||
vkd3d_string_buffer_printf(messages, "%s: W%04u: ", source_name, error);
|
||||
}
|
||||
else
|
||||
{
|
||||
vkd3d_string_buffer_printf(&context->messages, "W%04u: ", error);
|
||||
vkd3d_string_buffer_printf(messages, "W%04u: ", error);
|
||||
}
|
||||
vkd3d_string_buffer_vprintf(&context->messages, format, args);
|
||||
vkd3d_string_buffer_printf(&context->messages, "\n");
|
||||
vkd3d_string_buffer_vprintf(messages, format, args);
|
||||
vkd3d_string_buffer_printf(messages, "\n");
|
||||
|
||||
WARN("%.*s", (int)(messages->content_size - pos), &messages->buffer[pos]);
|
||||
if (context->log_level < VKD3D_SHADER_LOG_WARNING)
|
||||
messages->content_size = pos;
|
||||
}
|
||||
|
||||
void vkd3d_shader_warning(struct vkd3d_shader_message_context *context, const struct vkd3d_shader_location *location,
|
||||
|
Reference in New Issue
Block a user