#include <stdlib.h>
#include <windows.h>
+#include <shlobj.h>
#include <directx/d3d12sdklayers.h>
{ "gbv", DZN_DEBUG_GBV },
{ "d3d12", DZN_DEBUG_D3D12 },
{ "debugger", DZN_DEBUG_DEBUGGER },
+ { "redirects", DZN_DEBUG_REDIRECTS },
{ NULL, 0 }
};
}
}
+ if (instance->debug_flags & DZN_DEBUG_REDIRECTS) {
+ char home[MAX_PATH], path[MAX_PATH];
+ if (SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_PROFILE, NULL, 0, home))) {
+ snprintf(path, sizeof(path), "%s\\stderr.txt", home);
+ freopen(path, "w", stderr);
+ snprintf(path, sizeof(path), "%s\\stdout.txt", home);
+ freopen(path, "w", stdout);
+ }
+ }
+
instance->dxil_validator = dxil_create_validator(NULL);
instance->d3d12.serialize_root_sig = d3d12_get_serialize_root_sig();