check all shaders are loaded early

This commit is contained in:
PancakeTAS 2025-07-18 14:04:21 +02:00
parent df2bec7ce2
commit 352cbc2816
No known key found for this signature in database

View file

@ -125,6 +125,11 @@ void Extract::extractShaders() {
throw std::runtime_error("Unable to read Lossless.dll, is it installed?"); throw std::runtime_error("Unable to read Lossless.dll, is it installed?");
peparse::IterRsrc(dll, on_resource, nullptr); peparse::IterRsrc(dll, on_resource, nullptr);
peparse::DestructParsedPE(dll); peparse::DestructParsedPE(dll);
// ensure all shaders are present
for (const auto& [name, idx] : nameIdxTable)
if (shaders().find(idx) == shaders().end())
throw std::runtime_error("Shader not found: " + name + ".\nIs Lossless Scaling up to date?");
} }
std::vector<uint8_t> Extract::getShader(const std::string& name) { std::vector<uint8_t> Extract::getShader(const std::string& name) {