vkd3d-shader: Allow writing log output via a custom callback.

When using PE vkd3d through Wine, debug output may be swallowed by writing to
Win32 stderr. Avoid this by providing a way to hook up vkd3d log output to Wine
output.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura
2022-06-01 19:01:00 -05:00
committed by Alexandre Julliard
parent 6ff6cb4ed2
commit 174172887b
6 changed files with 52 additions and 2 deletions

View File

@@ -1806,6 +1806,18 @@ VKD3D_SHADER_API void vkd3d_shader_free_shader_signature(struct vkd3d_shader_sig
VKD3D_SHADER_API int vkd3d_shader_preprocess(const struct vkd3d_shader_compile_info *compile_info,
struct vkd3d_shader_code *out, char **messages);
/**
* Set a callback to be called when vkd3d-shader outputs debug logging.
*
* If NULL, or if this function has not been called, libvkd3d-shader will print
* all enabled log output to stderr.
*
* \param callback Callback function to set.
*
* \since 1.4
*/
VKD3D_SHADER_API void vkd3d_shader_set_log_callback(PFN_vkd3d_log callback);
#endif /* VKD3D_SHADER_NO_PROTOTYPES */
/** Type of vkd3d_shader_get_version(). */
@@ -1859,6 +1871,9 @@ typedef void (*PFN_vkd3d_shader_free_shader_signature)(struct vkd3d_shader_signa
typedef void (*PFN_vkd3d_shader_preprocess)(struct vkd3d_shader_compile_info *compile_info,
struct vkd3d_shader_code *out, char **messages);
/** Type of vkd3d_shader_set_log_callback(). \since 1.4 */
typedef void (*PFN_vkd3d_shader_set_log_callback)(PFN_vkd3d_log callback);
#ifdef __cplusplus
}
#endif /* __cplusplus */