@@ -1518,14 +1518,14 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
1518
1518
glCompressedTexImage2D : ( target , level , internalFormat , width , height , border , imageSize , data ) = > {
1519
1519
#if MAX_WEBGL_VERSION >= 2
1520
1520
if ( { { { isCurrentContextWebGL2( ) } } } ) {
1521
- // WebGL 2 provides new garbage-free entry points to call to WebGL. Use
1522
- // those always when possible.
1523
1521
if ( GLctx . currentPixelUnpackBufferBinding || ! imageSize ) {
1524
1522
GLctx . compressedTexImage2D ( target , level , internalFormat , width , height , border , imageSize , data ) ;
1525
- } else {
1526
- GLctx . compressedTexImage2D( target , level, internalFormat, width, height, border, HEAPU8 , data, imageSize) ;
1523
+ return ;
1527
1524
}
1525
+ #if WEBGL_USE_GARBAGE_FREE_APIS
1526
+ GLctx . compressedTexImage2D ( target , level , internalFormat , width , height , border , HEAPU8 , data , imageSize ) ;
1528
1527
return ;
1528
+ #endif
1529
1529
}
1530
1530
#endif
1531
1531
GLctx . compressedTexImage2D ( target , level , internalFormat , width , height , border , data ? { { { makeHEAPView ( 'U8' , 'data' , 'data+imageSize' ) } } } : null ) ;
@@ -1535,14 +1535,14 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
1535
1535
glCompressedTexSubImage2D : ( target , level , xoffset , yoffset , width , height , format , imageSize , data ) = > {
1536
1536
#if MAX_WEBGL_VERSION >= 2
1537
1537
if ( { { { isCurrentContextWebGL2( ) } } } ) {
1538
- // WebGL 2 provides new garbage-free entry points to call to WebGL. Use
1539
- // those always when possible.
1540
1538
if ( GLctx . currentPixelUnpackBufferBinding || ! imageSize ) {
1541
1539
GLctx . compressedTexSubImage2D ( target , level , xoffset , yoffset , width , height , format , imageSize , data ) ;
1542
- } else {
1543
- GLctx . compressedTexSubImage2D( target , level, xoffset, yoffset, width, height, format, HEAPU8 , data, imageSize) ;
1540
+ return ;
1544
1541
}
1542
+ #if WEBGL_USE_GARBAGE_FREE_APIS
1543
+ GLctx . compressedTexSubImage2D ( target , level , xoffset , yoffset , width , height , format , HEAPU8 , data , imageSize ) ;
1545
1544
return ;
1545
+ #endif
1546
1546
}
1547
1547
#endif
1548
1548
GLctx . compressedTexSubImage2D ( target , level , xoffset , yoffset , width , height , format , data ? { { { makeHEAPView ( 'U8' , 'data' , 'data+imageSize' ) } } } : null ) ;
@@ -1637,20 +1637,21 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
1637
1637
}
1638
1638
#endif
1639
1639
if ( { { { isCurrentContextWebGL2( ) } } } ) {
1640
- // WebGL 2 provides new garbage-free entry points to call to WebGL. Use
1641
- // those always when possible.
1642
1640
if ( GLctx . currentPixelUnpackBufferBinding ) {
1643
1641
GLctx . texImage2D ( target , level , internalFormat , width , height , border , format , type , pixels ) ;
1644
- } else if ( pixels ) {
1642
+ return ;
1643
+ }
1644
+ #if WEBGL_USE_GARBAGE_FREE_APIS
1645
+ if ( pixels ) {
1645
1646
var heap = heapObjectForWebGLType ( type ) ;
1646
1647
GLctx . texImage2D ( target , level , internalFormat , width , height , border , format , type , heap , toTypedArrayIndex ( pixels , heap ) ) ;
1647
- } else {
1648
- GLctx . texImage2D( target , level, internalFormat, width, height, border, format, type, null) ;
1648
+ return ;
1649
1649
}
1650
- return ;
1650
+ #endif
1651
1651
}
1652
1652
#endif
1653
- GLctx . texImage2D ( target , level, internalFormat, width, height, border, format, type, pixels ? emscriptenWebGLGetTexPixelData ( type, format, width, height, pixels, internalFormat ) : null ) ;
1653
+ var pixelData = pixels ? emscriptenWebGLGetTexPixelData ( type , format , width , height , pixels , internalFormat ) : null ;
1654
+ GLctx . texImage2D ( target , level , internalFormat , width , height , border , format , type , pixelData ) ;
1654
1655
} ,
1655
1656
1656
1657
glTexSubImage2D__deps : [ '$emscriptenWebGLGetTexPixelData'
@@ -1670,15 +1671,17 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
1670
1671
}
1671
1672
#endif
1672
1673
if ( { { { isCurrentContextWebGL2( ) } } } ) {
1673
- // WebGL 2 provides new garbage-free entry points to call to WebGL. Use
1674
- // those always when possible.
1675
1674
if ( GLctx . currentPixelUnpackBufferBinding ) {
1676
1675
GLctx . texSubImage2D( target , level, xoffset, yoffset, width, height, format, type, pixels) ;
1677
- } else if ( pixels ) {
1676
+ return ;
1677
+ }
1678
+ #if WEBGL_USE_GARBAGE_FREE_APIS
1679
+ if ( pixels ) {
1678
1680
var heap = heapObjectForWebGLType ( type ) ;
1679
1681
GLctx . texSubImage2D ( target , level , xoffset , yoffset , width , height , format , type , heap , toTypedArrayIndex ( pixels , heap ) ) ;
1680
1682
return ;
1681
1683
}
1684
+ #endif
1682
1685
}
1683
1686
#endif
1684
1687
var pixelData = pixels ? emscriptenWebGLGetTexPixelData ( type , format , width , height , pixels , 0 ) : null ;
@@ -1693,16 +1696,16 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
1693
1696
glReadPixels : ( x , y , width , height , format , type , pixels ) => {
1694
1697
#if MAX_WEBGL_VERSION >= 2
1695
1698
if ( { { { isCurrentContextWebGL2( ) } } } ) {
1696
- // WebGL 2 provides new garbage-free entry points to call to WebGL. Use
1697
- // those always when possible.
1698
1699
if ( GLctx . currentPixelPackBufferBinding ) {
1699
1700
GLctx . readPixels ( x , y , width , height , format , type , pixels ) ;
1700
- } else {
1701
- var heap = heapObjectForWebGLType ( type ) ;
1702
- var target = toTypedArrayIndex ( pixels , heap ) ;
1703
- GLctx . readPixels ( x , y , width , height , format , type , heap , target ) ;
1701
+ return ;
1704
1702
}
1703
+ #if WEBGL_USE_GARBAGE_FREE_APIS
1704
+ var heap = heapObjectForWebGLType ( type ) ;
1705
+ var target = toTypedArrayIndex ( pixels , heap ) ;
1706
+ GLctx . readPixels ( x , y , width , height , format , type , heap , target ) ;
1705
1707
return ;
1708
+ #endif
1706
1709
}
1707
1710
#endif
1708
1711
var pixelData = emscriptenWebGLGetTexPixelData ( type , format , width , height , pixels , format ) ;
@@ -1839,14 +1842,12 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
1839
1842
}
1840
1843
#endif
1841
1844
1842
- #if MAX_WEBGL_VERSION >= 2
1845
+ #if WEBGL_USE_GARBAGE_FREE_APIS
1843
1846
if ( { { { isCurrentContextWebGL2 ( ) } } } ) {
1844
- // WebGL 2 provides new garbage-free entry points to call to WebGL. Use
1845
- // those always when possible. If size is zero, WebGL would interpret
1846
- // uploading the whole input arraybuffer (starting from given offset),
1847
- // which would not make sense in WebAssembly, so avoid uploading if size
1848
- // is zero. However we must still call bufferData to establish a backing
1849
- // storage of zero bytes.
1847
+ // If size is zero, WebGL would interpret uploading the whole input
1848
+ // arraybuffer (starting from given offset), which would not make sense in
1849
+ // WebAssembly, so avoid uploading if size is zero. However we must still
1850
+ // call bufferData to establish a backing storage of zero bytes.
1850
1851
if ( data && size ) {
1851
1852
GLctx . bufferData ( target , HEAPU8 , usage , data , size ) ;
1852
1853
} else {
@@ -1863,10 +1864,8 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
1863
1864
} ,
1864
1865
1865
1866
glBufferSubData : ( target , offset , size , data ) = > {
1866
- #if MAX_WEBGL_VERSION >= 2
1867
+ #if WEBGL_USE_GARBAGE_FREE_APIS
1867
1868
if ( { { { isCurrentContextWebGL2( ) } } } ) {
1868
- // WebGL 2 provides new garbage-free entry points to call to WebGL. Use
1869
- // those always when possible.
1870
1869
size && GLctx . bufferSubData ( target , offset , HEAPU8 , data , size ) ;
1871
1870
return ;
1872
1871
}
@@ -2429,8 +2428,8 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
2429
2428
count && GLctx . uniform1iv ( webglGetUniformLocation ( location ) , HEAP32 , { { { getHeapOffset ( 'value' , 'i32' ) } } } , count ) ;
2430
2429
#else
2431
2430
2432
- #if MAX_WEBGL_VERSION >= 2
2433
- if ( { { { isCurrentContextWebGL2( ) } } } ) { // WebGL 2 provides new garbage-free entry points to call to WebGL. Use those always when possible.
2431
+ #if WEBGL_USE_GARBAGE_FREE_APIS
2432
+ if ( { { { isCurrentContextWebGL2( ) } } } ) {
2434
2433
count && GLctx . uniform1iv ( webglGetUniformLocation ( location ) , HEAP32 , { { { getHeapOffset ( 'value' , 'i32' ) } } } , count) ;
2435
2434
return ;
2436
2435
}
@@ -2470,8 +2469,8 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
2470
2469
count && GLctx . uniform2iv ( webglGetUniformLocation ( location ) , HEAP32 , { { { getHeapOffset ( 'value' , 'i32' ) } } } , count * 2 ) ;
2471
2470
#else
2472
2471
2473
- #if MAX_WEBGL_VERSION >= 2
2474
- if ( { { { isCurrentContextWebGL2( ) } } } ) { // WebGL 2 provides new garbage-free entry points to call to WebGL. Use those always when possible.
2472
+ #if WEBGL_USE_GARBAGE_FREE_APIS
2473
+ if ( { { { isCurrentContextWebGL2( ) } } } ) {
2475
2474
count && GLctx . uniform2iv ( webglGetUniformLocation ( location ) , HEAP32 , { { { getHeapOffset ( 'value' , 'i32' ) } } } , count * 2 ) ;
2476
2475
return ;
2477
2476
}
@@ -2512,8 +2511,8 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
2512
2511
count && GLctx . uniform3iv ( webglGetUniformLocation ( location ) , HEAP32 , { { { getHeapOffset ( 'value' , 'i32' ) } } } , count * 3 ) ;
2513
2512
#else
2514
2513
2515
- #if MAX_WEBGL_VERSION >= 2
2516
- if ( { { { isCurrentContextWebGL2( ) } } } ) { // WebGL 2 provides new garbage-free entry points to call to WebGL. Use those always when possible.
2514
+ #if WEBGL_USE_GARBAGE_FREE_APIS
2515
+ if ( { { { isCurrentContextWebGL2( ) } } } ) {
2517
2516
count && GLctx . uniform3iv ( webglGetUniformLocation ( location ) , HEAP32 , { { { getHeapOffset ( 'value' , 'i32' ) } } } , count * 3 ) ;
2518
2517
return ;
2519
2518
}
@@ -2555,9 +2554,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
2555
2554
count && GLctx . uniform4iv ( webglGetUniformLocation ( location ) , HEAP32 , { { { getHeapOffset ( 'value' , 'i32' ) } } } , count * 4 ) ;
2556
2555
#else
2557
2556
2558
- #if MAX_WEBGL_VERSION >= 2
2559
- // WebGL 2 provides new garbage-free entry points to call to WebGL. Use
2560
- // those always when possible.
2557
+ #if WEBGL_USE_GARBAGE_FREE_APIS
2561
2558
if ( { { { isCurrentContextWebGL2( ) } } } ) {
2562
2559
count && GLctx . uniform4iv ( webglGetUniformLocation ( location ) , HEAP32 , { { { getHeapOffset ( 'value' , 'i32' ) } } } , count * 4 ) ;
2563
2560
return ;
@@ -2601,8 +2598,8 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
2601
2598
count && GLctx . uniform1fv ( webglGetUniformLocation ( location ) , HEAPF32 , { { { getHeapOffset ( 'value' , 'float' ) } } } , count ) ;
2602
2599
#else
2603
2600
2604
- #if MAX_WEBGL_VERSION >= 2
2605
- if ( { { { isCurrentContextWebGL2( ) } } } ) { // WebGL 2 provides new garbage-free entry points to call to WebGL. Use those always when possible.
2601
+ #if WEBGL_USE_GARBAGE_FREE_APIS
2602
+ if ( { { { isCurrentContextWebGL2( ) } } } ) {
2606
2603
count && GLctx . uniform1fv ( webglGetUniformLocation ( location ) , HEAPF32 , { { { getHeapOffset ( 'value' , 'float' ) } } } , count ) ;
2607
2604
return ;
2608
2605
}
@@ -2642,9 +2639,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
2642
2639
count && GLctx . uniform2fv ( webglGetUniformLocation ( location ) , HEAPF32 , { { { getHeapOffset ( 'value' , 'float' ) } } } , count * 2 ) ;
2643
2640
#else
2644
2641
2645
- #if MAX_WEBGL_VERSION >= 2
2646
- // WebGL 2 provides new garbage-free entry points to call to WebGL. Use
2647
- // those always when possible.
2642
+ #if WEBGL_USE_GARBAGE_FREE_APIS
2648
2643
if ( { { { isCurrentContextWebGL2( ) } } } ) {
2649
2644
count && GLctx . uniform2fv ( webglGetUniformLocation ( location ) , HEAPF32 , { { { getHeapOffset ( 'value' , 'float' ) } } } , count * 2 ) ;
2650
2645
return ;
@@ -2669,7 +2664,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
2669
2664
} ,
2670
2665
2671
2666
glUniform3fv__deps : [ '$webglGetUniformLocation'
2672
- #if GL_POOL_TEMP_BUFFERS && MIN_WEBGL_VERSION == 1
2667
+ #if GL_POOL_TEMP_BUFFERS && ! ( MIN_WEBGL_VERSION >= 2 && WEBGL_USE_GARBAGE_FREE_APIS )
2673
2668
, '$miniTempWebGLFloatBuffers'
2674
2669
#endif
2675
2670
] ,
@@ -2679,16 +2674,14 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
2679
2674
assert ( ( value % 4 ) == 0 , 'Pointer to float data passed to glUniform3fv must be aligned to four bytes!' + value ) ;
2680
2675
#endif
2681
2676
2682
- #if MIN_WEBGL_VERSION >= 2
2677
+ #if MIN_WEBGL_VERSION >= 2 && WEBGL_USE_GARBAGE_FREE_APIS
2683
2678
#if GL_ASSERTIONS
2684
2679
assert ( GL . currentContext . version >= 2 ) ;
2685
2680
#endif
2686
2681
count && GLctx . uniform3fv ( webglGetUniformLocation ( location ) , HEAPF32 , { { { getHeapOffset ( 'value' , 'float' ) } } } , count * 3 ) ;
2687
2682
#else
2688
2683
2689
- #if MAX_WEBGL_VERSION >= 2
2690
- // WebGL 2 provides new garbage-free entry points to call to WebGL. Use
2691
- // those always when possible.
2684
+ #if WEBGL_USE_GARBAGE_FREE_APIS
2692
2685
if ( { { { isCurrentContextWebGL2( ) } } } ) {
2693
2686
count && GLctx . uniform3fv ( webglGetUniformLocation ( location ) , HEAPF32 , { { { getHeapOffset ( 'value' , 'float' ) } } } , count * 3 ) ;
2694
2687
return ;
@@ -2731,9 +2724,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
2731
2724
count && GLctx . uniform4fv ( webglGetUniformLocation ( location ) , HEAPF32 , { { { getHeapOffset ( 'value' , 'float' ) } } } , count * 4 ) ;
2732
2725
#else
2733
2726
2734
- #if MAX_WEBGL_VERSION >= 2
2735
- // WebGL 2 provides new garbage-free entry points to call to WebGL. Use
2736
- // those always when possible.
2727
+ #if WEBGL_USE_GARBAGE_FREE_APIS
2737
2728
if ( { { { isCurrentContextWebGL2( ) } } } ) {
2738
2729
count && GLctx . uniform4fv ( webglGetUniformLocation ( location ) , HEAPF32 , { { { getHeapOffset ( 'value' , 'float' ) } } } , count * 4 ) ;
2739
2730
return ;
@@ -2781,9 +2772,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
2781
2772
count && GLctx . uniformMatrix2fv ( webglGetUniformLocation ( location ) , ! ! transpose , HEAPF32 , { { { getHeapOffset ( 'value' , 'float' ) } } } , count * 4 ) ;
2782
2773
#else
2783
2774
2784
- #if MAX_WEBGL_VERSION >= 2
2785
- // WebGL 2 provides new garbage-free entry points to call to WebGL. Use
2786
- // those always when possible.
2775
+ #if WEBGL_USE_GARBAGE_FREE_APIS
2787
2776
if ( { { { isCurrentContextWebGL2( ) } } } ) {
2788
2777
count && GLctx . uniformMatrix2fv ( webglGetUniformLocation ( location ) , ! ! transpose , HEAPF32 , { { { getHeapOffset ( 'value' , 'float' ) } } } , count * 4 ) ;
2789
2778
return ;
@@ -2827,9 +2816,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
2827
2816
count && GLctx . uniformMatrix3fv ( webglGetUniformLocation ( location ) , ! ! transpose , HEAPF32 , { { { getHeapOffset ( 'value' , 'float' ) } } } , count * 9 ) ;
2828
2817
#else
2829
2818
2830
- #if MAX_WEBGL_VERSION >= 2
2831
- // WebGL 2 provides new garbage-free entry points to call to WebGL. Use
2832
- // those always when possible.
2819
+ #if WEBGL_USE_GARBAGE_FREE_APIS
2833
2820
if ( { { { isCurrentContextWebGL2( ) } } } ) {
2834
2821
count && GLctx . uniformMatrix3fv ( webglGetUniformLocation ( location ) , ! ! transpose , HEAPF32 , { { { getHeapOffset ( 'value' , 'float' ) } } } , count * 9 ) ;
2835
2822
return ;
@@ -2861,7 +2848,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
2861
2848
} ,
2862
2849
2863
2850
glUniformMatrix4fv__deps : [ '$webglGetUniformLocation'
2864
- #if GL_POOL_TEMP_BUFFERS && MIN_WEBGL_VERSION == 1
2851
+ #if GL_POOL_TEMP_BUFFERS && ! ( MIN_WEBGL_VERSION >= 2 && WEBGL_USE_GARBAGE_FREE_APIS )
2865
2852
, '$miniTempWebGLFloatBuffers'
2866
2853
#endif
2867
2854
] ,
@@ -2871,16 +2858,14 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
2871
2858
assert ( ( value & 3 ) == 0 , 'Pointer to float data passed to glUniformMatrix4fv must be aligned to four bytes!' ) ;
2872
2859
#endif
2873
2860
2874
- #if MIN_WEBGL_VERSION >= 2
2861
+ #if MIN_WEBGL_VERSION >= 2 && WEBGL_USE_GARBAGE_FREE_APIS
2875
2862
#if GL_ASSERTIONS
2876
2863
assert ( GL . currentContext . version >= 2 ) ;
2877
2864
#endif
2878
2865
count && GLctx . uniformMatrix4fv ( webglGetUniformLocation ( location ) , ! ! transpose , HEAPF32 , { { { getHeapOffset ( 'value' , 'float' ) } } } , count * 16 ) ;
2879
2866
#else
2880
2867
2881
- #if MAX_WEBGL_VERSION >= 2
2882
- // WebGL 2 provides new garbage-free entry points to call to WebGL. Use
2883
- // those always when possible.
2868
+ #if WEBGL_USE_GARBAGE_FREE_APIS
2884
2869
if ( { { { isCurrentContextWebGL2( ) } } } ) {
2885
2870
count && GLctx . uniformMatrix4fv ( webglGetUniformLocation ( location ) , ! ! transpose , HEAPF32 , { { { getHeapOffset ( 'value' , 'float' ) } } } , count * 16 ) ;
2886
2871
return ;
@@ -2919,7 +2904,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
2919
2904
var view = { { { makeHEAPView ( 'F32' , 'value' , 'value+count*64' ) } } } ;
2920
2905
}
2921
2906
GLctx . uniformMatrix4fv ( webglGetUniformLocation ( location ) , ! ! transpose , view ) ;
2922
- #endif // MIN_WEBGL_VERSION >= 2
2907
+ #endif // MIN_WEBGL_VERSION >= 2 && WEBGL_USE_GARBAGE_FREE_APIS
2923
2908
} ,
2924
2909
2925
2910
glBindBuffer : ( target , buffer ) = > {
@@ -4155,11 +4140,12 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
4155
4140
}
4156
4141
4157
4142
if ( ! ( mapping . access & 0x10 ) ) { /* GL_MAP_FLUSH_EXPLICIT_BIT */
4158
- if ( { { { isCurrentContextWebGL2( ) } } } ) { // WebGL 2 provides new garbage-free entry points to call to WebGL. Use those always when possible.
4143
+ #if WEBGL_USE_GARBAGE_FREE_APIS
4144
+ if ( { { { isCurrentContextWebGL2( ) } } } ) {
4159
4145
GLctx . bufferSubData ( target , mapping . offset , HEAPU8 , mapping . mem , mapping . length ) ;
4160
- } else {
4161
- GLctx . bufferSubData ( target , mapping . offset , HEAPU8 . subarray ( mapping . mem , mapping . mem + mapping . length ) ) ;
4162
- }
4146
+ } else
4147
+ #endif
4148
+ GLctx . bufferSubData ( target , mapping . offset , HEAPU8 . subarray ( mapping . mem , mapping . mem + mapping . length ) ) ;
4163
4149
}
4164
4150
_free ( mapping . mem ) ;
4165
4151
mapping . mem = 0 ;
0 commit comments