On Thu, May 12, 2022 at 4:12 PM Giovanni Mascellani gmascellani@codeweavers.com wrote:
Hi,
As I see it, it's not very different from having a WINE_DEFAULT_DEBUG_CHANNEL in each file, just as we do with Wine. Actually, my suggestion would be to really transition to that model, which is more flexible (there can be more than one debug channel per file).
Right. I saw my current patches as a step in that direction. I could certainly take care of that part too.
Il 12/05/22 15:57, Henri Verbeet ha scritto:
I can't say I like this solution. In particular, sprinkling VKD3D_DEBUG_ENV_NAME through the source seems undesirable. It should be possible to do this in a way that allows defining the environment variable only once per module.
The point of this series is to avoid global variables, which is the cause of the VKD3D_SHADER_DEBUG -> VKD3D_DEBUG change in the vkd3d version integrated into Wine, and which is something that I found confusing (i.e. to get vkd3d-shader debug output you have to use different env vars depending if you're using integrated vs separate vkd3d) besides of the intention of just reducing the diff with upstream vkd3d. Patches 2-5 are preparation for patch 6, moving all the code calling the debug trace functions out of header files.
Separately, for the Wine integration, I think it would make more sense to integrate with Wine's debug facilities, so that e.g. WINEDEBUG=+d3d_shader and WINEDEBUG=+d3d12 simply do the right thing.
That's an interesting idea, I'll start hacking on it.