mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[d3d11] Re-implemented shader read
This commit is contained in:
parent
b4493d90d8
commit
89ec199c34
@ -35,6 +35,22 @@ namespace dxvk {
|
|||||||
m_shader->dump(std::ofstream(str::format(baseName, ".spv"),
|
m_shader->dump(std::ofstream(str::format(baseName, ".spv"),
|
||||||
std::ios_base::binary | std::ios_base::trunc));
|
std::ios_base::binary | std::ios_base::trunc));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// If requested by the user, replace
|
||||||
|
// the shader with another file.
|
||||||
|
const std::string readPath
|
||||||
|
= env::getEnvVar(L"DXVK_SHADER_READ_PATH");
|
||||||
|
|
||||||
|
if (readPath.size() != 0) {
|
||||||
|
const std::string baseName = str::format(readPath, "/",
|
||||||
|
ConstructFileName(ComputeShaderHash(pShaderBytecode, BytecodeLength),
|
||||||
|
module.version().type()));
|
||||||
|
|
||||||
|
m_shader->read(std::ifstream(
|
||||||
|
str::format(baseName, ".spv"),
|
||||||
|
std::ios_base::binary));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,4 +88,9 @@ namespace dxvk {
|
|||||||
m_code.store(std::move(outputStream));
|
m_code.store(std::move(outputStream));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DxvkShader::read(std::istream&& inputStream) {
|
||||||
|
m_code = SpirvCodeBuffer(std::move(inputStream));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -105,6 +105,14 @@ namespace dxvk {
|
|||||||
*/
|
*/
|
||||||
void dump(std::ostream&& outputStream) const;
|
void dump(std::ostream&& outputStream) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Reads SPIR-V shader
|
||||||
|
*
|
||||||
|
* Can be used to replace the compiled SPIR-V code.
|
||||||
|
* \param [in] inputStream Stream to read from
|
||||||
|
*/
|
||||||
|
void read(std::istream&& inputStream);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
VkShaderStageFlagBits m_stage;
|
VkShaderStageFlagBits m_stage;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user