mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-06 22:54:16 +01:00
[dxvk] Added environment variable to toggle debug layers
This commit is contained in:
parent
b7723ad6f6
commit
9e1cf8396b
@ -34,4 +34,6 @@ DXVK will create a file `dxgi.log` in the current working directory and may prin
|
|||||||
### Environment variables
|
### Environment variables
|
||||||
The behaviour of DXVK can be modified with 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.
|
@ -3,22 +3,6 @@
|
|||||||
|
|
||||||
namespace dxvk {
|
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() { }
|
||||||
D3D11ShaderModule::~D3D11ShaderModule() { }
|
D3D11ShaderModule::~D3D11ShaderModule() { }
|
||||||
|
|
||||||
@ -41,8 +25,8 @@ namespace dxvk {
|
|||||||
|
|
||||||
// If requested by the user, dump both the raw DXBC
|
// If requested by the user, dump both the raw DXBC
|
||||||
// shader and the compiled SPIR-V module to a file.
|
// shader and the compiled SPIR-V module to a file.
|
||||||
const std::string dumpPath = GetEnvVar(L"DXVK_SHADER_DUMP_PATH");
|
const std::string dumpPath = env::getEnvVar(L"DXVK_SHADER_DUMP_PATH");
|
||||||
const std::string readPath = GetEnvVar(L"DXVK_SHADER_READ_PATH");
|
const std::string readPath = env::getEnvVar(L"DXVK_SHADER_READ_PATH");
|
||||||
|
|
||||||
if (dumpPath.size() != 0) {
|
if (dumpPath.size() != 0) {
|
||||||
const std::string baseName = str::format(dumpPath, "/",
|
const std::string baseName = str::format(dumpPath, "/",
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
#include "../util/sha1/sha1_util.h"
|
#include "../util/sha1/sha1_util.h"
|
||||||
|
|
||||||
|
#include "../util/util_env.h"
|
||||||
|
|
||||||
#include "d3d11_device_child.h"
|
#include "d3d11_device_child.h"
|
||||||
#include "d3d11_interfaces.h"
|
#include "d3d11_interfaces.h"
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include "../util/log/log.h"
|
#include "../util/log/log.h"
|
||||||
#include "../util/log/log_debug.h"
|
#include "../util/log/log_debug.h"
|
||||||
|
|
||||||
|
#include "../util/util_env.h"
|
||||||
#include "../util/util_error.h"
|
#include "../util/util_error.h"
|
||||||
#include "../util/util_flags.h"
|
#include "../util/util_flags.h"
|
||||||
#include "../util/util_string.h"
|
#include "../util/util_string.h"
|
||||||
|
@ -67,9 +67,11 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
vk::NameList DxvkInstance::getLayers() {
|
vk::NameList DxvkInstance::getLayers() {
|
||||||
std::vector<const char*> layers = {
|
std::vector<const char*> layers = { };
|
||||||
"VK_LAYER_LUNARG_standard_validation"
|
|
||||||
};
|
if (env::getEnvVar(L"DXVK_DEBUG_LAYERS") == "1")
|
||||||
|
layers.push_back("VK_LAYER_LUNARG_standard_validation");
|
||||||
|
|
||||||
|
|
||||||
const vk::NameSet layersAvailable
|
const vk::NameSet layersAvailable
|
||||||
= vk::NameSet::enumerateInstanceLayers(*m_vkl);
|
= vk::NameSet::enumerateInstanceLayers(*m_vkl);
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
util_src = files([
|
util_src = files([
|
||||||
|
'util_env.cpp',
|
||||||
|
|
||||||
'com/com_guid.cpp',
|
'com/com_guid.cpp',
|
||||||
'com/com_private_data.cpp',
|
'com/com_private_data.cpp',
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user