From: Alexandre Julliard julliard@winehq.org
Avoids spamming stderr when debug output is disabled. --- dlls/wined3d/wined3d_main.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c index 4b718746b6a..e29b966e968 100644 --- a/dlls/wined3d/wined3d_main.c +++ b/dlls/wined3d/wined3d_main.c @@ -30,6 +30,7 @@ #include <vkd3d.h>
WINE_DEFAULT_DEBUG_CHANNEL(d3d); +WINE_DECLARE_DEBUG_CHANNEL(vkd3d); WINE_DECLARE_DEBUG_CHANNEL(winediag);
struct wined3d_wndproc @@ -471,6 +472,12 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) if (appkey) RegCloseKey( appkey ); if (hkey) RegCloseKey( hkey );
+ if (TRACE_ON(vkd3d)) putenv( "VKD3D_DEBUG=trace" ); + else if (WARN_ON(vkd3d)) putenv( "VKD3D_DEBUG=warn" ); + else if (FIXME_ON(vkd3d)) putenv( "VKD3D_DEBUG=fixme" ); + else if (ERR_ON(vkd3d)) putenv( "VKD3D_DEBUG=err" ); + else putenv( "VKD3D_DEBUG=none" ); + vkd3d_set_log_callback(vkd3d_log_callback);
return TRUE;
On 9/29/22 05:35, Alexandre Julliard wrote:
From: Alexandre Julliard julliard@winehq.org
Avoids spamming stderr when debug output is disabled.
@@ -471,6 +472,12 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) if (appkey) RegCloseKey( appkey ); if (hkey) RegCloseKey( hkey );
if (TRACE_ON(vkd3d)) putenv( "VKD3D_DEBUG=trace" );
else if (WARN_ON(vkd3d)) putenv( "VKD3D_DEBUG=warn" );
else if (FIXME_ON(vkd3d)) putenv( "VKD3D_DEBUG=fixme" );
else if (ERR_ON(vkd3d)) putenv( "VKD3D_DEBUG=err" );
else putenv( "VKD3D_DEBUG=none" );
vkd3d_set_log_callback(vkd3d_log_callback); return TRUE;
That's fine, I guess. Of course, you could also just set VKD3D_DEBUG=none, but I'll grant that is a bit more effort...
This somewhat awkwardly misses VKD3D_SHADER_DEBUG, though.
It also will overwrite a VKD3D_DEBUG variable set on the command line. Which is fine to some degree, but may be confusing for someone who wasn't expecting that, so maybe guarding it with "if (!getenv(...))" wouldn't be a bad idea.
This merge request was approved by Jan Sikorski.