laya-coreui-es
Version:
laya核心库、ui库es版本,剔除了媒体、TTF等功能。基于 LayaAir-release_2.12.0 修改
37 lines (36 loc) • 1.66 kB
JavaScript
import { LayaGL } from "../layagl/LayaGL";
import { TextureFormat } from "../resource/TextureFormat";
import { RenderTextureFormat } from "../resource/RenderTextureFormat";
export class SystemUtils {
static get maxTextureCount() {
return this._maxTextureCount;
}
static get maxTextureSize() {
return this._maxTextureSize;
}
static get shaderCapailityLevel() {
return this._shaderCapailityLevel;
}
static supportTextureFormat(format) {
switch (format) {
case TextureFormat.R32G32B32A32:
return (!LayaGL.layaGPUInstance._isWebGL2 && !LayaGL.layaGPUInstance._oesTextureFloat) ? false : true;
case TextureFormat.R16G16B16A16:
return (!LayaGL.layaGPUInstance._isWebGL2 && !LayaGL.layaGPUInstance._oesTextureHalfFloat) ? false : true;
default:
return true;
}
}
static supportRenderTextureFormat(format) {
switch (format) {
case RenderTextureFormat.R16G16B16A16:
return (((!!LayaGL.layaGPUInstance._isWebGL2) && (!!LayaGL.layaGPUInstance._extColorBufferFloat)) || LayaGL.layaGPUInstance._oesTextureHalfFloat && LayaGL.layaGPUInstance._oesTextureHalfFloatLinear) ? true : false;
case RenderTextureFormat.Depth:
return (LayaGL.layaGPUInstance._isWebGL2 || LayaGL.layaGPUInstance._webgl_depth_texture) ? true : false;
case RenderTextureFormat.ShadowMap:
return LayaGL.layaGPUInstance._isWebGL2 ? true : false;
default:
return true;
}
}
}