@@ -698,6 +698,8 @@ var LibraryGL = {
698
698
// Extension available from Firefox 25 and WebKit
699
699
GL . vaoExt = Module . ctx . getExtension ( 'OES_vertex_array_object' ) ;
700
700
701
+ GL . drawBuffersExt = Module . ctx . getExtension ( 'WEBGL_draw_buffers' ) ;
702
+
701
703
// These are the 'safe' feature-enabling extensions that don't add any performance impact related to e.g. debugging, and
702
704
// should be enabled by default so that client GLES2/GL code will not need to go through extra hoops to get its stuff working.
703
705
// As new extensions are ratified at http://www.khronos.org/registry/webgl/extensions/ , feel free to add your new extensions
@@ -5423,7 +5425,19 @@ var LibraryGL = {
5423
5425
glVertexAttribDivisorARB : 'glVertexAttribDivisor' ,
5424
5426
glDrawArraysInstancedARB : 'glDrawArraysInstanced' ,
5425
5427
glDrawElementsInstancedARB : 'glDrawElementsInstanced' ,
5426
-
5428
+
5429
+
5430
+ glDrawBuffers__sig : 'vii' ,
5431
+ glDrawBuffers : function ( n , bufs ) {
5432
+ #if GL_ASSERTIONS
5433
+ assert ( GL . drawBuffersExt , 'Must have WEBGL_draw_buffers extension to use drawBuffers' ) ;
5434
+ #endif
5435
+ var bufArray = [ ] ;
5436
+ for ( var i = 0 ; i < n ; i ++ )
5437
+ bufArray . push ( { { { makeGetValue ( 'bufs' , 'i*4' , 'i32' ) } } } ) ;
5438
+
5439
+ GL . drawBuffersExt . drawBuffersWEBGL ( bufArray ) ;
5440
+ } ,
5427
5441
// signatures of simple pass-through functions, see later
5428
5442
5429
5443
glActiveTexture__sig : 'vi' ,
0 commit comments