1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-30 02:52:10 +01:00

[dxvk] Added environment variable to toggle debug layers

This commit is contained in:
Philip Rebohle 2017-12-08 01:32:02 +01:00
parent b7723ad6f6
commit 9e1cf8396b
6 changed files with 15 additions and 22 deletions

View File

@ -34,4 +34,6 @@ DXVK will create a file `dxgi.log` in the current working directory and may prin
### Environment variables
The behaviour of DXVK can be modified with environment variables.
- `DXVK_SHADER_DUMP_PATH=directory` Writes all DXBC and SPIR-V shaders to `directory`
- `DXVK_SHADER_DUMP_PATH=directory` Writes all DXBC and SPIR-V shaders to the given directory
- `DXVK_SHADER_READS_PATH=directory` Reads SPIR-V shaders from the given directory instead of compiling the DXBC shader.
- `DXVK_DEBUG_LAYERS=1` Enables Vulkan debug layers. Highly recommended for troubleshooting and debugging purposes.

View File

@ -3,22 +3,6 @@
namespace dxvk {
static std::string GetEnvVar(LPCWSTR name) {
DWORD len = ::GetEnvironmentVariableW(name, nullptr, 0);
std::wstring result;
while (len > result.size()) {
result.resize(len);
len = ::GetEnvironmentVariableW(
name, result.data(), result.size());
}
result.resize(len);
return str::fromws(result);
}
D3D11ShaderModule:: D3D11ShaderModule() { }
D3D11ShaderModule::~D3D11ShaderModule() { }
@ -41,8 +25,8 @@ namespace dxvk {
// If requested by the user, dump both the raw DXBC
// shader and the compiled SPIR-V module to a file.
const std::string dumpPath = GetEnvVar(L"DXVK_SHADER_DUMP_PATH");
const std::string readPath = GetEnvVar(L"DXVK_SHADER_READ_PATH");
const std::string dumpPath = env::getEnvVar(L"DXVK_SHADER_DUMP_PATH");
const std::string readPath = env::getEnvVar(L"DXVK_SHADER_READ_PATH");
if (dumpPath.size() != 0) {
const std::string baseName = str::format(dumpPath, "/",

View File

@ -5,6 +5,8 @@
#include "../util/sha1/sha1_util.h"
#include "../util/util_env.h"
#include "d3d11_device_child.h"
#include "d3d11_interfaces.h"

View File

@ -3,6 +3,7 @@
#include "../util/log/log.h"
#include "../util/log/log_debug.h"
#include "../util/util_env.h"
#include "../util/util_error.h"
#include "../util/util_flags.h"
#include "../util/util_string.h"

View File

@ -67,9 +67,11 @@ namespace dxvk {
vk::NameList DxvkInstance::getLayers() {
std::vector<const char*> layers = {
"VK_LAYER_LUNARG_standard_validation"
};
std::vector<const char*> layers = { };
if (env::getEnvVar(L"DXVK_DEBUG_LAYERS") == "1")
layers.push_back("VK_LAYER_LUNARG_standard_validation");
const vk::NameSet layersAvailable
= vk::NameSet::enumerateInstanceLayers(*m_vkl);

View File

@ -1,4 +1,6 @@
util_src = files([
'util_env.cpp',
'com/com_guid.cpp',
'com/com_private_data.cpp',