File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -30,3 +30,10 @@ export class ByeGLVertexArrayObject {
3030 } ;
3131 }
3232}
33+
34+ export function destroyVAO ( vao : ByeGLVertexArrayObject ) {
35+ const internal = vao [ $internal ] ;
36+ internal . boundElementArrayBuffer = null ;
37+ internal . enabledVertexAttribArrays . clear ( ) ;
38+ internal . vertexBufferSegments = [ ] ;
39+ }
Original file line number Diff line number Diff line change 11import { TgpuRoot } from 'typegpu' ;
2- import { AttributeState , ByeGLVertexArrayObject } from './attribute.ts' ;
2+ import {
3+ AttributeState ,
4+ ByeGLVertexArrayObject ,
5+ destroyVAO ,
6+ } from './attribute.ts' ;
37import { ByeGLBuffer , VertexBufferSegment } from './buffer.ts' ;
48import {
59 blendEquationMap ,
@@ -543,6 +547,10 @@ export class ByeGLContext {
543547 }
544548 }
545549
550+ deleteVertexArray ( vao : ByeGLVertexArrayObject | null ) : void {
551+ vao && destroyVAO ( vao ) ;
552+ }
553+
546554 depthFunc ( func : GLenum ) : void {
547555 // TODO: Do something with this value
548556 this . #parameters. set ( gl . DEPTH_FUNC , func ) ;
You can’t perform that action at this time.
0 commit comments