File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -674,7 +674,18 @@ var LibraryWebGPU = {
674
674
675
675
// *Destroy
676
676
677
- wgpuBufferDestroy : function ( bufferId ) { WebGPU . mgrBuffer . get ( bufferId ) [ "destroy" ] ( ) ; } ,
677
+ wgpuBufferDestroy : function ( bufferId ) {
678
+ var bufferWrapper = WebGPU . mgrBuffer . objects [ bufferId ] ;
679
+ { { { gpu . makeCheckDefined ( 'bufferWrapper' ) } } }
680
+ if ( bufferWrapper . onUnmap ) {
681
+ for ( var i = 0 ; i < bufferWrapper . onUnmap . length ; ++ i ) {
682
+ bufferWrapper . onUnmap [ i ] ( ) ;
683
+ }
684
+ bufferWrapper . onUnmap = undefined ;
685
+ }
686
+
687
+ WebGPU . mgrBuffer . get ( bufferId ) [ "destroy" ] ( ) ;
688
+ } ,
678
689
wgpuTextureDestroy : function ( textureId ) { WebGPU . mgrTexture . get ( textureId ) [ "destroy" ] ( ) ; } ,
679
690
wgpuQuerySetDestroy : function ( querySetId ) { WebGPU . mgrQuerySet . get ( querySetId ) [ "destroy" ] ( ) ; } ,
680
691
You can’t perform that action at this time.
0 commit comments