Skip to content

Commit

Permalink
WebGLPrograms: Clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Jun 8, 2020
1 parent aea23e6 commit 1acc765
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/renderers/webgl/WebGLPrograms.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function WebGLPrograms( renderer, extensions, capabilities ) {

}

this.getParameters = function ( material, lights, shadows, scene, nClipPlanes, nClipIntersection, object ) {
function getParameters( material, lights, shadows, scene, nClipPlanes, nClipIntersection, object ) {

const fog = scene.fog;
const environment = material.isMeshStandardMaterial ? scene.environment : null;
Expand Down Expand Up @@ -295,9 +295,9 @@ function WebGLPrograms( renderer, extensions, capabilities ) {

return parameters;

};
}

this.getProgramCacheKey = function ( parameters ) {
function getProgramCacheKey( parameters ) {

const array = [];

Expand Down Expand Up @@ -340,9 +340,9 @@ function WebGLPrograms( renderer, extensions, capabilities ) {

return array.join();

};
}

this.acquireProgram = function ( parameters, cacheKey ) {
function acquireProgram( parameters, cacheKey ) {

let program;

Expand Down Expand Up @@ -371,9 +371,9 @@ function WebGLPrograms( renderer, extensions, capabilities ) {

return program;

};
}

this.releaseProgram = function ( program ) {
function releaseProgram( program ) {

if ( -- program.usedTimes === 0 ) {

Expand All @@ -387,10 +387,16 @@ function WebGLPrograms( renderer, extensions, capabilities ) {

}

};
}

// Exposed for resource monitoring & error feedback via renderer.info:
this.programs = programs;
return {
getParameters: getParameters,
getProgramCacheKey: getProgramCacheKey,
acquireProgram: acquireProgram,
releaseProgram: releaseProgram,
// Exposed for resource monitoring & error feedback via renderer.info:
programs: programs
};

}

Expand Down

0 comments on commit 1acc765

Please sign in to comment.