Package net.minecraft.client.renderer
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 TypeClassDescription(package private) classstatic classstatic final record(package private) static final recordNested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
PreparableReloadListener.PreparationBarrier, PreparableReloadListener.SharedState, PreparableReloadListener.StateKey<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ShaderManager.CompilationCache(package private) static final org.slf4j.Loggerstatic final intprivate static final FileToIdConverter(package private) final CachedOrthoProjectionMatrixBufferprivate static final Stringstatic final String(package private) final TextureManager -
Constructor Summary
ConstructorsConstructorDescriptionShaderManager(TextureManager pTextureManager, Consumer<Exception> pRecoveryHandler) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapply(ShaderManager.Configs p_366597_, ResourceManager p_366533_, ProfilerFiller p_366866_) voidclose()private static GlslPreprocessorcreatePreprocessor(Map<Identifier, Resource> pShaderResources, Identifier pShaderLocation) getName()@Nullable PostChaingetPostChain(Identifier pId, Set<Identifier> pExternalTargets) @Nullable StringgetShader(Identifier pId, ShaderType pType) private static booleanisShader(Identifier pLocation) private static voidloadPostChain(Identifier pLocation, Resource pPostChain, ImmutableMap.Builder<Identifier, PostChainConfig> pOutput) private static voidloadShader(Identifier pLocation, Resource pShader, ShaderType pType, Map<Identifier, Resource> pShaderResources, ImmutableMap.Builder<ShaderManager.ShaderSourceKey, String> pOutput) protected ShaderManager.Configsprepare(ResourceManager p_366761_, ProfilerFiller p_366562_) Performs any reloading that can be done off-thread, such as file IOprivate voidtryTriggerRecovery(Exception pException) Methods inherited from class net.minecraft.server.packs.resources.SimplePreparableReloadListener
reloadMethods inherited from class net.neoforged.neoforge.resource.ContextAwareReloadListener
getContext, getRegistryLookup, injectContext, makeConditionalOps, makeConditionalOpsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
prepareSharedState
-
Field Details
-
LOGGER
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
-
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 pLocation, Resource pShader, ShaderType pType, Map<Identifier, Resource> pShaderResources, ImmutableMap.Builder<ShaderManager.ShaderSourceKey, String> pOutput) -
createPreprocessor
private static GlslPreprocessor createPreprocessor(Map<Identifier, Resource> pShaderResources, Identifier pShaderLocation) -
loadPostChain
private static void loadPostChain(Identifier pLocation, Resource pPostChain, ImmutableMap.Builder<Identifier, PostChainConfig> pOutput) -
isShader
-
apply
protected void apply(ShaderManager.Configs p_366597_, ResourceManager p_366533_, ProfilerFiller p_366866_) - Specified by:
applyin classSimplePreparableReloadListener<ShaderManager.Configs>
-
getName
- Specified by:
getNamein interfacePreparableReloadListener
-
tryTriggerRecovery
-
getPostChain
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
getShader
-