UNPKG

laya-coreui-es

Version:

laya核心库、ui库es版本,剔除了媒体、TTF等功能。基于 LayaAir-release_2.12.0 修改

41 lines (40 loc) 2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SystemUtils = void 0; const LayaGL_1 = require("../layagl/LayaGL"); const TextureFormat_1 = require("../resource/TextureFormat"); const RenderTextureFormat_1 = require("../resource/RenderTextureFormat"); 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_1.TextureFormat.R32G32B32A32: return (!LayaGL_1.LayaGL.layaGPUInstance._isWebGL2 && !LayaGL_1.LayaGL.layaGPUInstance._oesTextureFloat) ? false : true; case TextureFormat_1.TextureFormat.R16G16B16A16: return (!LayaGL_1.LayaGL.layaGPUInstance._isWebGL2 && !LayaGL_1.LayaGL.layaGPUInstance._oesTextureHalfFloat) ? false : true; default: return true; } } static supportRenderTextureFormat(format) { switch (format) { case RenderTextureFormat_1.RenderTextureFormat.R16G16B16A16: return (((!!LayaGL_1.LayaGL.layaGPUInstance._isWebGL2) && (!!LayaGL_1.LayaGL.layaGPUInstance._extColorBufferFloat)) || LayaGL_1.LayaGL.layaGPUInstance._oesTextureHalfFloat && LayaGL_1.LayaGL.layaGPUInstance._oesTextureHalfFloatLinear) ? true : false; case RenderTextureFormat_1.RenderTextureFormat.Depth: return (LayaGL_1.LayaGL.layaGPUInstance._isWebGL2 || LayaGL_1.LayaGL.layaGPUInstance._webgl_depth_texture) ? true : false; case RenderTextureFormat_1.RenderTextureFormat.ShadowMap: return LayaGL_1.LayaGL.layaGPUInstance._isWebGL2 ? true : false; default: return true; } } } exports.SystemUtils = SystemUtils;