File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -699,16 +699,19 @@ var LibraryGL = {
699699 // only store the string 'colors' in utable, and 'colors[0]', 'colors[1]' and 'colors[2]' will be parsed as 'colors'+i.
700700 // Note that for the GL.uniforms table, we still need to fetch the all WebGLUniformLocations for all the indices.
701701 var loc = GLctx . getUniformLocation ( p , name ) ;
702- var id = GL . getNewId ( GL . uniforms ) ;
703- utable [ name ] = [ u . size , id ] ;
704- GL . uniforms [ id ] = loc ;
702+ if ( loc != null )
703+ {
704+ var id = GL . getNewId ( GL . uniforms ) ;
705+ utable [ name ] = [ u . size , id ] ;
706+ GL . uniforms [ id ] = loc ;
705707
706- for ( var j = 1 ; j < u . size ; ++ j ) {
707- var n = name + '[' + j + ']' ;
708- loc = GLctx . getUniformLocation ( p , n ) ;
709- id = GL . getNewId ( GL . uniforms ) ;
708+ for ( var j = 1 ; j < u . size ; ++ j ) {
709+ var n = name + '[' + j + ']' ;
710+ loc = GLctx . getUniformLocation ( p , n ) ;
711+ id = GL . getNewId ( GL . uniforms ) ;
710712
711- GL . uniforms [ id ] = loc ;
713+ GL . uniforms [ id ] = loc ;
714+ }
712715 }
713716 }
714717 }
You can’t perform that action at this time.
0 commit comments