Skip to content

Commit

Permalink
filamat: fix spirv remap intialization (#8384)
Browse files Browse the repository at this point in the history
FIXES=390398814
  • Loading branch information
poweifeng authored Jan 24, 2025
1 parent 3b7cbd6 commit 6dc79a3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions libs/filamat/src/GLSLPostProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6dc79a3

Please sign in to comment.