1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-30 22:24:15 +01:00

Merge pull request #20 from Guy1524/shaderReadFix

Check if shader in READ_PATH exists before using it
This commit is contained in:
Philip Rebohle 2018-01-21 03:24:22 +01:00 committed by GitHub
commit 952ac5d5f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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));
}
}