|
2 | 2 | * @author thespite / http://www.twitter.com/thespite |
3 | 3 | */ |
4 | 4 |
|
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, RedIntegerFormat, R8Format, R8UIFormat, R16FFormat, R32FFormat, RGFormat, RGIntegerFormat, RGBIntegerFormat, RGBAIntegerFormat, RG8Format, RG8UIFormat, RG16FFormat, RG32FFormat, RGB8Format, RGB8UIFormat, RGB16FFormat, RGB32FFormat, RGBA8Format, RGBA8UIFormat, RGBA16FFormat, RGBA32FFormat } from '../../constants.js'; |
| 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, RGBAFormat, RGBAIntegerFormat, RGBFormat, RGBIntegerFormat, AlphaFormat, RedFormat, RedIntegerFormat, R8Format, R8_SNORMFormat, R8IFormat, R8UIFormat, R16IFormat, R16UIFormat, R16FFormat, R32IFormat, R32UIFormat, R32FFormat, RGFormat, RGIntegerFormat, RG8Format, RG8_SNORMFormat, RG8IFormat, RG8UIFormat, RG16IFormat, RG16UIFormat, RG16FFormat, RG32IFormat, RG32UIFormat, RG32FFormat, RGB565Format, RGB8Format, RGB8_SNORMFormat, RGB8IFormat, RGB8UIFormat, RGB9_E5Format, RGB16IFormat, RGB16UIFormat, RGB16FFormat, RGB32IFormat, RGB32UIFormat, RGB32FFormat, SRGB8Format, R11F_G11F_B10FFormat, RGBA4Format, RGBA8Format, RGBA8_SNORMFormat, RGBA8IFormat, RGBA8UIFormat, RGBA16IFormat, RGBA16UIFormat, RGBA16FFormat, RGBA32IFormat, RGBA32UIFormat, RGBA32FFormat, RGB5_A1Format, RGB10_A2Format, RGB10_A2UIFormat, SRGB8_ALPHA8Format, HalfFloatType, FloatType, UnsignedIntType, IntType, UnsignedShortType, ShortType, ByteType, UnsignedInt248Type, UnsignedShort565Type, UnsignedShort5551Type, UnsignedShort4444Type, UnsignedByteType, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestFilter, MirroredRepeatWrapping, ClampToEdgeWrapping, RepeatWrapping } from '../../constants.js'; |
6 | 6 |
|
7 | 7 | function WebGLUtils( gl, extensions, capabilities ) { |
8 | 8 |
|
@@ -51,37 +51,72 @@ function WebGLUtils( gl, extensions, capabilities ) { |
51 | 51 | if ( p === LuminanceAlphaFormat ) return gl.LUMINANCE_ALPHA; |
52 | 52 | if ( p === DepthFormat ) return gl.DEPTH_COMPONENT; |
53 | 53 | if ( p === DepthStencilFormat ) return gl.DEPTH_STENCIL; |
| 54 | + |
54 | 55 | if ( p === RedFormat ) return gl.RED; |
55 | 56 | if ( p === RedIntegerFormat ) return gl.RED_INTEGER; |
56 | 57 |
|
| 58 | + |
57 | 59 | if ( p === R8Format ) return gl.R8; |
| 60 | + if ( p === R8_SNORMFormat ) return gl.R8_SNORM; |
| 61 | + if ( p === R8IFormat ) return gl.R8I; |
58 | 62 | if ( p === R8UIFormat ) return gl.R8UI; |
| 63 | + if ( p === R16IFormat ) return gl.R16I; |
| 64 | + if ( p === R16UIFormat ) return gl.R16UI; |
59 | 65 | if ( p === R16FFormat ) return gl.R16F; |
| 66 | + if ( p === R32IFormat ) return gl.R32I; |
| 67 | + if ( p === R32UIFormat ) return gl.R32UI; |
60 | 68 | if ( p === R32FFormat ) return gl.R32F; |
61 | 69 |
|
62 | 70 | if ( p === RGFormat ) return gl.RG; |
63 | 71 | if ( p === RGIntegerFormat ) return gl.RG_INTEGER; |
64 | 72 |
|
65 | 73 | if ( p === RG8Format ) return gl.RG8; |
| 74 | + if ( p === RG8_SNORMFormat ) return gl.RG8_SNORM; |
| 75 | + if ( p === RG8IFormat ) return gl.RG8I; |
66 | 76 | if ( p === RG8UIFormat ) return gl.RG8UI; |
| 77 | + if ( p === RG16IFormat ) return gl.RG16I; |
| 78 | + if ( p === RG16UIFormat ) return gl.RG16UI; |
67 | 79 | if ( p === RG16FFormat ) return gl.RG16F; |
| 80 | + if ( p === RG32IFormat ) return gl.RG32I; |
| 81 | + if ( p === RG32UIFormat ) return gl.RG32UI; |
68 | 82 | if ( p === RG32FFormat ) return gl.RG32F; |
69 | 83 |
|
70 | 84 | if ( p === RGBFormat ) return gl.RGB; |
71 | 85 | if ( p === RGBIntegerFormat ) return gl.RGB_INTEGER; |
72 | 86 |
|
| 87 | + if ( p === RGB565Format ) return gl.RGB565; |
73 | 88 | if ( p === RGB8Format ) return gl.RGB8; |
| 89 | + if ( p === RGB8_SNORMFormat ) return gl.RGB8_SNORM; |
| 90 | + if ( p === RGB8IFormat ) return gl.RGB8I; |
74 | 91 | if ( p === RGB8UIFormat ) return gl.RGB8UI; |
| 92 | + if ( p === RGB9_E5Format ) return gl.RGB9_E5; |
| 93 | + if ( p === RGB16IFormat ) return gl.RGB16I; |
| 94 | + if ( p === RGB16UIFormat ) return gl.RGB16UI; |
75 | 95 | if ( p === RGB16FFormat ) return gl.RGB16F; |
| 96 | + if ( p === RGB32IFormat ) return gl.RGB32I; |
| 97 | + if ( p === RGB32UIFormat ) return gl.RGB32UI; |
76 | 98 | if ( p === RGB32FFormat ) return gl.RGB32F; |
| 99 | + if ( p === SRGB8Format ) return gl.SRGB8; |
| 100 | + if ( p === R11F_G11F_B10FFormat ) return gl.R11F_G11F_B10F; |
77 | 101 |
|
78 | 102 | if ( p === RGBAFormat ) return gl.RGBA; |
79 | 103 | if ( p === RGBAIntegerFormat ) return gl.RGBA_INTEGER; |
80 | 104 |
|
| 105 | + if ( p === RGBA4Format ) return gl.RGBA4; |
81 | 106 | if ( p === RGBA8Format ) return gl.RGBA8; |
| 107 | + if ( p === RGBA8_SNORMFormat ) return gl.RGBA8_SNORM; |
| 108 | + if ( p === RGBA8IFormat ) return gl.RGBA8I; |
82 | 109 | if ( p === RGBA8UIFormat ) return gl.RGBA8UI; |
| 110 | + if ( p === RGBA16IFormat ) return gl.RGBA16I; |
| 111 | + if ( p === RGBA16UIFormat ) return gl.RGBA16UI; |
83 | 112 | if ( p === RGBA16FFormat ) return gl.RGBA16F; |
| 113 | + if ( p === RGBA32IFormat ) return gl.RGBA32I; |
| 114 | + if ( p === RGBA32UIFormat ) return gl.RGBA32UI; |
84 | 115 | if ( p === RGBA32FFormat ) return gl.RGBA32F; |
| 116 | + if ( p === RGB5_A1Format ) return gl.RGB5_A1; |
| 117 | + if ( p === RGB10_A2Format ) return gl.RGB10_A2; |
| 118 | + if ( p === RGB10_A2UIFormat ) return gl.RGB10_A2UI; |
| 119 | + if ( p === SRGB8_ALPHA8Format ) return gl.SRGB8_ALPHA8; |
85 | 120 |
|
86 | 121 | if ( p === AddEquation ) return gl.FUNC_ADD; |
87 | 122 | if ( p === SubtractEquation ) return gl.FUNC_SUBTRACT; |
|
0 commit comments