Package icyllis.arc3d.granite.shading
Class ShaderBuilderBase
java.lang.Object
icyllis.arc3d.granite.shading.ShaderBuilderBase
- All Implemented Interfaces:
ShaderBuilder
- Direct Known Subclasses:
FragmentShaderBuilder,VertexShaderBuilder
Base class for all shaders builders.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected intprotected final GraphicsPipelineBuilderprotected final StringBuilder[]protected static final intprotected static final intprotected static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExtension(@Nullable String extensionName) protected final StringBuildercode()voidcodeAppend(String str) Writes the specified string to one of the shaders.voidcodeAppendf(String format, Object... args) Writes a formatted string to one of the shaders using the specified format string and arguments.voidcodePrependf(String format, Object... args) Similar tocodeAppendf(String, Object...), but writes at the beginning.voiddeclAppend(ShaderVar var) Appends a variable declaration to one of the shadersprotected final StringBuilderprotected final voidfinal voidfinish()Complete this builder and do post-processing before getting the result.protected final StringBuilderfinal intgetCount()getMangledName(String baseName) Generates a mangled name for a helper function in the fragment shader.final CharSequence[]protected final StringBuilderinputs()protected final StringBuilderprotected final voidprotected abstract voidonFinish()protected final StringBuilderoutputs()final StringtoString()final @NonNull ByteBuffertoUTF8()protected final StringBuilderuniforms()
-
Field Details
-
DEFINITIONS
protected static final int DEFINITIONS- See Also:
-
LAYOUT_QUALIFIERS
protected static final int LAYOUT_QUALIFIERS- See Also:
-
UNIFORMS
protected static final int UNIFORMS- See Also:
-
INPUTS
protected static final int INPUTS- See Also:
-
OUTPUTS
protected static final int OUTPUTS- See Also:
-
FUNCTIONS
protected static final int FUNCTIONS- See Also:
-
CODE
protected static final int CODE- See Also:
-
PREALLOC
protected static final int PREALLOC- See Also:
-
mPipelineBuilder
-
mShaderStrings
-
mCodeIndex
protected int mCodeIndex
-
-
Constructor Details
-
ShaderBuilderBase
-
-
Method Details
-
codeAppend
Writes the specified string to one of the shaders.- Specified by:
codeAppendin interfaceShaderBuilder
-
codeAppendf
Writes a formatted string to one of the shaders using the specified format string and arguments.- Specified by:
codeAppendfin interfaceShaderBuilder- See Also:
-
codePrependf
Similar tocodeAppendf(String, Object...), but writes at the beginning.- Specified by:
codePrependfin interfaceShaderBuilder
-
declAppend
Appends a variable declaration to one of the shaders -
getMangledName
Description copied from interface:ShaderBuilderGenerates a mangled name for a helper function in the fragment shader. Will give consistent results if called more than once.- Specified by:
getMangledNamein interfaceShaderBuilder
-
nextStage
protected final void nextStage() -
deleteStage
protected final void deleteStage() -
definitions
-
layoutQualifiers
-
uniforms
-
inputs
-
outputs
-
functions
-
code
-
addExtension
-
finish
public final void finish()Complete this builder and do post-processing before getting the result. -
getStrings
-
getCount
public final int getCount() -
getExtensions
-
toUTF8
-
toString
-
onFinish
protected abstract void onFinish()
-