From e63e13a628f3a77eaf2c23237be3f33d67bb6bb3 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Mon, 2 Nov 2020 11:42:48 +0800 Subject: [PATCH] Fix gfx polyfillCC in native (#7666) --- cocos/core/gfx/deprecated-3.0.0.ts | 2 +- cocos/core/gfx/index.ts | 28 +----------------------- cocos/core/gfx/polyfill-legacy-cc.ts | 32 ++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 28 deletions(-) create mode 100644 cocos/core/gfx/polyfill-legacy-cc.ts diff --git a/cocos/core/gfx/deprecated-3.0.0.ts b/cocos/core/gfx/deprecated-3.0.0.ts index c792e98fc5..7179b2c588 100644 --- a/cocos/core/gfx/deprecated-3.0.0.ts +++ b/cocos/core/gfx/deprecated-3.0.0.ts @@ -2,7 +2,7 @@ * @hidden */ -import { polyfillCC } from './index'; +import { polyfillCC } from './polyfill-legacy-cc'; import { removeProperty, replaceProperty } from '../utils/x-deprecated'; import { legacyCC } from '../global-exports'; diff --git a/cocos/core/gfx/index.ts b/cocos/core/gfx/index.ts index 047356aa36..77a4898126 100644 --- a/cocos/core/gfx/index.ts +++ b/cocos/core/gfx/index.ts @@ -3,25 +3,7 @@ * @module gfx */ -import { Buffer } from './buffer'; -import { CommandBuffer } from './command-buffer'; -import { Device } from './device'; -import { Framebuffer } from './framebuffer'; -import { InputAssembler } from './input-assembler'; -import { PipelineState } from './pipeline-state'; -import { Queue } from './queue'; -import { RenderPass } from './render-pass'; -import { Sampler } from './sampler'; -import { Shader } from './shader'; -import { Texture } from './texture'; -import { FormatSize,FormatSurfaceSize,GetTypeSize,getTypedArrayConstructor,MAX_ATTACHMENTS, - ObjectType,Obj,AttributeName,Type,Format,BufferUsageBit,MemoryUsageBit,BufferFlagBit, - BufferAccessBit,PrimitiveMode,PolygonMode,ShadeModel,CullMode,ComparisonFunc,StencilOp,BlendOp, - BlendFactor,ColorMask,Filter,Address,TextureType,TextureUsageBit,SampleCount,TextureFlagBit,ShaderStageFlagBit, - DescriptorType,CommandBufferType,LoadOp,StoreOp,TextureLayout,PipelineBindPoint,DynamicStateFlagBit,StencilFace, - QueueType,ClearFlag,FormatType, - FormatInfo,MemoryStatus,FormatInfos } from './define'; -import { Rect, Viewport, Color, Offset, Extent, TextureSubres, TextureCopy, BufferTextureCopy } from './define-class'; +import { polyfillCC } from './polyfill-legacy-cc'; import { legacyCC } from '../global-exports'; import './deprecated-3.0.0'; @@ -43,12 +25,4 @@ export * from './sampler'; export * from './shader'; export * from './texture'; -export const polyfillCC = {Device,Buffer,Texture,Sampler,Shader,InputAssembler,RenderPass,Framebuffer,PipelineState,CommandBuffer,Queue, - FormatSize,FormatSurfaceSize,GetTypeSize,getTypedArrayConstructor,MAX_ATTACHMENTS, - ObjectType,Obj,AttributeName,Type,Format,BufferUsageBit,MemoryUsageBit,BufferFlagBit, - BufferAccessBit,PrimitiveMode,PolygonMode,ShadeModel,CullMode,ComparisonFunc,StencilOp,BlendOp, - BlendFactor,ColorMask,Filter,Address,TextureType,TextureUsageBit,SampleCount,TextureFlagBit,ShaderStageFlagBit, - DescriptorType,CommandBufferType,LoadOp,StoreOp,TextureLayout,PipelineBindPoint,DynamicStateFlagBit,StencilFace, - QueueType,Rect,Viewport,Color,ClearFlag,Offset,Extent,TextureSubres,TextureCopy,BufferTextureCopy,FormatType, - FormatInfo,MemoryStatus,FormatInfos}; legacyCC.gfx = polyfillCC; diff --git a/cocos/core/gfx/polyfill-legacy-cc.ts b/cocos/core/gfx/polyfill-legacy-cc.ts new file mode 100644 index 0000000000..0f65a3287c --- /dev/null +++ b/cocos/core/gfx/polyfill-legacy-cc.ts @@ -0,0 +1,32 @@ +/** + * @hidden + */ + +import { Buffer } from './buffer'; +import { CommandBuffer } from './command-buffer'; +import { Device } from './device'; +import { Framebuffer } from './framebuffer'; +import { InputAssembler } from './input-assembler'; +import { PipelineState } from './pipeline-state'; +import { Queue } from './queue'; +import { RenderPass } from './render-pass'; +import { Sampler } from './sampler'; +import { Shader } from './shader'; +import { Texture } from './texture'; +import { FormatSize,FormatSurfaceSize,GetTypeSize,getTypedArrayConstructor,MAX_ATTACHMENTS, + ObjectType,Obj,AttributeName,Type,Format,BufferUsageBit,MemoryUsageBit,BufferFlagBit, + BufferAccessBit,PrimitiveMode,PolygonMode,ShadeModel,CullMode,ComparisonFunc,StencilOp,BlendOp, + BlendFactor,ColorMask,Filter,Address,TextureType,TextureUsageBit,SampleCount,TextureFlagBit,ShaderStageFlagBit, + DescriptorType,CommandBufferType,LoadOp,StoreOp,TextureLayout,PipelineBindPoint,DynamicStateFlagBit,StencilFace, + QueueType,ClearFlag,FormatType, + FormatInfo,MemoryStatus,FormatInfos } from './define'; +import { Rect, Viewport, Color, Offset, Extent, TextureSubres, TextureCopy, BufferTextureCopy } from './define-class'; + +export const polyfillCC = {Device,Buffer,Texture,Sampler,Shader,InputAssembler,RenderPass,Framebuffer,PipelineState,CommandBuffer,Queue, + FormatSize,FormatSurfaceSize,GetTypeSize,getTypedArrayConstructor,MAX_ATTACHMENTS, + ObjectType,Obj,AttributeName,Type,Format,BufferUsageBit,MemoryUsageBit,BufferFlagBit, + BufferAccessBit,PrimitiveMode,PolygonMode,ShadeModel,CullMode,ComparisonFunc,StencilOp,BlendOp, + BlendFactor,ColorMask,Filter,Address,TextureType,TextureUsageBit,SampleCount,TextureFlagBit,ShaderStageFlagBit, + DescriptorType,CommandBufferType,LoadOp,StoreOp,TextureLayout,PipelineBindPoint,DynamicStateFlagBit,StencilFace, + QueueType,Rect,Viewport,Color,ClearFlag,Offset,Extent,TextureSubres,TextureCopy,BufferTextureCopy,FormatType, + FormatInfo,MemoryStatus,FormatInfos}; \ No newline at end of file