22 * @author thespite / http://www.twitter.com/thespite
33 */
44
5- import { MaxEquation , MinEquation , RGBA_ASTC_4x4_Format , RGBA_ASTC_5x4_Format , RGBA_ASTC_5x5_Format , RGBA_ASTC_6x5_Format , RGBA_ASTC_6x6_Format , RGBA_ASTC_8x5_Format , RGBA_ASTC_8x6_Format , RGBA_ASTC_8x8_Format , RGBA_ASTC_10x5_Format , RGBA_ASTC_10x6_Format , RGBA_ASTC_10x8_Format , RGBA_ASTC_10x10_Format , RGBA_ASTC_12x10_Format , RGBA_ASTC_12x12_Format , RGB_ETC1_Format , RGBA_PVRTC_2BPPV1_Format , RGBA_PVRTC_4BPPV1_Format , RGB_PVRTC_2BPPV1_Format , RGB_PVRTC_4BPPV1_Format , RGBA_S3TC_DXT5_Format , RGBA_S3TC_DXT3_Format , RGBA_S3TC_DXT1_Format , RGB_S3TC_DXT1_Format , SrcAlphaSaturateFactor , OneMinusDstColorFactor , DstColorFactor , OneMinusDstAlphaFactor , DstAlphaFactor , OneMinusSrcAlphaFactor , SrcAlphaFactor , OneMinusSrcColorFactor , SrcColorFactor , OneFactor , ZeroFactor , ReverseSubtractEquation , SubtractEquation , AddEquation , DepthFormat , DepthStencilFormat , LuminanceAlphaFormat , LuminanceFormat , RedFormat , RGBAFormat , RGBFormat , AlphaFormat , HalfFloatType , FloatType , UnsignedIntType , IntType , UnsignedShortType , ShortType , ByteType , UnsignedInt248Type , UnsignedShort565Type , UnsignedShort5551Type , UnsignedShort4444Type , UnsignedByteType , LinearMipmapLinearFilter , LinearMipmapNearestFilter , LinearFilter , NearestMipmapLinearFilter , NearestMipmapNearestFilter , NearestFilter , MirroredRepeatWrapping , ClampToEdgeWrapping , RepeatWrapping } from '../../constants.js' ;
5+ import { RGBA_ASTC_4x4_Format , RGBA_ASTC_5x4_Format , RGBA_ASTC_5x5_Format , RGBA_ASTC_6x5_Format , RGBA_ASTC_6x6_Format , RGBA_ASTC_8x5_Format , RGBA_ASTC_8x6_Format , RGBA_ASTC_8x8_Format , RGBA_ASTC_10x5_Format , RGBA_ASTC_10x6_Format , RGBA_ASTC_10x8_Format , RGBA_ASTC_10x10_Format , RGBA_ASTC_12x10_Format , RGBA_ASTC_12x12_Format , RGB_ETC1_Format , RGBA_PVRTC_2BPPV1_Format , RGBA_PVRTC_4BPPV1_Format , RGB_PVRTC_2BPPV1_Format , RGB_PVRTC_4BPPV1_Format , RGBA_S3TC_DXT5_Format , RGBA_S3TC_DXT3_Format , RGBA_S3TC_DXT1_Format , RGB_S3TC_DXT1_Format , DepthFormat , DepthStencilFormat , LuminanceAlphaFormat , LuminanceFormat , RedFormat , RGBAFormat , RGBFormat , AlphaFormat , HalfFloatType , FloatType , UnsignedIntType , IntType , UnsignedShortType , ShortType , ByteType , UnsignedInt248Type , UnsignedShort565Type , UnsignedShort5551Type , UnsignedShort4444Type , UnsignedByteType } from '../../constants.js' ;
66
77function WebGLUtils ( gl , extensions , capabilities ) {
88
@@ -12,18 +12,6 @@ function WebGLUtils( gl, extensions, capabilities ) {
1212
1313 var extension ;
1414
15- if ( p === RepeatWrapping ) return gl . REPEAT ;
16- if ( p === ClampToEdgeWrapping ) return gl . CLAMP_TO_EDGE ;
17- if ( p === MirroredRepeatWrapping ) return gl . MIRRORED_REPEAT ;
18-
19- if ( p === NearestFilter ) return gl . NEAREST ;
20- if ( p === NearestMipmapNearestFilter ) return gl . NEAREST_MIPMAP_NEAREST ;
21- if ( p === NearestMipmapLinearFilter ) return gl . NEAREST_MIPMAP_LINEAR ;
22-
23- if ( p === LinearFilter ) return gl . LINEAR ;
24- if ( p === LinearMipmapNearestFilter ) return gl . LINEAR_MIPMAP_NEAREST ;
25- if ( p === LinearMipmapLinearFilter ) return gl . LINEAR_MIPMAP_LINEAR ;
26-
2715 if ( p === UnsignedByteType ) return gl . UNSIGNED_BYTE ;
2816 if ( p === UnsignedShort4444Type ) return gl . UNSIGNED_SHORT_4_4_4_4 ;
2917 if ( p === UnsignedShort5551Type ) return gl . UNSIGNED_SHORT_5_5_5_1 ;
@@ -55,23 +43,6 @@ function WebGLUtils( gl, extensions, capabilities ) {
5543 if ( p === DepthStencilFormat ) return gl . DEPTH_STENCIL ;
5644 if ( p === RedFormat ) return gl . RED ;
5745
58- if ( p === AddEquation ) return gl . FUNC_ADD ;
59- if ( p === SubtractEquation ) return gl . FUNC_SUBTRACT ;
60- if ( p === ReverseSubtractEquation ) return gl . FUNC_REVERSE_SUBTRACT ;
61-
62- if ( p === ZeroFactor ) return gl . ZERO ;
63- if ( p === OneFactor ) return gl . ONE ;
64- if ( p === SrcColorFactor ) return gl . SRC_COLOR ;
65- if ( p === OneMinusSrcColorFactor ) return gl . ONE_MINUS_SRC_COLOR ;
66- if ( p === SrcAlphaFactor ) return gl . SRC_ALPHA ;
67- if ( p === OneMinusSrcAlphaFactor ) return gl . ONE_MINUS_SRC_ALPHA ;
68- if ( p === DstAlphaFactor ) return gl . DST_ALPHA ;
69- if ( p === OneMinusDstAlphaFactor ) return gl . ONE_MINUS_DST_ALPHA ;
70-
71- if ( p === DstColorFactor ) return gl . DST_COLOR ;
72- if ( p === OneMinusDstColorFactor ) return gl . ONE_MINUS_DST_COLOR ;
73- if ( p === SrcAlphaSaturateFactor ) return gl . SRC_ALPHA_SATURATE ;
74-
7546 if ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format ||
7647 p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {
7748
@@ -128,26 +99,6 @@ function WebGLUtils( gl, extensions, capabilities ) {
12899
129100 }
130101
131- if ( p === MinEquation || p === MaxEquation ) {
132-
133- if ( isWebGL2 ) {
134-
135- if ( p === MinEquation ) return gl . MIN ;
136- if ( p === MaxEquation ) return gl . MAX ;
137-
138- }
139-
140- extension = extensions . get ( 'EXT_blend_minmax' ) ;
141-
142- if ( extension !== null ) {
143-
144- if ( p === MinEquation ) return extension . MIN_EXT ;
145- if ( p === MaxEquation ) return extension . MAX_EXT ;
146-
147- }
148-
149- }
150-
151102 if ( p === UnsignedInt248Type ) {
152103
153104 if ( isWebGL2 ) return gl . UNSIGNED_INT_24_8 ;
0 commit comments