Class ShaderManager
java.lang.Object
net.neoforged.neoforge.resource.ContextAwareReloadListener
net.minecraft.server.packs.resources.SimplePreparableReloadListener<ShaderManager.Configs>
net.minecraft.client.renderer.ShaderManager
- All Implemented Interfaces:
AutoCloseable, PreparableReloadListener
public class ShaderManager
extends SimplePreparableReloadListener<ShaderManager.Configs>
implements AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classstatic classstatic final recordprivate static final recordNested classes/interfaces inherited from interface PreparableReloadListener
PreparableReloadListener.PreparationBarrier, PreparableReloadListener.SharedState, PreparableReloadListener.StateKey<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ShaderManager.CompilationCacheprivate static final org.slf4j.Loggerstatic final intprivate static final FileToIdConverterprivate final Projectionprivate final ProjectionMatrixBufferprivate static final Stringstatic final Stringprivate final TextureManager -
Constructor Summary
ConstructorsConstructorDescriptionShaderManager(TextureManager textureManager, Consumer<Exception> recoveryHandler) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapply(ShaderManager.Configs preparations, ResourceManager manager, ProfilerFiller profiler) voidclose()private static GlslPreprocessorcreatePreprocessor(Map<Identifier, Resource> files, Identifier location) getName()@Nullable PostChaingetPostChain(Identifier id, Set<Identifier> allowedTargets) @Nullable StringgetShader(Identifier id, ShaderType type) private static booleanisShader(Identifier location) private static voidloadPostChain(Identifier location, Resource resource, ImmutableMap.Builder<Identifier, PostChainConfig> output) private static voidloadShader(Identifier location, Resource resource, ShaderType type, Map<Identifier, Resource> files, ImmutableMap.Builder<ShaderManager.ShaderSourceKey, String> output) protected ShaderManager.Configsprepare(ResourceManager manager, ProfilerFiller profiler) Performs any reloading that can be done off-thread, such as file IOprivate voidtryTriggerRecovery(Exception exception) Methods inherited from class SimplePreparableReloadListener
reloadMethods inherited from class ContextAwareReloadListener
getContext, getRegistryLookup, injectContext, makeConditionalOps, makeConditionalOpsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PreparableReloadListener
prepareSharedState
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
MAX_LOG_LENGTH
public static final int MAX_LOG_LENGTH- See Also:
-
SHADER_PATH
- See Also:
-
SHADER_INCLUDE_PATH
- See Also:
-
POST_CHAIN_ID_CONVERTER
-
textureManager
-
recoveryHandler
-
compilationCache
-
postChainProjection
-
postChainProjectionMatrixBuffer
-
-
Constructor Details
-
ShaderManager
-
-
Method Details
-
prepare
Description copied from class:SimplePreparableReloadListenerPerforms any reloading that can be done off-thread, such as file IO- Specified by:
preparein classSimplePreparableReloadListener<ShaderManager.Configs>
-
loadShader
private static void loadShader(Identifier location, Resource resource, ShaderType type, Map<Identifier, Resource> files, ImmutableMap.Builder<ShaderManager.ShaderSourceKey, String> output) -
createPreprocessor
private static GlslPreprocessor createPreprocessor(Map<Identifier, Resource> files, Identifier location) -
loadPostChain
private static void loadPostChain(Identifier location, Resource resource, ImmutableMap.Builder<Identifier, PostChainConfig> output) -
isShader
-
apply
protected void apply(ShaderManager.Configs preparations, ResourceManager manager, ProfilerFiller profiler) - Specified by:
applyin classSimplePreparableReloadListener<ShaderManager.Configs>
-
getName
- Specified by:
getNamein interfacePreparableReloadListener
-
tryTriggerRecovery
-
getPostChain
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
getShader
-