diff --git a/src/d3d11/d3d11_shader.cpp b/src/d3d11/d3d11_shader.cpp index 4e6a5901..f44f8536 100644 --- a/src/d3d11/d3d11_shader.cpp +++ b/src/d3d11/d3d11_shader.cpp @@ -46,9 +46,13 @@ namespace dxvk { // If requested by the user, replace // the shader with another file. if (readPath.size() != 0) { - m_shader->read(std::ifstream( + // Check whether the file exists + std::ifstream readStream( str::format(readPath, "/", m_name, ".spv"), - std::ios_base::binary)); + std::ios_base::binary); + + if (readStream) + m_shader->read(std::move(readStream)); } }