|
@@ -77,29 +77,32 @@ class WebGLShaderCache {
|
|
|
_getShaderCacheForMaterial( material ) {
|
|
|
|
|
|
const cache = this.materialCache;
|
|
|
+ let set = cache.get( material );
|
|
|
|
|
|
- if ( cache.has( material ) === false ) {
|
|
|
+ if ( set === undefined ) {
|
|
|
|
|
|
- cache.set( material, new Set() );
|
|
|
+ set = new Set();
|
|
|
+ cache.set( material, set );
|
|
|
|
|
|
}
|
|
|
|
|
|
- return cache.get( material );
|
|
|
+ return set;
|
|
|
|
|
|
}
|
|
|
|
|
|
_getShaderStage( code ) {
|
|
|
|
|
|
const cache = this.shaderCache;
|
|
|
+ let stage = cache.get( code );
|
|
|
|
|
|
- if ( cache.has( code ) === false ) {
|
|
|
+ if ( stage === undefined ) {
|
|
|
|
|
|
- const stage = new WebGLShaderStage( code );
|
|
|
+ stage = new WebGLShaderStage( code );
|
|
|
cache.set( code, stage );
|
|
|
|
|
|
}
|
|
|
|
|
|
- return cache.get( code );
|
|
|
+ return stage;
|
|
|
|
|
|
}
|
|
|
|