@@ -2735,11 +2735,11 @@ function WebGLRenderer( parameters ) {
2735
2735
if ( p === UnsignedIntType ) return _gl . UNSIGNED_INT ;
2736
2736
if ( p === FloatType ) return _gl . FLOAT ;
2737
2737
2738
- extension = extensions . get ( 'OES_texture_half_float' ) ;
2738
+ if ( p === HalfFloatType ) {
2739
2739
2740
- if ( extension !== null ) {
2740
+ extension = extensions . get ( 'OES_texture_half_float' ) ;
2741
2741
2742
- if ( p === HalfFloatType ) return extension . HALF_FLOAT_OES ;
2742
+ if ( extension !== null ) return extension . HALF_FLOAT_OES ;
2743
2743
2744
2744
}
2745
2745
@@ -2768,50 +2768,64 @@ function WebGLRenderer( parameters ) {
2768
2768
if ( p === OneMinusDstColorFactor ) return _gl . ONE_MINUS_DST_COLOR ;
2769
2769
if ( p === SrcAlphaSaturateFactor ) return _gl . SRC_ALPHA_SATURATE ;
2770
2770
2771
- extension = extensions . get ( 'WEBGL_compressed_texture_s3tc' ) ;
2771
+ if ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format ||
2772
+ p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {
2772
2773
2773
- if ( extension !== null ) {
2774
+ extension = extensions . get ( 'WEBGL_compressed_texture_s3tc' ) ;
2774
2775
2775
- if ( p === RGB_S3TC_DXT1_Format ) return extension . COMPRESSED_RGB_S3TC_DXT1_EXT ;
2776
- if ( p === RGBA_S3TC_DXT1_Format ) return extension . COMPRESSED_RGBA_S3TC_DXT1_EXT ;
2777
- if ( p === RGBA_S3TC_DXT3_Format ) return extension . COMPRESSED_RGBA_S3TC_DXT3_EXT ;
2778
- if ( p === RGBA_S3TC_DXT5_Format ) return extension . COMPRESSED_RGBA_S3TC_DXT5_EXT ;
2776
+ if ( extension !== null ) {
2777
+
2778
+ if ( p === RGB_S3TC_DXT1_Format ) return extension . COMPRESSED_RGB_S3TC_DXT1_EXT ;
2779
+ if ( p === RGBA_S3TC_DXT1_Format ) return extension . COMPRESSED_RGBA_S3TC_DXT1_EXT ;
2780
+ if ( p === RGBA_S3TC_DXT3_Format ) return extension . COMPRESSED_RGBA_S3TC_DXT3_EXT ;
2781
+ if ( p === RGBA_S3TC_DXT5_Format ) return extension . COMPRESSED_RGBA_S3TC_DXT5_EXT ;
2782
+
2783
+ }
2779
2784
2780
2785
}
2781
2786
2782
- extension = extensions . get ( 'WEBGL_compressed_texture_pvrtc' ) ;
2787
+ if ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format ||
2788
+ p === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) {
2783
2789
2784
- if ( extension !== null ) {
2790
+ extension = extensions . get ( 'WEBGL_compressed_texture_pvrtc' ) ;
2785
2791
2786
- if ( p === RGB_PVRTC_4BPPV1_Format ) return extension . COMPRESSED_RGB_PVRTC_4BPPV1_IMG ;
2787
- if ( p === RGB_PVRTC_2BPPV1_Format ) return extension . COMPRESSED_RGB_PVRTC_2BPPV1_IMG ;
2788
- if ( p === RGBA_PVRTC_4BPPV1_Format ) return extension . COMPRESSED_RGBA_PVRTC_4BPPV1_IMG ;
2789
- if ( p === RGBA_PVRTC_2BPPV1_Format ) return extension . COMPRESSED_RGBA_PVRTC_2BPPV1_IMG ;
2792
+ if ( extension !== null ) {
2793
+
2794
+ if ( p === RGB_PVRTC_4BPPV1_Format ) return extension . COMPRESSED_RGB_PVRTC_4BPPV1_IMG ;
2795
+ if ( p === RGB_PVRTC_2BPPV1_Format ) return extension . COMPRESSED_RGB_PVRTC_2BPPV1_IMG ;
2796
+ if ( p === RGBA_PVRTC_4BPPV1_Format ) return extension . COMPRESSED_RGBA_PVRTC_4BPPV1_IMG ;
2797
+ if ( p === RGBA_PVRTC_2BPPV1_Format ) return extension . COMPRESSED_RGBA_PVRTC_2BPPV1_IMG ;
2798
+
2799
+ }
2790
2800
2791
2801
}
2792
2802
2793
- extension = extensions . get ( 'WEBGL_compressed_texture_etc1' ) ;
2803
+ if ( p === RGB_ETC1_Format ) {
2794
2804
2795
- if ( extension !== null ) {
2805
+ extension = extensions . get ( 'WEBGL_compressed_texture_etc1' ) ;
2796
2806
2797
- if ( p === RGB_ETC1_Format ) return extension . COMPRESSED_RGB_ETC1_WEBGL ;
2807
+ if ( extension !== null ) return extension . COMPRESSED_RGB_ETC1_WEBGL ;
2798
2808
2799
2809
}
2800
2810
2801
- extension = extensions . get ( 'EXT_blend_minmax' ) ;
2811
+ if ( p === MinEquation || p === MaxEquation ) {
2812
+
2813
+ extension = extensions . get ( 'EXT_blend_minmax' ) ;
2802
2814
2803
- if ( extension !== null ) {
2815
+ if ( extension !== null ) {
2804
2816
2805
- if ( p === MinEquation ) return extension . MIN_EXT ;
2806
- if ( p === MaxEquation ) return extension . MAX_EXT ;
2817
+ if ( p === MinEquation ) return extension . MIN_EXT ;
2818
+ if ( p === MaxEquation ) return extension . MAX_EXT ;
2819
+
2820
+ }
2807
2821
2808
2822
}
2809
2823
2810
- extension = extensions . get ( 'WEBGL_depth_texture' ) ;
2824
+ if ( p === UnsignedInt248Type ) {
2811
2825
2812
- if ( extension !== null ) {
2826
+ extension = extensions . get ( 'WEBGL_depth_texture' ) ;
2813
2827
2814
- if ( p === UnsignedInt248Type ) return extension . UNSIGNED_INT_24_8_WEBGL ;
2828
+ if ( extension !== null ) return extension . UNSIGNED_INT_24_8_WEBGL ;
2815
2829
2816
2830
}
2817
2831
0 commit comments