On 5/12/22 08:57, Henri Verbeet wrote:
On Tue, 10 May 2022 at 20:21, Matteo Bruni mbruni@codeweavers.com wrote:
Mostly so that the debug primitives don't depend on a shared variable.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
This allows to keep using a separate debug env var for vkd3d-shader even when building vkd3d as static lib(s). That will eventually make it possible to drop the related change in the vkd3d copy imported into Wine.
include/private/vkd3d_debug.h | 32 +++++++++++++++++---------- libs/vkd3d-common/blob.c | 2 ++ libs/vkd3d-common/debug.c | 23 +++++++++---------- libs/vkd3d-common/error.c | 2 ++ libs/vkd3d-common/memory.c | 2 ++ libs/vkd3d-shader/d3dbc.c | 2 ++ libs/vkd3d-shader/dxbc.c | 2 ++ libs/vkd3d-shader/hlsl.c | 2 ++ libs/vkd3d-shader/hlsl.l | 2 ++ libs/vkd3d-shader/hlsl.y | 2 ++ libs/vkd3d-shader/hlsl_codegen.c | 2 ++ libs/vkd3d-shader/hlsl_constant_ops.c | 2 ++ libs/vkd3d-shader/hlsl_sm1.c | 2 ++ libs/vkd3d-shader/hlsl_sm4.c | 2 ++ libs/vkd3d-shader/preproc.l | 2 ++ libs/vkd3d-shader/preproc.y | 2 ++ libs/vkd3d-shader/spirv.c | 2 ++ libs/vkd3d-shader/trace.c | 2 ++ libs/vkd3d-shader/vkd3d_shader_main.c | 2 +- libs/vkd3d/command.c | 2 ++ libs/vkd3d/device.c | 2 ++ libs/vkd3d/resource.c | 2 ++ libs/vkd3d/state.c | 2 ++ libs/vkd3d/utils.c | 2 ++ 24 files changed, 73 insertions(+), 26 deletions(-)
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. 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.
I don't think that defining the environment variable looks right either, but on the other hand I'd like to see multiple channels per module be allowed, along the lines of Wine. E.g. it'd be nice to separate dxbc, spirv, hlsl, preproc. I think that necessitates defining *something* per file.