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.