-- v2: wined3d: Use a Wine debug channel for vkd3d debug output.
From: Alexandre Julliard julliard@winehq.org
Avoids spamming stderr when debug output is disabled. --- dlls/wined3d/wined3d_main.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c index 2e4dda2c473..576da8034c9 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,23 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) if (appkey) RegCloseKey( appkey ); if (hkey) RegCloseKey( hkey );
+ if (!getenv( "VKD3D_DEBUG" )) + { + 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" ); + } + if (!getenv( "VKD3D_SHADER_DEBUG" )) + { + if (TRACE_ON(vkd3d)) putenv( "VKD3D_SHADER_DEBUG=trace" ); + else if (WARN_ON(vkd3d)) putenv( "VKD3D_SHADER_DEBUG=warn" ); + else if (FIXME_ON(vkd3d)) putenv( "VKD3D_SHADER_DEBUG=fixme" ); + else if (ERR_ON(vkd3d)) putenv( "VKD3D_SHADER_DEBUG=err" ); + else putenv( "VKD3D_SHADER_DEBUG=none" ); + } + vkd3d_set_log_callback(vkd3d_log_callback);
return TRUE;
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=124886
Your paranoid android.
=== debian11 (build log) ===
Use of uninitialized value $Flaky in addition (+) at /home/testbot/lib/WineTestBot/LogUtils.pm line 720, <$LogFile> line 24682. Use of uninitialized value $Flaky in addition (+) at /home/testbot/lib/WineTestBot/LogUtils.pm line 720, <$LogFile> line 24682. Use of uninitialized value $Flaky in addition (+) at /home/testbot/lib/WineTestBot/LogUtils.pm line 720, <$LogFile> line 24682.
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.
We could do that, yes, I've updated it.
Giovanni Mascellani (@giomasce) commented about dlls/wined3d/wined3d_main.c:
if (appkey) RegCloseKey( appkey ); if (hkey) RegCloseKey( hkey );
- if (!getenv( "VKD3D_DEBUG" ))
- {
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" );
- }
- if (!getenv( "VKD3D_SHADER_DEBUG" ))
- {
if (TRACE_ON(vkd3d)) putenv( "VKD3D_SHADER_DEBUG=trace" );
It wouldn't be bad to use a different channel name for `VKD3D_SHADER_DEBUG`, though. Both `VKD3D_DEBUG` and `VKD3D_SHADER_DEBUG` can be very verbose, so it's not bad to selectively pick the one that you really care about.
It wouldn't be bad to use a different channel name for `VKD3D_SHADER_DEBUG`, though. Both `VKD3D_DEBUG` and `VKD3D_SHADER_DEBUG` can be very verbose, so it's not bad to selectively pick the one that you really care about.
Sure, but the debugging scheme in vkd3d would have to be changed first, the global variable approach doesn't allow supporting multiple channels when linking statically.
This merge request was approved by Zebediah Figura.
Ah, right. But then in which cases is setting `VKD3D_SHADER_DEBUG` useful? When using external DLLs for `vkd3d`?
Ah, right. But then in which cases is setting `VKD3D_SHADER_DEBUG` useful? When using external DLLs for `vkd3d`?
Yes, only in that case.