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
(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
private static final FileToIdConverter
static final String
static final String
(package private) final TextureManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
apply
(ShaderManager.Configs p_366597_, ResourceManager p_366533_, ProfilerFiller p_366866_) void
close()
private static GlslPreprocessor
createPreprocessor
(Map<ResourceLocation, Resource> p_366891_, ResourceLocation p_366860_) getName()
getPostChain
(ResourceLocation p_366709_, Set<ResourceLocation> p_366652_) getProgram
(ShaderProgram p_366726_) getProgramForLoading
(ShaderProgram p_371850_) private static boolean
isProgram
(ResourceLocation p_366404_) private static boolean
isShader
(ResourceLocation p_366565_) (package private) static CompiledShaderProgram
linkProgram
(ShaderProgram p_366640_, ShaderProgramConfig p_366864_, CompiledShader p_366716_, CompiledShader p_366871_) private static void
loadPostChain
(ResourceLocation p_366838_, Resource p_366558_, com.google.common.collect.ImmutableMap.Builder<ResourceLocation, PostChainConfig> p_366892_) private static void
loadProgram
(ResourceLocation p_366422_, Resource p_366602_, com.google.common.collect.ImmutableMap.Builder<ResourceLocation, ShaderProgramConfig> p_366850_) private static void
loadShader
(ResourceLocation p_366513_, Resource p_366763_, CompiledShader.Type p_366461_, Map<ResourceLocation, Resource> p_366725_, com.google.common.collect.ImmutableMap.Builder<ShaderManager.ShaderSourceKey, String> p_366733_) void
preloadForStartup
(ResourceProvider p_366778_, ShaderProgram... p_366598_) private CompiledShader
preloadShader
(ResourceProvider p_366664_, ResourceLocation p_366827_, CompiledShader.Type p_366782_, ShaderDefines p_366425_) protected ShaderManager.Configs
prepare
(ResourceManager p_366761_, ProfilerFiller p_366562_) private void
tryTriggerRecovery
(Exception p_383219_) 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 -
SHADER_PATH
- See Also:
-
SHADER_INCLUDE_PATH
- See Also:
-
PROGRAM_ID_CONVERTER
-
POST_CHAIN_ID_CONVERTER
-
MAX_LOG_LENGTH
public static final int MAX_LOG_LENGTH- See Also:
-
textureManager
-
recoveryHandler
-
compilationCache
-
-
Constructor Details
-
ShaderManager
-
-
Method Details
-
prepare
- Specified by:
prepare
in classSimplePreparableReloadListener<ShaderManager.Configs>
-
loadShader
private static void loadShader(ResourceLocation p_366513_, Resource p_366763_, CompiledShader.Type p_366461_, Map<ResourceLocation, Resource> p_366725_, com.google.common.collect.ImmutableMap.Builder<ShaderManager.ShaderSourceKey, String> p_366733_) -
createPreprocessor
private static GlslPreprocessor createPreprocessor(Map<ResourceLocation, Resource> p_366891_, ResourceLocation p_366860_) -
loadProgram
private static void loadProgram(ResourceLocation p_366422_, Resource p_366602_, com.google.common.collect.ImmutableMap.Builder<ResourceLocation, ShaderProgramConfig> p_366850_) -
loadPostChain
private static void loadPostChain(ResourceLocation p_366838_, Resource p_366558_, com.google.common.collect.ImmutableMap.Builder<ResourceLocation, PostChainConfig> p_366892_) -
isProgram
-
isShader
-
apply
protected void apply(ShaderManager.Configs p_366597_, ResourceManager p_366533_, ProfilerFiller p_366866_) - Specified by:
apply
in classSimplePreparableReloadListener<ShaderManager.Configs>
-
getName
- Specified by:
getName
in interfacePreparableReloadListener
-
tryTriggerRecovery
-
preloadForStartup
public void preloadForStartup(ResourceProvider p_366778_, ShaderProgram... p_366598_) throws IOException, ShaderManager.CompilationException -
preloadShader
private CompiledShader preloadShader(ResourceProvider p_366664_, ResourceLocation p_366827_, CompiledShader.Type p_366782_, ShaderDefines p_366425_) throws IOException, ShaderManager.CompilationException -
getProgram
-
getProgramForLoading
public CompiledShaderProgram getProgramForLoading(ShaderProgram p_371850_) throws ShaderManager.CompilationException -
linkProgram
static CompiledShaderProgram linkProgram(ShaderProgram p_366640_, ShaderProgramConfig p_366864_, CompiledShader p_366716_, CompiledShader p_366871_) throws ShaderManager.CompilationException -
getPostChain
@Nullable public PostChain getPostChain(ResourceLocation p_366709_, Set<ResourceLocation> p_366652_) -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-