Merge pull request #71878 from bitsawer/fix_shader_dependencies
Fix shader include dependency handling
This commit is contained in:
commit
06c930caf1
@ -42,9 +42,12 @@ Shader::Mode Shader::get_mode() const {
|
||||
}
|
||||
|
||||
void Shader::_dependency_changed() {
|
||||
RenderingServer::get_singleton()->shader_set_code(shader, RenderingServer::get_singleton()->shader_get_code(shader));
|
||||
// Preprocess and compile the code again because a dependency has changed. It also calls emit_changed() for us.
|
||||
_recompile();
|
||||
}
|
||||
|
||||
emit_changed();
|
||||
void Shader::_recompile() {
|
||||
set_code(get_code());
|
||||
}
|
||||
|
||||
void Shader::set_path(const String &p_path, bool p_take_over) {
|
||||
|
@ -60,6 +60,7 @@ private:
|
||||
HashMap<StringName, HashMap<int, Ref<Texture2D>>> default_textures;
|
||||
|
||||
void _dependency_changed();
|
||||
void _recompile();
|
||||
virtual void _update_shader() const; //used for visual shader
|
||||
Array _get_shader_uniform_list(bool p_get_groups = false);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user