Fix Cycles link error with debug + asan after RTTI changes

This commit is contained in:
2020-03-11 16:51:42 +01:00
parent 9ef7759bf0
commit 9910803574
4 changed files with 21 additions and 12 deletions

View File

@@ -440,27 +440,35 @@ const char *OSLShaderManager::shader_load_bytecode(const string &hash, const str
return loaded_shaders.find(hash)->first.c_str();
}
OSLNode *OSLShaderManager::osl_node(const std::string &filepath,
/* This is a static function to avoid RTTI link errors with only this
* file being compiled without RTTI to match OSL and LLVM libraries. */
OSLNode *OSLShaderManager::osl_node(ShaderManager *manager,
const std::string &filepath,
const std::string &bytecode_hash,
const std::string &bytecode)
{
if (!manager->use_osl()) {
return NULL;
}
/* create query */
OSLShaderManager *osl_manager = static_cast<OSLShaderManager *>(manager);
const char *hash;
if (!filepath.empty()) {
hash = shader_load_filepath(filepath);
hash = osl_manager->shader_load_filepath(filepath);
}
else {
hash = shader_test_loaded(bytecode_hash);
hash = osl_manager->shader_test_loaded(bytecode_hash);
if (!hash)
hash = shader_load_bytecode(bytecode_hash, bytecode);
hash = osl_manager->shader_load_bytecode(bytecode_hash, bytecode);
}
if (!hash) {
return NULL;
}
OSLShaderInfo *info = shader_loaded_info(hash);
OSLShaderInfo *info = osl_manager->shader_loaded_info(hash);
/* count number of inputs */
size_t num_inputs = 0;