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
Modifier and TypeFieldDescriptionprotected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected int
protected final GraphicsPipelineBuilder
protected final StringBuilder[]
protected static final int
protected static final int
protected static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addExtension
(String extensionName) protected final StringBuilder
code()
void
codeAppend
(String str) Writes the specified string to one of the shaders.void
codeAppendf
(String format, Object... args) Writes a formatted string to one of the shaders using the specified format string and arguments.void
codePrependf
(String format, Object... args) Similar tocodeAppendf(String, Object...)
, but writes at the beginning.void
declAppend
(ShaderVar var) Appends a variable declaration to one of the shadersprotected final StringBuilder
protected final void
final void
finish()
Complete this builder and do post-processing before getting the result.protected final StringBuilder
final int
getCount()
getMangledName
(String baseName) Generates a mangled name for a helper function in the fragment shader.final CharSequence[]
protected final StringBuilder
inputs()
protected final StringBuilder
protected final void
protected abstract void
onFinish()
protected final StringBuilder
outputs()
final String
toString()
final ByteBuffer
toUTF8()
protected final StringBuilder
uniforms()
-
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:
codeAppend
in interfaceShaderBuilder
-
codeAppendf
Writes a formatted string to one of the shaders using the specified format string and arguments.- Specified by:
codeAppendf
in interfaceShaderBuilder
- See Also:
-
codePrependf
Similar tocodeAppendf(String, Object...)
, but writes at the beginning.- Specified by:
codePrependf
in interfaceShaderBuilder
-
declAppend
Appends a variable declaration to one of the shaders -
getMangledName
Description copied from interface:ShaderBuilder
Generates a mangled name for a helper function in the fragment shader. Will give consistent results if called more than once.- Specified by:
getMangledName
in 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()
-