File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
examples/jsm/renderers/webgl Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import WebGLTextureUtils from './utils/WebGLTextureUtils.js';
1010import WebGLExtensions from './utils/WebGLExtensions.js' ;
1111import WebGLCapabilities from './utils/WebGLCapabilities.js' ;
1212import { DepthFormat } from '../../../../src/constants.js' ;
13+ import { attribute } from '../../nodes/Nodes.js' ;
1314
1415//
1516
@@ -893,9 +894,9 @@ class WebGLBackend extends Backend {
893894
894895 }
895896
896- destroyAttribute ( /* attribute*/ ) {
897+ destroyAttribute ( attribute ) {
897898
898- console . warn ( 'Abstract class.' ) ;
899+ this . attributeUtils . destroyAttribute ( attribute ) ;
899900
900901 }
901902
Original file line number Diff line number Diff line change @@ -134,6 +134,25 @@ class WebGLAttributeUtils {
134134
135135 }
136136
137+ destroyAttribute ( attribute ) {
138+
139+ const backend = this . backend ;
140+ const { gl } = backend ;
141+
142+ if ( attribute . isInterleavedBufferAttribute ) {
143+
144+ backend . delete ( attribute . data ) ;
145+
146+ }
147+
148+ const attributeData = backend . get ( attribute ) ;
149+
150+ gl . deleteBuffer ( attributeData . bufferGPU ) ;
151+
152+ backend . delete ( attribute ) ;
153+
154+ }
155+
137156 async getArrayBufferAsync ( attribute ) {
138157
139158 const backend = this . backend ;
You can’t perform that action at this time.
0 commit comments