mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-01 07:24:12 +01:00
Check if shader in READ_PATH exists before using it
Make sure that the replacement shader in the DXVK_SHADER_READ_PATH exists, if not use the generated shader.
This commit is contained in:
parent
0b426a0942
commit
5c4e290d72
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user