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) class
static class
static final record
(package private) static final record
Nested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
PreparableReloadListener.PreparationBarrier
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ShaderManager.CompilationCache
(package private) static final org.slf4j.Logger
static final int
private static final FileToIdConverter
(package private) final CachedOrthoProjectionMatrixBuffer
private static final String
static final String
(package private) final TextureManager
-
Constructor Summary
ConstructorsConstructorDescriptionShaderManager
(TextureManager pTextureManager, Consumer<Exception> pRecoveryHandler) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
apply
(ShaderManager.Configs pObject, ResourceManager pResourceManager, ProfilerFiller pProfiler) void
close()
private static GlslPreprocessor
createPreprocessor
(Map<ResourceLocation, Resource> pShaderResources, ResourceLocation pShaderLocation) getName()
getPostChain
(ResourceLocation pId, Set<ResourceLocation> pExternalTargets) getShader
(ResourceLocation pId, ShaderType pType) private static boolean
isShader
(ResourceLocation p_366565_) private static void
loadPostChain
(ResourceLocation p_366838_, Resource p_366558_, com.google.common.collect.ImmutableMap.Builder<ResourceLocation, PostChainConfig> p_366892_) private static void
loadShader
(ResourceLocation p_366513_, Resource p_366763_, ShaderType p_410200_, Map<ResourceLocation, Resource> p_366725_, com.google.common.collect.ImmutableMap.Builder<ShaderManager.ShaderSourceKey, String> p_366733_) protected ShaderManager.Configs
prepare
(ResourceManager pResourceManager, ProfilerFiller pProfiler) Performs any reloading that can be done off-thread, such as file IOprivate void
tryTriggerRecovery
(Exception pException) Methods inherited from class net.minecraft.server.packs.resources.SimplePreparableReloadListener
reload
Methods inherited from class net.neoforged.neoforge.resource.ContextAwareReloadListener
getContext, getRegistryLookup, injectContext, makeConditionalOps, makeConditionalOps
-
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
Performs any reloading that can be done off-thread, such as file IO- Specified by:
prepare
in classSimplePreparableReloadListener<ShaderManager.Configs>
-
loadShader
private static void loadShader(ResourceLocation p_366513_, Resource p_366763_, ShaderType p_410200_, Map<ResourceLocation, Resource> p_366725_, com.google.common.collect.ImmutableMap.Builder<ShaderManager.ShaderSourceKey, String> p_366733_) -
createPreprocessor
private static GlslPreprocessor createPreprocessor(Map<ResourceLocation, Resource> pShaderResources, ResourceLocation pShaderLocation) -
loadPostChain
private static void loadPostChain(ResourceLocation p_366838_, Resource p_366558_, com.google.common.collect.ImmutableMap.Builder<ResourceLocation, PostChainConfig> p_366892_) -
isShader
-
apply
protected void apply(ShaderManager.Configs pObject, ResourceManager pResourceManager, ProfilerFiller pProfiler) - Specified by:
apply
in classSimplePreparableReloadListener<ShaderManager.Configs>
-
getName
- Specified by:
getName
in interfacePreparableReloadListener
-
tryTriggerRecovery
-
getPostChain
@Nullable public PostChain getPostChain(ResourceLocation pId, Set<ResourceLocation> pExternalTargets) -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
getShader
-