File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -864,22 +864,25 @@ function rendererWebGPU(p5, fn) {
864864 }
865865
866866 _getVertexBuffers ( shader ) {
867- const buffers = [ ] ;
867+ if ( ! shader . _vertexBuffers ) {
868+ const buffers = [ ] ;
868869
869- for ( const attrName in shader . attributes ) {
870- const attr = shader . attributes [ attrName ] ;
871- if ( ! attr || attr . location === - 1 ) continue ;
870+ for ( const attrName in shader . attributes ) {
871+ const attr = shader . attributes [ attrName ] ;
872+ if ( ! attr || attr . location === - 1 ) continue ;
872873
873- // Get the vertex buffer info associated with this attribute
874- const renderBuffer =
875- this . buffers [ shader . shaderType ] . find ( buf => buf . attr === attrName ) ||
876- this . buffers . user . find ( buf => buf . attr === attrName ) ;
877- if ( ! renderBuffer ) continue ;
874+ // Get the vertex buffer info associated with this attribute
875+ const renderBuffer =
876+ this . buffers [ shader . shaderType ] . find ( buf => buf . attr === attrName ) ||
877+ this . buffers . user . find ( buf => buf . attr === attrName ) ;
878+ if ( ! renderBuffer ) continue ;
878879
879- buffers . push ( renderBuffer ) ;
880+ buffers . push ( renderBuffer ) ;
881+ }
882+ shader . _vertexBuffers = buffers ;
880883 }
881884
882- return buffers ;
885+ return shader . _vertexBuffers ;
883886 }
884887
885888 _getFormatFromSize ( size ) {
You can’t perform that action at this time.
0 commit comments