diff --git a/src/constants.js b/src/constants.js index 27b2b41ba18cd0..b060ae6f6f89ec 100644 --- a/src/constants.js +++ b/src/constants.js @@ -101,6 +101,20 @@ export var RGB_PVRTC_2BPPV1_Format = 2101; export var RGBA_PVRTC_4BPPV1_Format = 2102; export var RGBA_PVRTC_2BPPV1_Format = 2103; export var RGB_ETC1_Format = 2151; +export var RGBA_ASTC_4x4_Format = 37808; +export var RGBA_ASTC_5x4_Format = 37809; +export var RGBA_ASTC_5x5_Format = 37810; +export var RGBA_ASTC_6x5_Format = 37811; +export var RGBA_ASTC_6x6_Format = 37812; +export var RGBA_ASTC_8x5_Format = 37813; +export var RGBA_ASTC_8x6_Format = 37814; +export var RGBA_ASTC_8x8_Format = 37815; +export var RGBA_ASTC_10x5_Format = 37816; +export var RGBA_ASTC_10x6_Format = 37817; +export var RGBA_ASTC_10x8_Format = 37818; +export var RGBA_ASTC_10x10_Format = 37819; +export var RGBA_ASTC_12x10_Format = 37820; +export var RGBA_ASTC_12x12_Format = 37821; export var LoopOnce = 2200; export var LoopRepeat = 2201; export var LoopPingPong = 2202; diff --git a/src/renderers/webgl/WebGLUtils.js b/src/renderers/webgl/WebGLUtils.js index eff600232d6ff4..45906f05795f3e 100644 --- a/src/renderers/webgl/WebGLUtils.js +++ b/src/renderers/webgl/WebGLUtils.js @@ -107,6 +107,20 @@ function WebGLUtils( gl, extensions ) { } + if ( p === RGBA_ASTC_4x4_Format || p === RGBA_ASTC_5x4_Format || p === RGBA_ASTC_5x5_Format || + p === RGBA_ASTC_6x5_Format || p === RGBA_ASTC_6x6_Format || p === RGBA_ASTC_8x5_Format || + p === RGBA_ASTC_8x6_Format || p === RGBA_ASTC_8x8_Format || p === RGBA_ASTC_10x5_Format || + p === RGBA_ASTC_10x6_Format || p === RGBA_ASTC_10x8_Format || p === RGBA_ASTC_10x10_Format || + p === RGBA_ASTC_12x10_Format || p === RGBA_ASTC_12x12_Format ) { + + extension = extensions.get( 'WEBGL_compressed_texture_astc' ); + + if ( extension !== null ) { + return p; + } + + } + if ( p === MinEquation || p === MaxEquation ) { extension = extensions.get( 'EXT_blend_minmax' );