From 9a33386eddddad695f247d3ce3013a94b566ff98 Mon Sep 17 00:00:00 2001 From: hazed Date: Thu, 21 Dec 2017 16:30:15 +0200 Subject: [PATCH 1/2] added astc texture format constants --- src/constants.js | 14 ++++++++++++++ src/renderers/webgl/WebGLUtils.js | 14 ++++++++++++++ 2 files changed, 28 insertions(+) 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..55f13a1d3b6480 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' ); From ee3854deb7d4a3dd3642988f3f27328a2b6f3968 Mon Sep 17 00:00:00 2001 From: hazed Date: Fri, 22 Dec 2017 08:29:38 +0200 Subject: [PATCH 2/2] use tabs --- src/renderers/webgl/WebGLUtils.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/renderers/webgl/WebGLUtils.js b/src/renderers/webgl/WebGLUtils.js index 55f13a1d3b6480..45906f05795f3e 100644 --- a/src/renderers/webgl/WebGLUtils.js +++ b/src/renderers/webgl/WebGLUtils.js @@ -107,19 +107,19 @@ 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 ) { + 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' ); + extension = extensions.get( 'WEBGL_compressed_texture_astc' ); - if ( extension !== null ) { - return p; - } + if ( extension !== null ) { + return p; + } - } + } if ( p === MinEquation || p === MaxEquation ) {