-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove unused code in gfx/base, gfx/webgl module and mangle properties to reduce js size. #17529
Conversation
Interface Check Report! WARNING this pull request has changed these public interfaces:
@@ -7969,10 +7969,10 @@
*/
export class Sampler extends GFXObject {
get info(): Readonly<SamplerInfo>;
get hash(): number;
- protected _info: SamplerInfo;
- protected _hash: number;
+ protected _info$: SamplerInfo;
+ protected _hash$: number;
constructor(info: Readonly<SamplerInfo>, hash: number);
static computeHash(info: Readonly<SamplerInfo>): Filter;
static unpackFromHash(hash: number): SamplerInfo;
}
@@ -7999,13 +7999,13 @@
* @zh GFX 描述符集组。
*/
export abstract class DescriptorSet extends GFXObject {
get layout(): DescriptorSetLayout;
- protected _layout: DescriptorSetLayout | null;
- protected _buffers: Buffer[];
- protected _textures: Texture[];
- protected _samplers: Sampler[];
- protected _isDirty: boolean;
+ protected _layout$: DescriptorSetLayout | null;
+ protected _buffers$: Buffer[];
+ protected _textures$: Texture[];
+ protected _samplers$: Sampler[];
+ protected _isDirty$: boolean;
constructor();
abstract initialize(info: Readonly<DescriptorSetInfo>): void;
abstract destroy(): void;
abstract update(): void;
@@ -8079,15 +8079,15 @@
* @zh 缓冲条目数量。
*/
get count(): number;
get flags(): BufferFlags;
- protected _usage: BufferUsage;
- protected _memUsage: MemoryUsage;
- protected _size: number;
- protected _stride: number;
- protected _count: number;
- protected _flags: BufferFlags;
- protected _isBufferView: boolean;
+ protected _usage$: BufferUsage;
+ protected _memUsage$: MemoryUsage;
+ protected _size$: number;
+ protected _stride$: number;
+ protected _count$: number;
+ protected _flags$: BufferFlags;
+ protected _isBufferView$: boolean;
constructor();
abstract initialize(info: Readonly<BufferInfo> | Readonly<BufferViewInfo>): void;
abstract destroy(): void;
/**
@@ -8133,13 +8133,13 @@
* @en Number of triangles currently recorded.
* @zh 绘制三角形数量。
*/
get numTris(): number;
- protected _queue: Queue | null;
- protected _type: CommandBufferType;
- protected _numDrawCalls: number;
- protected _numInstances: number;
- protected _numTris: number;
+ protected _queue$: Queue | null;
+ protected _type$: CommandBufferType;
+ protected _numDrawCalls$: number;
+ protected _numInstances$: number;
+ protected _numTris$: number;
constructor();
abstract initialize(info: Readonly<CommandBufferInfo>): void;
abstract destroy(): void;
/**
@@ -9392,11 +9392,11 @@
export class GFXObject extends __private._cocos_core_data_gc_object__GCObject {
get objectType(): ObjectType;
get objectID(): number;
get typedID(): number;
- protected _objectType: ObjectType;
- protected _objectID: number;
- protected _typedID: number;
+ protected _objectType$: ObjectType;
+ protected _objectID$: number;
+ protected _typedID$: number;
constructor(objectType: ObjectType);
}
export interface ISwapchainTextureInfo {
swapchain: Swapchain;
@@ -9501,26 +9501,26 @@
* @en Current device binding mappings.
* @zh 当前设备的绑定槽位映射关系。
*/
get bindingMappingInfo(): BindingMappingInfo;
- protected _gfxAPI: API;
- protected _renderer: string;
- protected _vendor: string;
- protected _features: boolean[];
- protected _formatFeatures: FormatFeatureBit[];
- protected _queue: Queue | null;
- protected _cmdBuff: CommandBuffer | null;
- protected _numDrawCalls: number;
- protected _numInstances: number;
- protected _numTris: number;
- protected _memoryStatus: MemoryStatus;
- protected _caps: DeviceCaps;
- protected _bindingMappingInfo: BindingMappingInfo;
- protected _samplers: Map<number, Sampler>;
- protected _generalBarrierss: Map<number, GeneralBarrier>;
- protected _textureBarriers: Map<number, TextureBarrier>;
- protected _bufferBarriers: Map<number, __private._cocos_gfx_base_states_buffer_barrier__BufferBarrier>;
- protected _swapchainFormat: Format;
+ protected _gfxAPI$: API;
+ protected _renderer$: string;
+ protected _vendor$: string;
+ protected _features$: boolean[];
+ protected _formatFeatures$: FormatFeatureBit[];
+ protected _queue$: Queue | null;
+ protected _cmdBuff$: CommandBuffer | null;
+ protected _numDrawCalls$: number;
+ protected _numInstances$: number;
+ protected _numTris$: number;
+ protected _memoryStatus$: MemoryStatus;
+ protected _caps$: DeviceCaps;
+ protected _bindingMappingInfo$: BindingMappingInfo;
+ protected _samplers$: Map<number, Sampler>;
+ protected _generalBarrierss$: Map<number, GeneralBarrier>;
+ protected _textureBarriers$: Map<number, TextureBarrier>;
+ protected _bufferBarriers$: Map<number, __private._cocos_gfx_base_states_buffer_barrier__BufferBarrier>;
+ protected _swapchainFormat$: Format;
static canvas: HTMLCanvasElement;
abstract initialize(info: Readonly<DeviceInfo>): boolean | Promise<boolean>;
abstract destroy(): void;
/**
@@ -9721,11 +9721,11 @@
*/
get surfaceTransform(): SurfaceTransform;
get width(): number;
get height(): number;
- protected _transform: SurfaceTransform;
- protected _colorTexture: Texture;
- protected _depthStencilTexture: Texture;
+ protected _transform$: SurfaceTransform;
+ protected _colorTexture$: Texture;
+ protected _depthStencilTexture$: Texture;
constructor();
abstract initialize(info: Readonly<SwapchainInfo>): void;
abstract resize(width: number, height: number, surfaceTransform: SurfaceTransform): void;
abstract destroy(): void;
@@ -9752,13 +9752,13 @@
get depthStencilTexture(): Texture | null;
get width(): number;
get height(): number;
get needRebuild(): boolean;
- protected _renderPass: RenderPass | null;
- protected _colorTextures: (Texture | null)[];
- protected _depthStencilTexture: Texture | null;
- protected _width: number;
- protected _height: number;
+ protected _renderPass$: RenderPass | null;
+ protected _colorTextures$: (Texture | null)[];
+ protected _depthStencilTexture$: Texture | null;
+ protected _width$: number;
+ protected _height$: number;
constructor();
abstract initialize(info: Readonly<FramebufferInfo>): void;
abstract destroy(): void;
}
@@ -9843,22 +9843,22 @@
* @en get the draw range
* @zh 获取渲染范围
*/
get drawInfo(): DrawInfo;
- protected _attributes: Attribute[];
- protected _attributesHash: number;
- protected _vertexBuffers: Buffer[];
- protected _indexBuffer: Buffer | null;
- protected _indirectBuffer: Buffer | null;
- protected _drawInfo: DrawInfo;
+ protected _attributes$: Attribute[];
+ protected _attributesHash$: number;
+ protected _vertexBuffers$: Buffer[];
+ protected _indexBuffer$: Buffer | null;
+ protected _indirectBuffer$: Buffer | null;
+ protected _drawInfo$: DrawInfo;
constructor();
/**
* @en Get the specified vertex buffer.
* @zh 获取顶点缓冲。
* @param stream The stream index of the vertex buffer.
*/
getVertexBuffer(stream?: number): Buffer | null;
- protected computeAttributesHash(): number;
+ protected computeAttributesHash$(): number;
abstract initialize(info: Readonly<InputAssemblerInfo>): void;
abstract destroy(): void;
}
/**
@@ -9868,11 +9868,11 @@
export abstract class DescriptorSetLayout extends GFXObject {
get bindings(): DescriptorSetLayoutBinding[];
get bindingIndices(): number[];
get descriptorIndices(): number[];
- protected _bindings: DescriptorSetLayoutBinding[];
- protected _bindingIndices: number[];
- protected _descriptorIndices: number[];
+ protected _bindings$: DescriptorSetLayoutBinding[];
+ protected _bindingIndices$: number[];
+ protected _descriptorIndices$: number[];
constructor();
abstract initialize(info: Readonly<DescriptorSetLayoutInfo>): void;
abstract destroy(): void;
}
@@ -9881,9 +9881,9 @@
* @zh GFX 管线布局。
*/
export abstract class PipelineLayout extends GFXObject {
get setLayouts(): DescriptorSetLayout[];
- protected _setLayouts: DescriptorSetLayout[];
+ protected _setLayouts$: DescriptorSetLayout[];
constructor();
abstract initialize(info: Readonly<PipelineLayoutInfo>): void;
abstract destroy(): void;
}
@@ -10043,17 +10043,17 @@
* @en Get current render pass.
* @zh GFX 渲染过程。
*/
get renderPass(): RenderPass;
- protected _shader: Shader | null;
- protected _pipelineLayout: PipelineLayout | null;
- protected _primitive: PrimitiveMode;
- protected _is: InputState | null;
- protected _rs: RasterizerState;
- protected _dss: DepthStencilState;
- protected _bs: BlendState;
- protected _dynamicStates: DynamicStateFlags;
- protected _renderPass: RenderPass | null;
+ protected _shader$: Shader | null;
+ protected _pipelineLayout$: PipelineLayout | null;
+ protected _primitive$: PrimitiveMode;
+ protected _is$: InputState | null;
+ protected _rs$: RasterizerState;
+ protected _dss$: DepthStencilState;
+ protected _bs$: BlendState;
+ protected _dynamicStates$: DynamicStateFlags;
+ protected _renderPass$: RenderPass | null;
constructor();
abstract initialize(info: Readonly<PipelineStateInfo>): void;
abstract destroy(): void;
}
@@ -10066,9 +10066,9 @@
* @en Get current type.
* @zh 队列类型。
*/
get type(): number;
- protected _type: QueueType;
+ protected _type$: QueueType;
constructor();
abstract initialize(info: Readonly<QueueInfo>): void;
abstract destroy(): void;
/**
@@ -10083,12 +10083,12 @@
* @en GFX render pass.
* @zh GFX 渲染过程。
*/
export abstract class RenderPass extends GFXObject {
- protected _colorInfos: ColorAttachment[];
- protected _depthStencilInfo: DepthStencilAttachment | null;
- protected _subpasses: SubpassInfo[];
- protected _hash: number;
+ protected _colorInfos$: ColorAttachment[];
+ protected _depthStencilInfo$: DepthStencilAttachment | null;
+ protected _subpasses$: SubpassInfo[];
+ protected _hash$: number;
get colorAttachments(): Readonly<ColorAttachment[]>;
get depthStencilAttachment(): Readonly<DepthStencilAttachment> | null;
get subPasses(): Readonly<SubpassInfo[]>;
get hash(): number;
@@ -10106,13 +10106,13 @@
get attributes(): Attribute[];
get blocks(): UniformBlock[];
get samplers(): UniformSampler[];
get stages(): ShaderStage[];
- protected _name: string;
- protected _stages: ShaderStage[];
- protected _attributes: Attribute[];
- protected _blocks: UniformBlock[];
- protected _samplers: UniformSampler[];
+ protected _name$: string;
+ protected _stages$: ShaderStage[];
+ protected _attributes$: Attribute[];
+ protected _blocks$: UniformBlock[];
+ protected _samplers$: UniformSampler[];
constructor();
abstract initialize(info: Readonly<ShaderInfo>): void;
abstract destroy(): void;
}
@@ -10190,13 +10190,13 @@
* @en Get texture type.
* @zh 是否为纹理视图。
*/
get isTextureView(): boolean;
- protected _info: TextureInfo;
- protected _viewInfo: TextureViewInfo;
- protected _isPowerOf2: boolean;
- protected _isTextureView: boolean;
- protected _size: number;
+ protected _info$: TextureInfo;
+ protected _viewInfo$: TextureViewInfo;
+ protected _isPowerOf2$: boolean;
+ protected _isTextureView$: boolean;
+ protected _size$: number;
constructor();
abstract initialize(info: Readonly<TextureInfo> | Readonly<TextureViewInfo>): void;
abstract destroy(): void;
abstract getTextureHandle(): TextureHandle;
@@ -10215,10 +10215,10 @@
*/
export class GeneralBarrier extends GFXObject {
get info(): Readonly<GeneralBarrierInfo>;
get hash(): number;
- protected _info: GeneralBarrierInfo;
- protected _hash: number;
+ protected _info$: GeneralBarrierInfo;
+ protected _hash$: number;
constructor(info: Readonly<GeneralBarrierInfo>, hash: number);
static computeHash(info: Readonly<GeneralBarrierInfo>): number;
}
/**
@@ -10227,10 +10227,10 @@
*/
export class TextureBarrier extends GFXObject {
get info(): Readonly<TextureBarrierInfo>;
get hash(): number;
- protected _info: TextureBarrierInfo;
- protected _hash: number;
+ protected _info$: TextureBarrierInfo;
+ protected _hash$: number;
constructor(info: Readonly<TextureBarrierInfo>, hash: number);
static computeHash(info: Readonly<TextureBarrierInfo>): number;
}
/**
@@ -44511,9 +44511,9 @@
get nullTexCube(): __private._cocos_gfx_webgl_webgl_texture__WebGLTexture;
get textureExclusive(): boolean[];
get bindingMappings(): __private._cocos_gfx_webgl_webgl_gpu_objects__IWebGLBindingMapping;
get blitManager(): __private._cocos_gfx_webgl_webgl_gpu_objects__IWebGLBlitManager;
- protected _textureExclusive: boolean[];
+ protected _textureExclusive$: boolean[];
initialize(info: Readonly<gfx.DeviceInfo>): boolean;
destroy(): void;
flushCommands(cmdBuffs: gfx.CommandBuffer[]): void;
acquire(swapchains: gfx.Swapchain[]): void;
@@ -44541,17 +44541,18 @@
copyTextureToBuffers(texture: Readonly<gfx.Texture>, buffers: ArrayBufferView[], regions: Readonly<gfx.BufferTextureCopy[]>): void;
copyTexImagesToTexture(texImages: Readonly<TexImageSource[]>, texture: gfx.Texture, regions: Readonly<gfx.BufferTextureCopy[]>): void;
}
export class WebGL2Device extends gfx.Device {
+ constructor();
get gl(): WebGL2RenderingContext;
get extensions(): __private._cocos_gfx_webgl2_webgl2_define__IWebGL2Extensions;
- get stateCache(): __private._cocos_gfx_webgl2_webgl2_state_cache__WebGL2StateCache;
+ getStateCache$(): __private._cocos_gfx_webgl2_webgl2_state_cache__WebGL2StateCache;
get nullTex2D(): __private._cocos_gfx_webgl2_webgl2_texture__WebGL2Texture;
get nullTexCube(): __private._cocos_gfx_webgl2_webgl2_texture__WebGL2Texture;
get textureExclusive(): boolean[];
get bindingMappings(): __private._cocos_gfx_webgl2_webgl2_gpu_objects__IWebGL2BindingMapping;
get blitManager(): __private._cocos_gfx_webgl2_webgl2_gpu_objects__IWebGL2BlitManager | null;
- protected _textureExclusive: boolean[];
+ protected _textureExclusive$: boolean[];
initialize(info: Readonly<gfx.DeviceInfo>): boolean;
destroy(): void;
flushCommands(cmdBuffs: Readonly<gfx.CommandBuffer[]>): void;
acquire(swapchains: Readonly<gfx.Swapchain[]>): void;
@@ -62388,10 +62389,10 @@
*/
export class _cocos_gfx_base_states_buffer_barrier__BufferBarrier extends gfx.GFXObject {
get info(): Readonly<gfx.BufferBarrierInfo>;
get hash(): number;
- protected _info: gfx.BufferBarrierInfo;
- protected _hash: number;
+ protected _info$: gfx.BufferBarrierInfo;
+ protected _hash$: number;
constructor(info: Readonly<gfx.BufferBarrierInfo>, hash: number);
static computeHash(info: Readonly<gfx.BufferBarrierInfo>): number;
}
export type __types_globals__TypedArrayConstructor = Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int8ArrayConstructor | Uint16ArrayConstructor | Int16ArrayConstructor | Uint32ArrayConstructor | Int32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor;
@@ -65969,87 +65970,87 @@
readonly COMPRESSED_RGB_PVRTC_2BPPV1_IMG: GLenum;
readonly COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: GLenum;
}
export interface _cocos_gfx_webgl_webgl_define__IWebGLExtensions {
- EXT_texture_filter_anisotropic: EXT_texture_filter_anisotropic | null;
- EXT_blend_minmax: EXT_blend_minmax | null;
- EXT_frag_depth: EXT_frag_depth | null;
- EXT_shader_texture_lod: EXT_shader_texture_lod | null;
- EXT_sRGB: EXT_sRGB | null;
- OES_vertex_array_object: OES_vertex_array_object | null;
- EXT_color_buffer_half_float: __node_modules_typescript_lib_libdom__EXT_color_buffer_half_float | null;
- WEBGL_multi_draw: __node_modules_typescript_lib_libdom__WEBGL_multi_draw | null;
- WEBGL_color_buffer_float: WEBGL_color_buffer_float | null;
- WEBGL_compressed_texture_etc1: __node_modules_typescript_lib_libdom__WEBGL_compressed_texture_etc1 | null;
- WEBGL_compressed_texture_etc: __node_modules_typescript_lib_libdom__WEBGL_compressed_texture_etc | null;
- WEBGL_compressed_texture_pvrtc: __types_webGLextras__WEBGL_compressed_texture_pvrtc | null;
- WEBGL_compressed_texture_astc: WEBGL_compressed_texture_astc | null;
- WEBGL_compressed_texture_s3tc: WEBGL_compressed_texture_s3tc | null;
- WEBGL_compressed_texture_s3tc_srgb: WEBGL_compressed_texture_s3tc_srgb | null;
- WEBGL_debug_shaders: WEBGL_debug_shaders | null;
- WEBGL_draw_buffers: WEBGL_draw_buffers | null;
- WEBGL_lose_context: WEBGL_lose_context | null;
- WEBGL_depth_texture: WEBGL_depth_texture | null;
- WEBGL_debug_renderer_info: WEBGL_debug_renderer_info | null;
- OES_texture_half_float: OES_texture_half_float | null;
- OES_texture_half_float_linear: OES_texture_half_float_linear | null;
- OES_texture_float: OES_texture_float | null;
- OES_texture_float_linear: OES_texture_float_linear | null;
- OES_standard_derivatives: OES_standard_derivatives | null;
- OES_element_index_uint: OES_element_index_uint | null;
- ANGLE_instanced_arrays: ANGLE_instanced_arrays | null;
- destroyShadersImmediately: boolean;
- noCompressedTexSubImage2D: boolean;
- isLocationActive: (glLoc: unknown) => glLoc is WebGLUniformLocation;
- useVAO: boolean;
+ EXT_texture_filter_anisotropic$: EXT_texture_filter_anisotropic | null;
+ EXT_blend_minmax$: EXT_blend_minmax | null;
+ EXT_frag_depth$: EXT_frag_depth | null;
+ EXT_shader_texture_lod$: EXT_shader_texture_lod | null;
+ EXT_sRGB$: EXT_sRGB | null;
+ OES_vertex_array_object$: OES_vertex_array_object | null;
+ EXT_color_buffer_half_float$: __node_modules_typescript_lib_libdom__EXT_color_buffer_half_float | null;
+ WEBGL_multi_draw$: __node_modules_typescript_lib_libdom__WEBGL_multi_draw | null;
+ WEBGL_color_buffer_float$: WEBGL_color_buffer_float | null;
+ WEBGL_compressed_texture_etc1$: __node_modules_typescript_lib_libdom__WEBGL_compressed_texture_etc1 | null;
+ WEBGL_compressed_texture_etc$: __node_modules_typescript_lib_libdom__WEBGL_compressed_texture_etc | null;
+ WEBGL_compressed_texture_pvrtc$: __types_webGLextras__WEBGL_compressed_texture_pvrtc | null;
+ WEBGL_compressed_texture_astc$: WEBGL_compressed_texture_astc | null;
+ WEBGL_compressed_texture_s3tc$: WEBGL_compressed_texture_s3tc | null;
+ WEBGL_compressed_texture_s3tc_srgb$: WEBGL_compressed_texture_s3tc_srgb | null;
+ WEBGL_debug_shaders$: WEBGL_debug_shaders | null;
+ WEBGL_draw_buffers$: WEBGL_draw_buffers | null;
+ WEBGL_lose_context$: WEBGL_lose_context | null;
+ WEBGL_depth_texture$: WEBGL_depth_texture | null;
+ WEBGL_debug_renderer_info$: WEBGL_debug_renderer_info | null;
+ OES_texture_half_float$: OES_texture_half_float | null;
+ OES_texture_half_float_linear$: OES_texture_half_float_linear | null;
+ OES_texture_float$: OES_texture_float | null;
+ OES_texture_float_linear$: OES_texture_float_linear | null;
+ OES_standard_derivatives$: OES_standard_derivatives | null;
+ OES_element_index_uint$: OES_element_index_uint | null;
+ ANGLE_instanced_arrays$: ANGLE_instanced_arrays | null;
+ destroyShadersImmediately$: boolean;
+ noCompressedTexSubImage2D$: boolean;
+ isLocationActive$: (glLoc: unknown) => glLoc is WebGLUniformLocation;
+ useVAO$: boolean;
}
export interface _cocos_gfx_webgl_webgl_state_cache__IWebGLTexUnit {
- glTexture: WebGLTexture | null;
+ glTexture$: WebGLTexture | null;
}
export class _cocos_gfx_webgl_webgl_state_cache__WebGLStateCache {
- glArrayBuffer: WebGLBuffer | null;
- glElementArrayBuffer: WebGLBuffer | null;
- glVAO: WebGLVertexArrayObjectOES | null;
- texUnit: number;
- glTexUnits: _cocos_gfx_webgl_webgl_state_cache__IWebGLTexUnit[];
- glRenderbuffer: WebGLRenderbuffer | null;
- glFramebuffer: WebGLFramebuffer | null;
- viewport: gfx.Viewport;
- scissorRect: gfx.Rect;
- rs: gfx.RasterizerState;
- dss: gfx.DepthStencilState;
- bs: gfx.BlendState;
- glProgram: WebGLProgram | null;
- glEnabledAttribLocs: boolean[];
- glCurrentAttribLocs: boolean[];
- texUnitCacheMap: Record<string, number>;
+ glArrayBuffer$: WebGLBuffer | null;
+ glElementArrayBuffer$: WebGLBuffer | null;
+ glVAO$: WebGLVertexArrayObjectOES | null;
+ texUnit$: number;
+ glTexUnits$: _cocos_gfx_webgl_webgl_state_cache__IWebGLTexUnit[];
+ glRenderbuffer$: WebGLRenderbuffer | null;
+ glFramebuffer$: WebGLFramebuffer | null;
+ viewport$: gfx.Viewport;
+ scissorRect$: gfx.Rect;
+ rs$: gfx.RasterizerState;
+ dss$: gfx.DepthStencilState;
+ bs$: gfx.BlendState;
+ glProgram$: WebGLProgram | null;
+ glEnabledAttribLocs$: boolean[];
+ glCurrentAttribLocs$: boolean[];
+ texUnitCacheMap$: Record<string, number>;
initialize(texUnit: number, vertexAttributes: number): void;
}
export interface _cocos_gfx_webgl_webgl_gpu_objects__IWebGLGPUTexture {
- type: gfx.TextureType;
- format: gfx.Format;
- usage: gfx.TextureUsage;
- width: number;
- height: number;
- depth: number;
- size: number;
- arrayLayer: number;
- mipLevel: number;
- samples: gfx.SampleCount;
- flags: gfx.TextureFlags;
- isPowerOf2: boolean;
- glTarget: GLenum;
- glInternalFmt: GLenum;
- glFormat: GLenum;
- glType: GLenum;
- glUsage: GLenum;
- glTexture: WebGLTexture | null;
- glRenderbuffer: WebGLRenderbuffer | null;
- glWrapS: GLenum;
- glWrapT: GLenum;
- glMinFilter: GLenum;
- glMagFilter: GLenum;
- isSwapchainTexture: boolean;
+ type$: gfx.TextureType;
+ format$: gfx.Format;
+ usage$: gfx.TextureUsage;
+ width$: number;
+ height$: number;
+ depth$: number;
+ size$: number;
+ arrayLayer$: number;
+ mipLevel$: number;
+ samples$: gfx.SampleCount;
+ flags$: gfx.TextureFlags;
+ isPowerOf2$: boolean;
+ glTarget$: GLenum;
+ glInternalFmt$: GLenum;
+ glFormat$: GLenum;
+ glType$: GLenum;
+ glUsage$: GLenum;
+ glTexture$: WebGLTexture | null;
+ glRenderbuffer$: WebGLRenderbuffer | null;
+ glWrapS$: GLenum;
+ glWrapT$: GLenum;
+ glMinFilter$: GLenum;
+ glMagFilter$: GLenum;
+ isSwapchainTexture$: boolean;
}
export class _cocos_gfx_webgl_webgl_texture__WebGLTexture extends gfx.Texture {
get gpuTexture(): _cocos_gfx_webgl_webgl_gpu_objects__IWebGLGPUTexture;
get lodLevel(): number;
@@ -66059,11 +66060,11 @@
getTextureHandle(): number;
resize(width: number, height: number): void;
}
export interface _cocos_gfx_webgl_webgl_gpu_objects__IWebGLBindingMapping {
- blockOffsets: number[];
- samplerTextureOffsets: number[];
- flexibleSet: number;
+ blockOffsets$: number[];
+ samplerTextureOffsets$: number[];
+ flexibleSet$: number;
}
export class _cocos_gfx_webgl_webgl_gpu_objects__IWebGLBlitManager {
constructor();
destroy(): void;
@@ -66073,103 +66074,105 @@
}
export interface __node_modules_typescript_lib_libdom__EXT_color_buffer_float {
}
export interface _cocos_gfx_webgl2_webgl2_define__IWebGL2Extensions {
- EXT_texture_filter_anisotropic: EXT_texture_filter_anisotropic | null;
- EXT_color_buffer_half_float: __node_modules_typescript_lib_libdom__EXT_color_buffer_half_float | null;
- EXT_color_buffer_float: __node_modules_typescript_lib_libdom__EXT_color_buffer_float | null;
- WEBGL_multi_draw: __node_modules_typescript_lib_libdom__WEBGL_multi_draw | null;
- WEBGL_compressed_texture_etc1: __node_modules_typescript_lib_libdom__WEBGL_compressed_texture_etc1 | null;
- WEBGL_compressed_texture_etc: __node_modules_typescript_lib_libdom__WEBGL_compressed_texture_etc | null;
- WEBGL_compressed_texture_pvrtc: __types_webGLextras__WEBGL_compressed_texture_pvrtc | null;
- WEBGL_compressed_texture_astc: WEBGL_compressed_texture_astc | null;
- WEBGL_compressed_texture_s3tc: WEBGL_compressed_texture_s3tc | null;
- WEBGL_compressed_texture_s3tc_srgb: WEBGL_compressed_texture_s3tc_srgb | null;
- WEBGL_debug_shaders: WEBGL_debug_shaders | null;
- WEBGL_lose_context: WEBGL_lose_context | null;
- WEBGL_debug_renderer_info: WEBGL_debug_renderer_info | null;
- OES_texture_half_float_linear: OES_texture_half_float_linear | null;
- OES_texture_float_linear: OES_texture_float_linear | null;
- useVAO: boolean;
+ EXT_texture_filter_anisotropic$: EXT_texture_filter_anisotropic | null;
+ EXT_color_buffer_half_float$: __node_modules_typescript_lib_libdom__EXT_color_buffer_half_float | null;
+ EXT_color_buffer_float$: __node_modules_typescript_lib_libdom__EXT_color_buffer_float | null;
+ WEBGL_multi_draw$: __node_modules_typescript_lib_libdom__WEBGL_multi_draw | null;
+ WEBGL_compressed_texture_etc1$: __node_modules_typescript_lib_libdom__WEBGL_compressed_texture_etc1 | null;
+ WEBGL_compressed_texture_etc$: __node_modules_typescript_lib_libdom__WEBGL_compressed_texture_etc | null;
+ WEBGL_compressed_texture_pvrtc$: __types_webGLextras__WEBGL_compressed_texture_pvrtc | null;
+ WEBGL_compressed_texture_astc$: WEBGL_compressed_texture_astc | null;
+ WEBGL_compressed_texture_s3tc$: WEBGL_compressed_texture_s3tc | null;
+ WEBGL_compressed_texture_s3tc_srgb$: WEBGL_compressed_texture_s3tc_srgb | null;
+ WEBGL_debug_shaders$: WEBGL_debug_shaders | null;
+ WEBGL_lose_context$: WEBGL_lose_context | null;
+ WEBGL_debug_renderer_info$: WEBGL_debug_renderer_info | null;
+ OES_texture_half_float_linear$: OES_texture_half_float_linear | null;
+ OES_texture_float_linear$: OES_texture_float_linear | null;
+ useVAO$: boolean;
}
export interface _cocos_gfx_webgl2_webgl2_state_cache__IWebGL2TexUnit {
- glTexture: WebGLTexture | null;
+ glTexture$: WebGLTexture | null;
}
export class _cocos_gfx_webgl2_webgl2_state_cache__WebGL2StateCache {
- glArrayBuffer: WebGLBuffer | null;
- glElementArrayBuffer: WebGLBuffer | null;
- glUniformBuffer: WebGLBuffer | null;
- glBindUBOs: (WebGLBuffer | null)[];
- glBindUBOOffsets: number[];
- glVAO: WebGLVertexArrayObject | null;
- texUnit: number;
- glTexUnits: _cocos_gfx_webgl2_webgl2_state_cache__IWebGL2TexUnit[];
- glSamplerUnits: (WebGLSampler | null)[];
- glRenderbuffer: WebGLRenderbuffer | null;
- glFramebuffer: WebGLFramebuffer | null;
- glReadFramebuffer: WebGLFramebuffer | null;
- viewport: gfx.Viewport;
- scissorRect: gfx.Rect;
- rs: gfx.RasterizerState;
- dss: gfx.DepthStencilState;
- bs: gfx.BlendState;
- glProgram: WebGLProgram | null;
- glEnabledAttribLocs: boolean[];
- glCurrentAttribLocs: boolean[];
- texUnitCacheMap: Record<string, number>;
+ glArrayBuffer$: WebGLBuffer | null;
+ glElementArrayBuffer$: WebGLBuffer | null;
+ glUniformBuffer$: WebGLBuffer | null;
+ glBindUBOs$: (WebGLBuffer | null)[];
+ glBindUBOOffsets$: number[];
+ glVAO$: WebGLVertexArrayObject | null;
+ texUnit$: number;
+ glTexUnits$: _cocos_gfx_webgl2_webgl2_state_cache__IWebGL2TexUnit[];
+ glSamplerUnits$: (WebGLSampler | null)[];
+ glRenderbuffer$: WebGLRenderbuffer | null;
+ glFramebuffer$: WebGLFramebuffer | null;
+ glReadFramebuffer$: WebGLFramebuffer | null;
+ viewport$: gfx.Viewport;
+ scissorRect$: gfx.Rect;
+ rs$: gfx.RasterizerState;
+ dss$: gfx.DepthStencilState;
+ bs$: gfx.BlendState;
+ glProgram$: WebGLProgram | null;
+ glEnabledAttribLocs$: boolean[];
+ glCurrentAttribLocs$: boolean[];
+ texUnitCacheMap$: Record<string, number>;
+ constructor();
initialize(texUnit: number, bufferBindings: number, vertexAttributes: number): void;
}
export interface _cocos_gfx_webgl2_webgl2_gpu_objects__IWebGL2GPUTexture {
- type: gfx.TextureType;
- format: gfx.Format;
- usage: gfx.TextureUsage;
- width: number;
- height: number;
- depth: number;
- size: number;
- arrayLayer: number;
- mipLevel: number;
- samples: gfx.SampleCount;
- flags: gfx.TextureFlags;
- isPowerOf2: boolean;
- glTarget: GLenum;
- glInternalFmt: GLenum;
- glFormat: GLenum;
- glType: GLenum;
- glUsage: GLenum;
- glTexture: WebGLTexture | null;
- glRenderbuffer: WebGLRenderbuffer | null;
- glWrapS: GLenum;
- glWrapT: GLenum;
- glMinFilter: GLenum;
- glMagFilter: GLenum;
- isSwapchainTexture: boolean;
+ type$: gfx.TextureType;
+ format$: gfx.Format;
+ usage$: gfx.TextureUsage;
+ width$: number;
+ height$: number;
+ depth$: number;
+ size$: number;
+ arrayLayer$: number;
+ mipLevel$: number;
+ samples$: gfx.SampleCount;
+ flags$: gfx.TextureFlags;
+ isPowerOf2$: boolean;
+ glTarget$: GLenum;
+ glInternalFmt$: GLenum;
+ glFormat$: GLenum;
+ glType$: GLenum;
+ glUsage$: GLenum;
+ glTexture$: WebGLTexture | null;
+ glRenderbuffer$: WebGLRenderbuffer | null;
+ glWrapS$: GLenum;
+ glWrapT$: GLenum;
+ glMinFilter$: GLenum;
+ glMagFilter$: GLenum;
+ isSwapchainTexture$: boolean;
}
export interface _cocos_gfx_webgl2_webgl2_gpu_objects__IWebGL2GPUTextureView {
- gpuTexture: _cocos_gfx_webgl2_webgl2_gpu_objects__IWebGL2GPUTexture;
- type: gfx.TextureType;
- format: gfx.Format;
- baseLevel: number;
- levelCount: number;
+ gpuTexture$: _cocos_gfx_webgl2_webgl2_gpu_objects__IWebGL2GPUTexture;
+ type$: gfx.TextureType;
+ format$: gfx.Format;
+ baseLevel$: number;
+ levelCount$: number;
}
export class _cocos_gfx_webgl2_webgl2_texture__WebGL2Texture extends gfx.Texture {
+ constructor();
get gpuTexture(): _cocos_gfx_webgl2_webgl2_gpu_objects__IWebGL2GPUTexture;
get gpuTextureView(): _cocos_gfx_webgl2_webgl2_gpu_objects__IWebGL2GPUTextureView;
initialize(info: Readonly<gfx.TextureInfo> | Readonly<gfx.TextureViewInfo>, isSwapchainTexture?: boolean): void;
destroy(): void;
getTextureHandle(): number;
resize(width: number, height: number): void;
}
export interface _cocos_gfx_webgl2_webgl2_gpu_objects__IWebGL2BindingMapping {
- blockOffsets: number[];
- samplerTextureOffsets: number[];
- flexibleSet: number;
+ blockOffsets$: number[];
+ samplerTextureOffsets$: number[];
+ flexibleSet$: number;
}
export class _cocos_gfx_webgl2_webgl2_gpu_objects__IWebGL2BlitManager {
get srcFramebuffer(): WebGLFramebuffer | null;
get dstFramebuffer(): WebGLFramebuffer | null;
constructor();
- destroy(): void;
+ destroy$(): void;
}
export interface _cocos_gfx_webgpu_webgpu_gpu_objects__IWebGPUBindingMapping {
blockOffsets: number[];
samplerTextureOffsets: number[];
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
30 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
TODO:
|
…s to reduce js size. Add WebGLConstants.ts for inlining enums. Depends on: cocos/cocos-ccbuild#65
099d775
to
4d8a212
Compare
@cocos-robot run test cases |
@dumganhar, Please check the result of
Task Details
|
@dumganhar, Please check the result of
Task Details
|
…85-reduce-gfx-code # Conflicts: # cocos/gfx/webgl/webgl-commands.ts # cocos/gfx/webgl2/webgl2-commands.ts
@cocos-robot run test cases |
@dumganhar, Please check the result of
Task Details
|
@dumganhar, Please check the result of
Task Details
|
…85-reduce-gfx-code # Conflicts: # cocos/gfx/webgl/webgl-commands.ts # cocos/gfx/webgl2/webgl2-commands.ts
@cocos-robot run test cases |
@dumganhar, Please check the result of
Task Details |
@dumganhar, Please check the result of
Task Details |
…17692) Co-authored-by: cocos-robot <[email protected]>
Add WebGLConstants.ts for inlining enums. Depends on: cocos/cocos-ccbuild#65
#17664
After this changes, the package size could reduce 100KB.
gfx WebGL2 backend:187KB -> 103KB
Re: #
Changelog
Continuous Integration
This pull request:
Compatibility Check
This pull request:
Greptile Summary
The pull request focuses on reducing JavaScript size by mangling property names and removing unused code in the gfx/base and gfx/webgl modules.
$
symbol to their names (e.g.,_layout
to_layout$
). This affects files likecocos/gfx/base/buffer.ts
,cocos/gfx/base/command-buffer.ts
, and others.murmurhash2_32_gc
have been updated to be more specific in files such ascocos/gfx/base/render-pass.ts
.ceil
function incocos/gfx/base/define.ts
to replace multiple instances ofMath.ceil
.