@@ -9,6 +9,7 @@ const { getOESTextureFloat } = require('./extensions/oes-texture-float')
99const { getSTACKGLDestroyContext } = require ( './extensions/stackgl-destroy-context' )
1010const { getSTACKGLResizeDrawingBuffer } = require ( './extensions/stackgl-resize-drawing-buffer' )
1111const { getWebGLDrawBuffers } = require ( './extensions/webgl-draw-buffers' )
12+ const { getEXTBlendMinMax } = require ( './extensions/ext-blend-minmax' )
1213const {
1314 bindPublics,
1415 checkObject,
@@ -57,7 +58,8 @@ const availableExtensions = {
5758 oes_standard_derivatives : getOESStandardDerivatives ,
5859 stackgl_destroy_context : getSTACKGLDestroyContext ,
5960 stackgl_resize_drawingbuffer : getSTACKGLResizeDrawingBuffer ,
60- webgl_draw_buffers : getWebGLDrawBuffers
61+ webgl_draw_buffers : getWebGLDrawBuffers ,
62+ ext_blend_minmax : getEXTBlendMinMax
6163}
6264
6365const privateMethods = [
@@ -769,7 +771,10 @@ class WebGLRenderingContext extends NativeWebGLRenderingContext {
769771 _validBlendMode ( mode ) {
770772 return mode === gl . FUNC_ADD ||
771773 mode === gl . FUNC_SUBTRACT ||
772- mode === gl . FUNC_REVERSE_SUBTRACT
774+ mode === gl . FUNC_REVERSE_SUBTRACT ||
775+ ( this . _extensions . ext_blend_minmax && (
776+ mode === this . _extensions . ext_blend_minmax . MIN_EXT ||
777+ mode === this . _extensions . ext_blend_minmax . MAX_EXT ) )
773778 }
774779
775780 _validCubeTarget ( target ) {
@@ -1211,6 +1216,10 @@ class WebGLRenderingContext extends NativeWebGLRenderingContext {
12111216 exts . push ( 'WEBGL_draw_buffers' )
12121217 }
12131218
1219+ if ( supportedExts . indexOf ( 'EXT_blend_minmax' ) >= 0 ) {
1220+ exts . push ( 'EXT_blend_minmax' )
1221+ }
1222+
12141223 return exts
12151224 }
12161225
0 commit comments