@@ -45,7 +45,7 @@ export class WebGlShaderProgram implements CoreShaderProgram {
4545 protected vao : WebGLVertexArrayObject | undefined ;
4646 protected renderer : WebGlRenderer ;
4747 protected glw : WebGlContextWrapper ;
48- protected attributeLocations : Record < string , number > ;
48+ protected attributeLocations : string [ ] ;
4949 protected uniformLocations : Record < string , WebGLUniformLocation > | null ;
5050 protected lifecycle : Pick < WebGlShaderType , 'update' | 'canBatch' > ;
5151 protected useSystemAlpha = false ;
@@ -135,8 +135,7 @@ export class WebGlShaderProgram implements CoreShaderProgram {
135135
136136 disableAttributes ( ) {
137137 const glw = this . glw ;
138- const attribs = Object . keys ( this . attributeLocations ) ;
139- const attribLen = attribs . length ;
138+ const attribLen = this . attributeLocations . length ;
140139 for ( let i = 0 ; i < attribLen ; i ++ ) {
141140 glw . disableVertexAttribArray ( i ) ;
142141 }
@@ -278,7 +277,7 @@ export class WebGlShaderProgram implements CoreShaderProgram {
278277
279278 bindBufferCollection ( buffer : BufferCollection ) {
280279 const { glw } = this ;
281- const attribs = Object . keys ( this . attributeLocations ) ;
280+ const attribs = this . attributeLocations ;
282281 const attribLen = attribs . length ;
283282
284283 for ( let i = 0 ; i < attribLen ; i ++ ) {
@@ -332,8 +331,8 @@ export class WebGlShaderProgram implements CoreShaderProgram {
332331 this . program = null ;
333332 this . uniformLocations = null ;
334333
335- const attribs = Object . keys ( this . attributeLocations ) ;
336- const attribLen = attribs . length ;
334+ const attribs = this . attributeLocations ;
335+ const attribLen = this . attributeLocations . length ;
337336 for ( let i = 0 ; i < attribLen ; i ++ ) {
338337 this . glw . deleteBuffer ( attribs [ i ] ! ) ;
339338 }
0 commit comments