-
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
Move classes from interface to implementation #18091
Conversation
👍 Package size ⤵ -1581 bytes, old: 5316212, new: 5314631Interface Check Report! WARNING this pull request has changed these public interfaces:
@@ -35696,16 +35696,8 @@
}
export namespace rendering {
export function saveLightInfo(a: OutputArchive, v: LightInfo): void;
export function loadLightInfo(a: InputArchive, v: LightInfo): void;
- export function saveDescriptor(a: OutputArchive, v: Descriptor): void;
- export function loadDescriptor(a: InputArchive, v: Descriptor): void;
- export function saveDescriptorBlock(a: OutputArchive, v: DescriptorBlock): void;
- export function loadDescriptorBlock(a: InputArchive, v: DescriptorBlock): void;
- export function saveDescriptorBlockFlattened(a: OutputArchive, v: DescriptorBlockFlattened): void;
- export function loadDescriptorBlockFlattened(a: InputArchive, v: DescriptorBlockFlattened): void;
- export function saveDescriptorBlockIndex(a: OutputArchive, v: DescriptorBlockIndex): void;
- export function loadDescriptorBlockIndex(a: InputArchive, v: DescriptorBlockIndex): void;
export function saveResolvePair(a: OutputArchive, v: ResolvePair): void;
export function loadResolvePair(a: InputArchive, v: ResolvePair): void;
export function saveCopyPair(a: OutputArchive, v: CopyPair): void;
export function loadCopyPair(a: InputArchive, v: CopyPair): void;
@@ -35749,8 +35741,22 @@
TEXTURE1D = 1,
TEXTURE2D = 2,
TEXTURE3D = 3
}
+ export enum ViewDimension {
+ UNKNOWN = 0,
+ BUFFER = 1,
+ TEX1D = 2,
+ TEX1DARRAY = 3,
+ TEX2D = 4,
+ TEX2DARRAY = 5,
+ TEX2DMS = 6,
+ TEX2DMSARRAY = 7,
+ TEX3D = 8,
+ TEXCUBE = 9,
+ TEXCUBEARRAY = 10,
+ RAYTRACING_ACCELERATION_STRUCTURE = 11
+ }
export enum ResourceFlags {
NONE = 0,
UNIFORM = 1,
INDIRECT = 2,
@@ -35817,48 +35823,8 @@
probe: renderer.scene.ReflectionProbe | null;
level: number;
culledByLight: boolean;
}
- export const enum DescriptorTypeOrder {
- UNIFORM_BUFFER = 0,
- DYNAMIC_UNIFORM_BUFFER = 1,
- SAMPLER_TEXTURE = 2,
- SAMPLER = 3,
- TEXTURE = 4,
- STORAGE_BUFFER = 5,
- DYNAMIC_STORAGE_BUFFER = 6,
- STORAGE_IMAGE = 7,
- INPUT_ATTACHMENT = 8
- }
- export class Descriptor {
- constructor(type?: gfx.Type);
- reset(type: gfx.Type): void;
- type: gfx.Type;
- count: number;
- }
- export class DescriptorBlock {
- reset(): void;
- readonly descriptors: Map<string, Descriptor>;
- readonly uniformBlocks: Map<string, gfx.UniformBlock>;
- capacity: number;
- count: number;
- }
- export class DescriptorBlockFlattened {
- reset(): void;
- readonly descriptorNames: string[];
- readonly uniformBlockNames: string[];
- readonly descriptors: Descriptor[];
- readonly uniformBlocks: gfx.UniformBlock[];
- capacity: number;
- count: number;
- }
- export class DescriptorBlockIndex {
- constructor(updateFrequency?: UpdateFrequency, parameterType?: ParameterType, descriptorType?: DescriptorTypeOrder, visibility?: gfx.ShaderStageFlagBit);
- updateFrequency: UpdateFrequency;
- parameterType: ParameterType;
- descriptorType: DescriptorTypeOrder;
- visibility: gfx.ShaderStageFlagBit;
- }
export const enum ResolveFlags {
NONE = 0,
COLOR = 1,
DEPTH = 2,
@@ -35926,12 +35892,8 @@
export class RenderCommonObjectPool {
constructor();
reset(): void;
createLightInfo(light?: renderer.scene.Light | null, level?: number, culledByLight?: boolean, probe?: renderer.scene.ReflectionProbe | null): LightInfo;
- createDescriptor(type?: gfx.Type): Descriptor;
- createDescriptorBlock(): DescriptorBlock;
- createDescriptorBlockFlattened(): DescriptorBlockFlattened;
- createDescriptorBlockIndex(updateFrequency?: UpdateFrequency, parameterType?: ParameterType, descriptorType?: DescriptorTypeOrder, visibility?: gfx.ShaderStageFlagBit): DescriptorBlockIndex;
createResolvePair(source?: string, target?: string, resolveFlags?: ResolveFlags, mode?: gfx.ResolveMode, mode1?: gfx.ResolveMode): ResolvePair;
createCopyPair(source?: string, target?: string, mipLevels?: number, numSlices?: number, sourceMostDetailedMip?: number, sourceFirstSlice?: number, sourcePlaneSlice?: number, targetMostDetailedMip?: number, targetFirstSlice?: number, targetPlaneSlice?: number): CopyPair;
createUploadPair(target?: string, mipLevels?: number, numSlices?: number, targetMostDetailedMip?: number, targetFirstSlice?: number, targetPlaneSlice?: number): UploadPair;
createMovePair(source?: string, target?: string, mipLevels?: number, numSlices?: number, targetMostDetailedMip?: number, targetFirstSlice?: number, targetPlaneSlice?: number): MovePair;
|
@@ -471,11 +473,101 @@ export class DescriptorSetData { | |||
declare /*refcount*/ descriptorSet: DescriptorSet | null; | |||
} | |||
|
|||
export class DescriptorGroupBlockData { |
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.
Is it needed to be exported to developer?
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.
I will refactor the types and move them into internal modules.
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.
I will refactor the types and move them into internal modules.
That will be good, in that case, all properties could be mangled by adding /** @mangle */
for the classes or properties.
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.
I will refactor the types and move them into internal modules.
Will you do it in this PR or other PR?
this.accessType = accessType; | ||
this.viewDimension = viewDimension; | ||
this.format = format; | ||
this.capacity = capacity; |
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.
Could we invoke reset
method in constructor? If we could, it will save some package size.
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.
It is possible.
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.
In this pr, I will only move classes from types.ts
to layout-graph.ts
. reset
will be changed in the following pr.
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.
I found implementations of constructor
and reset
are a bit different. For containers, constructor
will assign to members while reset
will only change the size to 0.
a.n(v.count); | ||
} | ||
|
||
export function loadDescriptorBlockFlattened (a: InputArchive, v: DescriptorBlockFlattened): void { |
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.
The parameters a
& v
are not detailed.
Parameter names could be mangled/minified by terser.
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.
I will rename these values in another pr.
bool sevalue_to_native(const se::Value &from, cc::render::DescriptorBlockFlattened *to, se::Object *ctx); // NOLINT | ||
|
||
template <> | ||
bool sevalue_to_native(const se::Value &from, cc::render::DescriptorBlockIndex *to, se::Object *ctx); // NOLINT |
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.
Doesn't need these conversions now ?
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.
I think they are not needed now. These values are filled by serialization now.
Descriptor layout classes belong to implementation. So they are moved from interface.
Changelog
Continuous Integration
This pull request:
Compatibility Check
This pull request: