@@ -29,7 +29,7 @@ export interface FenceContext {
29
29
isFencePassed ( ) : boolean ;
30
30
}
31
31
32
- type WebGLVao = WebGLVertexArrayObject | WebGLVertexArrayObjectOES ;
32
+ type WebGLVao = WebGLVertexArrayObject | WebGLVertexArrayObjectOES ;
33
33
34
34
export interface GPGPUContextProgram extends WebGLProgram {
35
35
vao : WebGLVao ;
@@ -55,8 +55,8 @@ export class GPGPUContext {
55
55
textureConfig : TextureConfig ;
56
56
57
57
createVertexArray : ( ) => WebGLVao | null ;
58
- bindVertexArray : ( vao : WebGLVao | null ) => void ;
59
- deleteVertexArray : ( vao : WebGLVao | null ) => void ;
58
+ bindVertexArray : ( vao : WebGLVao | null ) => void ;
59
+ deleteVertexArray : ( vao : WebGLVao | null ) => void ;
60
60
getVertexArray : ( ) => WebGLVao | null ;
61
61
62
62
constructor ( gl ?: WebGLRenderingContext ) {
@@ -72,20 +72,19 @@ export class GPGPUContext {
72
72
if ( env ( ) . getNumber ( 'WEBGL_VERSION' ) === 2 ) {
73
73
const gl2 = gl as WebGL2RenderingContext ;
74
74
this . createVertexArray = ( ) => {
75
- return webgl_util . callAndCheck ( gl2 ,
76
- ( ) => gl2 . createVertexArray ( ) ) ;
75
+ return webgl_util . callAndCheck ( gl2 , ( ) => gl2 . createVertexArray ( ) ) ;
77
76
} ;
78
77
this . bindVertexArray = ( vao : WebGLVao | null ) => {
79
- return webgl_util . callAndCheck ( gl2 ,
80
- ( ) => gl2 . bindVertexArray ( vao as WebGLVertexArrayObject ) ) ;
78
+ return webgl_util . callAndCheck (
79
+ gl2 , ( ) => gl2 . bindVertexArray ( vao as WebGLVertexArrayObject ) ) ;
81
80
} ;
82
81
this . deleteVertexArray = ( vao : WebGLVao | null ) => {
83
- return webgl_util . callAndCheck ( gl2 ,
84
- ( ) => gl2 . deleteVertexArray ( vao as WebGLVertexArrayObject ) ) ;
82
+ return webgl_util . callAndCheck (
83
+ gl2 , ( ) => gl2 . deleteVertexArray ( vao as WebGLVertexArrayObject ) ) ;
85
84
} ;
86
85
this . getVertexArray = ( ) => {
87
- return webgl_util . callAndCheck ( gl2 ,
88
- ( ) => gl2 . getParameter ( gl2 . VERTEX_ARRAY_BINDING ) ) ;
86
+ return webgl_util . callAndCheck (
87
+ gl2 , ( ) => gl2 . getParameter ( gl2 . VERTEX_ARRAY_BINDING ) ) ;
89
88
} ;
90
89
} else if ( gl != null ) {
91
90
const ext = gl . getExtension ( 'OES_vertex_array_object' ) ;
@@ -95,20 +94,20 @@ export class GPGPUContext {
95
94
' OES_vertex_array_object.' ) ;
96
95
}
97
96
this . createVertexArray = ( ) => {
98
- return webgl_util . callAndCheck ( gl ,
99
- ( ) => ext . createVertexArrayOES ( ) ) ;
97
+ return webgl_util . callAndCheck ( gl , ( ) => ext . createVertexArrayOES ( ) ) ;
100
98
} ;
101
99
this . bindVertexArray = ( vao : WebGLVao | null ) => {
102
- return webgl_util . callAndCheck ( gl ,
103
- ( ) => ext . bindVertexArrayOES ( vao as WebGLVertexArrayObjectOES ) ) ;
100
+ return webgl_util . callAndCheck (
101
+ gl , ( ) => ext . bindVertexArrayOES ( vao as WebGLVertexArrayObjectOES ) ) ;
104
102
} ;
105
103
this . deleteVertexArray = ( vao : WebGLVao | null ) => {
106
- return webgl_util . callAndCheck ( gl ,
107
- ( ) => ext . deleteVertexArrayOES ( vao as WebGLVertexArrayObjectOES ) ) ;
104
+ return webgl_util . callAndCheck (
105
+ gl ,
106
+ ( ) => ext . deleteVertexArrayOES ( vao as WebGLVertexArrayObjectOES ) ) ;
108
107
} ;
109
108
this . getVertexArray = ( ) => {
110
- return webgl_util . callAndCheck ( gl ,
111
- ( ) => gl . getParameter ( ext . VERTEX_ARRAY_BINDING_OES ) ) ;
109
+ return webgl_util . callAndCheck (
110
+ gl , ( ) => gl . getParameter ( ext . VERTEX_ARRAY_BINDING_OES ) ) ;
112
111
} ;
113
112
}
114
113
@@ -352,9 +351,9 @@ export class GPGPUContext {
352
351
webgl_util . callAndCheck (
353
352
gl , ( ) => gl . bindBuffer ( gl . ELEMENT_ARRAY_BUFFER , this . indexBuffer ) ) ;
354
353
console . assert (
355
- gpgpu_util . bindVertexProgramAttributeStreams ( gl , program2 ,
356
- this . vertexBuffer ) ,
357
- 'gpgpu_util.bindVertexProgramAttributeStreams not fully successful.' ) ;
354
+ gpgpu_util . bindVertexProgramAttributeStreams (
355
+ gl , program2 , this . vertexBuffer ) ,
356
+ 'gpgpu_util.bindVertexProgramAttributeStreams not fully successful.' ) ;
358
357
359
358
if ( this . debug ) {
360
359
webgl_util . validateProgram ( gl , program2 ) ;
@@ -464,8 +463,9 @@ export class GPGPUContext {
464
463
const gl = this . gl ;
465
464
if ( this . debug ) {
466
465
const boundVao = this . getVertexArray ( ) ;
467
- console . assert ( boundVao === this . program . vao ,
468
- 'VAO changed between setProgram and executeProgram!' ) ;
466
+ console . assert (
467
+ boundVao === this . program . vao ,
468
+ 'VAO changed between setProgram and executeProgram!' ) ;
469
469
470
470
this . debugValidate ( ) ;
471
471
}
0 commit comments