diff --git a/README.md b/README.md index 5880e4863..50c17f50c 100644 --- a/README.md +++ b/README.md @@ -55,8 +55,6 @@ The behaviour of DXVK can be modified with environment variables. - `DXVK_CUSTOM_DEVICE_ID=` Specifces a custom PCI device identifier (Device ID) - `DXVK_SHADER_DUMP_PATH=directory` Writes all DXBC and SPIR-V shaders to the given directory - `DXVK_SHADER_READ_PATH=directory` Reads SPIR-V shaders from the given directory rather than using the shader compiler. -- `DXVK_SHADER_VALIDATE=1` Enables SPIR-V shader validation. Useful for debugging purposes. -- `DXVK_SHADER_OPTIMIZE=1` Enables SPIR-V shader optimization. Experimental, use with care. - `DXVK_LOG_LEVEL=error|warn|info|debug|trace` Controls message logging. - `DXVK_HUD=1` Enables the HUD diff --git a/lib/libSPIRV-Tools-opt.a b/lib/libSPIRV-Tools-opt.a deleted file mode 100644 index 72e7ee526..000000000 Binary files a/lib/libSPIRV-Tools-opt.a and /dev/null differ diff --git a/lib/libSPIRV-Tools.a b/lib/libSPIRV-Tools.a deleted file mode 100644 index c0118c2fd..000000000 Binary files a/lib/libSPIRV-Tools.a and /dev/null differ diff --git a/lib32/libSPIRV-Tools-opt.a b/lib32/libSPIRV-Tools-opt.a deleted file mode 100644 index bab90d70e..000000000 Binary files a/lib32/libSPIRV-Tools-opt.a and /dev/null differ diff --git a/lib32/libSPIRV-Tools.a b/lib32/libSPIRV-Tools.a deleted file mode 100644 index d0e319974..000000000 Binary files a/lib32/libSPIRV-Tools.a and /dev/null differ diff --git a/meson.build b/meson.build index 95f15152d..9557e5162 100644 --- a/meson.build +++ b/meson.build @@ -18,13 +18,10 @@ else dxvk_library_path = meson.source_root() + '/lib32' endif -lib_vulkan = dxvk_compiler.find_library('vulkan-1', dirs : dxvk_library_path) +lib_vulkan = dxvk_compiler.find_library('vulkan-1', dirs : dxvk_library_path) +lib_d3d11 = dxvk_compiler.find_library('d3d11') +lib_dxgi = dxvk_compiler.find_library('dxgi') -lib_spirvtools = dxvk_compiler.find_library('libSPIRV-Tools', dirs : dxvk_library_path) -lib_spirvtools_opt = dxvk_compiler.find_library('libSPIRV-Tools-opt', dirs : dxvk_library_path) - -lib_d3d11 = dxvk_compiler.find_library('d3d11') -lib_dxgi = dxvk_compiler.find_library('dxgi') if dxvk_compiler.get_id() != 'msvc' lib_d3dcompiler_47 = dxvk_compiler.find_library('d3dcompiler_47') endif diff --git a/src/d3d11/d3d11_shader.cpp b/src/d3d11/d3d11_shader.cpp index a1343ef16..bb0380104 100644 --- a/src/d3d11/d3d11_shader.cpp +++ b/src/d3d11/d3d11_shader.cpp @@ -39,18 +39,6 @@ namespace dxvk { m_shader = module.compile(*pDxbcOptions); m_shader->setDebugName(m_name); - // FIXME this is currently way too slow to be viable - // as a default option, but may help Nvidia users. - if (env::getEnvVar(L"DXVK_SHADER_OPTIMIZE") == "1") { - if (!m_shader->optimize()) - Logger::warn(str::format("Failed to optimize: ", m_name)); - } - - if (env::getEnvVar(L"DXVK_SHADER_VALIDATE") == "1") { - if (!m_shader->validate()) - Logger::warn(str::format("Invalid shader: ", m_name)); - } - if (dumpPath.size() != 0) { m_shader->dump(std::ofstream(str::format(dumpPath, "/", m_name, ".spv"), std::ios_base::binary | std::ios_base::trunc)); diff --git a/src/dxvk/dxvk_shader.cpp b/src/dxvk/dxvk_shader.cpp index b608c220c..765597274 100644 --- a/src/dxvk/dxvk_shader.cpp +++ b/src/dxvk/dxvk_shader.cpp @@ -86,16 +86,6 @@ namespace dxvk { } - bool DxvkShader::optimize() { - return m_code.optimize(); - } - - - bool DxvkShader::validate() const { - return m_code.validate(); - } - - void DxvkShader::dump(std::ostream&& outputStream) const { m_code.store(std::move(outputStream)); } diff --git a/src/dxvk/dxvk_shader.h b/src/dxvk/dxvk_shader.h index 4a511124e..3ee179e93 100644 --- a/src/dxvk/dxvk_shader.h +++ b/src/dxvk/dxvk_shader.h @@ -131,18 +131,6 @@ namespace dxvk { return m_interface; } - /** - * \brief Optimizes SPIR-V shader code - * \returns \c true on success - */ - bool optimize(); - - /** - * \brief Validates SPIR-V shader code - * \returns \c true if the code is valid - */ - bool validate() const; - /** * \brief Dumps SPIR-V shader * diff --git a/src/spirv/meson.build b/src/spirv/meson.build index 2d5cddf4d..70e6ae7c4 100644 --- a/src/spirv/meson.build +++ b/src/spirv/meson.build @@ -5,5 +5,4 @@ spirv_src = files([ spirv_lib = static_library('spirv', spirv_src, include_directories : [ dxvk_include_path ], - dependencies : [ lib_spirvtools, lib_spirvtools_opt ], override_options : ['cpp_std='+dxvk_cpp_std]) diff --git a/src/spirv/spirv_code_buffer.cpp b/src/spirv/spirv_code_buffer.cpp index 63e43a08e..9fe5be6f8 100644 --- a/src/spirv/spirv_code_buffer.cpp +++ b/src/spirv/spirv_code_buffer.cpp @@ -4,7 +4,6 @@ #include "spirv_code_buffer.h" #include -#include using namespace spvtools; @@ -133,33 +132,4 @@ namespace dxvk { sizeof(uint32_t) * m_code.size()); } - - bool SpirvCodeBuffer::optimize() { - Optimizer optimizer(SPV_ENV_VULKAN_1_0); - optimizer.RegisterPass(CreateUnifyConstantPass()); - optimizer.RegisterPass(CreateInlineExhaustivePass()); - optimizer.RegisterPass(CreateEliminateDeadFunctionsPass()); - optimizer.RegisterPass(CreatePrivateToLocalPass()); - optimizer.RegisterPass(CreateScalarReplacementPass()); - optimizer.RegisterPass(CreateLocalSingleBlockLoadStoreElimPass()); - optimizer.RegisterPass(CreateLocalSingleStoreElimPass()); - optimizer.RegisterPass(CreateLocalMultiStoreElimPass()); - optimizer.RegisterPass(CreateInsertExtractElimPass()); - optimizer.RegisterPass(CreateDeadInsertElimPass()); - optimizer.RegisterPass(CreateStrengthReductionPass()); - optimizer.RegisterPass(CreateAggressiveDCEPass()); - optimizer.RegisterPass(CreateCompactIdsPass()); - - return optimizer.Run( - m_code.data(), - m_code.size(), - &m_code); - } - - - bool SpirvCodeBuffer::validate() const { - static const SpirvTools tools(SPV_ENV_VULKAN_1_0); - return tools.Validate(m_code); - } - } \ No newline at end of file diff --git a/src/spirv/spirv_code_buffer.h b/src/spirv/spirv_code_buffer.h index 224a1a6dc..cfd40f74d 100644 --- a/src/spirv/spirv_code_buffer.h +++ b/src/spirv/spirv_code_buffer.h @@ -184,24 +184,6 @@ namespace dxvk { m_ptr = m_code.size(); } - /** - * \brief Performs in-place optimization - * - * This requires the code buffer to - * contain a complete SPIR-V module. - * \returns \c true on success - */ - bool optimize(); - - /** - * \brief Validates shader code - * - * This requires the code buffer to - * contain a complete SPIR-V module. - * \returns \c true if the code is valid - */ - bool validate() const; - private: std::vector m_code;