ShaderCache

ShaderCache

new ShaderCache

DOC_TBA

See:

Methods

destroy

DOC_TBA

destroyReleasedShaderPrograms

DOC_TBA

getShaderProgram

DOC_TBA

Returns:
ShaderProgram DOC_TBA.
See:

isDestroyed

DOC_TBA

releaseShaderProgram

DOC_TBA

replaceShaderProgram

Returns a shader program from the cache, or creates and caches a new shader program, given the GLSL vertex and fragment shader source and attribute locations.

The difference between this and ShaderCache#getShaderProgram, is this is used to replace an existing reference to a shader program, which is passed as the first argument.

Parameters:
Name Type Description
shaderProgram ShaderProgram The shader program that is being reassigned. This can be undefined.
vertexShaderSource String The GLSL source for the vertex shader.
fragmentShaderSource String The GLSL source for the fragment shader.
attributeLocations Object Indices for the attribute inputs to the vertex shader.
Returns:
ShaderProgram The cached or newly created shader program.
Example
this._shaderProgram = context.getShaderCache().replaceShaderProgram(
    this._shaderProgram, vs, fs, attributeLocations);
See: