filamat: fix spirv remap intialization (#8384)

FIXES=390398814
This commit is contained in:
Powei Feng
2025-01-24 09:52:03 -08:00
committed by GitHub
parent 3b7cbd6bdb
commit 6dc79a319e
+13
View File
@@ -297,6 +297,19 @@ GLSLPostProcessor::GLSLPostProcessor(MaterialBuilder::Optimization optimization,
spv::spirvbin_t::registerErrorHandler([](const std::string& str) {
slog.e << str << io::endl;
});
// Similar to above, we need to do a no-op remap to init a static table in the remapper before
// the jobs start using remap().
spv::spirvbin_t remapper(0);
// We need to provide at least a valid header to not crash.
SpirvBlob spirv {
0x07230203,// MAGIC
0, // VERSION
0, // GENERATOR
0, // BOUND
0 // SCHEMA, must be 0
};
remapper.remap(spirv, 0);
}
GLSLPostProcessor::~GLSLPostProcessor() = default;