Class ShaderUniformCache
java.lang.Object
foundry.veil.api.client.render.shader.program.ShaderUniformCache
Queries shader programs for all relevant uniform data.
- Since:
- 1.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA single uniform block in a shader program.static final recordA single uniform in a shader program.static final recordA single uniform block in a shader program. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the cache, rebuilding it the next timegetUniform(CharSequence)is called.static StringgetName(int type) Retrieves the human-readable name of the specified GL shader type.@Nullable ShaderUniformCache.StorageBlockgetStorageBlock(String name) Retrieves a storage block by name.@Nullable ShaderUniformCache.UniformgetUniform(CharSequence name) Retrieves a uniform by name.@Nullable ShaderUniformCache.UniformBlockgetUniformBlock(String name) Retrieves a uniform block by name.booleanhasSampler(String name) Checks if a sampler uniform exists with the specified name.booleanhasStorageBlock(String name) Checks if a storage block exists by the specified name.booleanhasUniform(String name) Checks if a uniform exists by the specified name.booleanhasUniformBlock(String name) Checks if a uniform block exists by the specified name.static booleanisSampler(int type) Checks if the specified GL shader type is a sampler.
-
Constructor Details
-
ShaderUniformCache
-
-
Method Details
-
clear
public void clear()Clears the cache, rebuilding it the next timegetUniform(CharSequence)is called. -
getUniform
Retrieves a uniform by name.- Parameters:
name- The name of the uniform to get- Returns:
- The uniform found or
nullif it doesn't exist
-
hasUniform
Checks if a uniform exists by the specified name.- Parameters:
name- The name of the uniform to check for- Returns:
- Whether that uniform exists
-
getUniformBlock
Retrieves a uniform block by name.- Parameters:
name- The name of the uniform block to get- Returns:
- The uniform block found or
nullif it doesn't exist
-
hasUniformBlock
Checks if a uniform block exists by the specified name.- Parameters:
name- The name of the uniform block to check for- Returns:
- Whether that uniform block exists
-
getStorageBlock
Retrieves a storage block by name.- Parameters:
name- The name of the storage block to get- Returns:
- The storage block found or
nullif it doesn't exist
-
hasStorageBlock
Checks if a storage block exists by the specified name.- Parameters:
name- The name of the storage block to check for- Returns:
- Whether that storage block exists
-
hasSampler
Checks if a sampler uniform exists with the specified name.- Parameters:
name- The name of the sampler to check for- Returns:
- Whether that uniform exists and is a sampler
-
getSamplers
- Returns:
- A view of all sampler uniforms in the shader
-
getUniforms
- Returns:
- A view of all uniforms in the shader
-
getUniformBlocks
- Returns:
- A view of all uniform blocks in the shader
-
getStorageBlocks
- Returns:
- A view of all storage blocks in the shader
-
isSampler
public static boolean isSampler(int type) Checks if the specified GL shader type is a sampler.- Parameters:
type- The type to check- Returns:
- Whether that GL type is a sampler
-
getName
Retrieves the human-readable name of the specified GL shader type.- Parameters:
type- The type to get the name of- Returns:
- The human-readable name
-