mirror of
https://github.com/Eragon-Brisingr/UShaderLab.git
synced 2026-09-15 23:04:37 +00:00
Init repo
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "Engine/Engine.h"
|
||||
#include "IDirectoryWatcher.h"
|
||||
#include "Interfaces/IPluginManager.h"
|
||||
#include "MaterialShared.h"
|
||||
#include "Materials/Material.h"
|
||||
#include "Misc/Paths.h"
|
||||
#include "Modules/ModuleManager.h"
|
||||
@@ -31,7 +32,15 @@ namespace
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Recompile for rendering / editor preview (async).
|
||||
|
||||
// Recompile the base AND propagate to everything that depends on it. A bare PostEditChange
|
||||
// recompiles only the base shell; the instances carry their own static-permutation shader maps
|
||||
// (and the level components render those), so on a hot-reload they must be recompiled and
|
||||
// re-pushed too. FMaterialUpdateContext does exactly that on scope exit: recompile the listed
|
||||
// material, then recache every dependent instance and refresh the components/viewports using it.
|
||||
FMaterialUpdateContext UpdateContext;
|
||||
UpdateContext.AddMaterial(&Material);
|
||||
Material.PreEditChange(nullptr);
|
||||
Material.PostEditChange();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user