Skip to content
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

[do not merge] V3.8.2 pipeline #15923

Closed
wants to merge 83 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
ba60761
fgd rebuild & depth stencil view (#154)
hana-alice Jul 27, 2023
095b083
loading subresource as needed & all metal shader delayed compile (#155)
hana-alice Jul 31, 2023
7d1b349
Merge branch 'v3.8.1' into v3.8.1-pipeline
star-e Aug 2, 2023
9a87d4d
Merge branch 'v3.8.1-pipeline' of https://github.com/star-e/cocos-eng…
star-e Aug 2, 2023
00f5a5a
Complete Scene Culling (#156)
GengineJS Aug 2, 2023
869075b
Merge branch 'v3.8.1' into v3.8.1-pipeline
star-e Aug 3, 2023
132e2b1
[Optimize] Executor and sceneCulling (#158)
GengineJS Aug 8, 2023
89b1aa0
fix lint
star-e Aug 8, 2023
04d5623
Merge branch 'v3.8.1-pipeline' of https://github.com/star-e/cocos-eng…
star-e Aug 8, 2023
ace2185
[Update] mempool logic
GengineJS Aug 9, 2023
5c701fc
subresource move (#157)
hana-alice Aug 9, 2023
003f4f9
add constants
star-e Aug 9, 2023
d08205c
Merge branch 'v3.8.1' into v3.8.1-pipeline-resolve
star-e Aug 9, 2023
7c1ddf6
Merge branch 'v3.8.1-pipeline' into v3.8.1-pipeline-resolve
star-e Aug 9, 2023
a31e5a9
fix lint
star-e Aug 9, 2023
8f676b6
type update (#160)
hana-alice Aug 9, 2023
0385078
fix addTexture default plane
star-e Aug 9, 2023
ed75fb8
change default planeID to 0
star-e Aug 9, 2023
ddad5a1
remove [nodiscard] string literal (#161)
hana-alice Aug 10, 2023
fd659f3
Merge branch 'v3.8.1' into v3.8.1-pipeline
star-e Aug 10, 2023
22eca7f
Merge branch 'v3.8.1-pipeline' of https://github.com/star-e/cocos-eng…
star-e Aug 10, 2023
60a89e2
fix naming
star-e Aug 10, 2023
94e21dd
Merge branch 'v3.8.1' into v3.8.1-pipeline
star-e Aug 10, 2023
e5faac9
[Fixed]Clean up redundant code and fix an issue where adjusting the c…
GengineJS Aug 10, 2023
7dcf1a3
Merge branch 'v3.8.1-pipeline' of https://github.com/star-e/cocos-eng…
GengineJS Aug 10, 2023
bf9866e
Update eslint
GengineJS Aug 10, 2023
7cb9fb3
Merge pull request #162 from GengineJS/v3.8.1-pipeline-0809
star-e Aug 10, 2023
9600900
Merge branch 'v3.8.1' into v3.8.1-pipeline
star-e Aug 11, 2023
f901860
Merge branch 'v3.8.1-pipeline' of https://github.com/star-e/cocos-eng…
star-e Aug 11, 2023
479e67a
[Fixed] Fix the issue of ghosting in the gizmo when moving the editor.
GengineJS Aug 11, 2023
67209ba
Merge pull request #163 from GengineJS/v3.8.1-pipeline-0811
star-e Aug 11, 2023
5eaff55
Merge branch 'v3.8.1' into v3.8.1-pipeline
star-e Aug 11, 2023
1c9ecc4
add object pool
star-e Aug 11, 2023
378ed5f
skip index reset
star-e Aug 11, 2023
628bb91
Merge pull request #164 from star-e/v3.8.1-pipeline-memory
star-e Aug 14, 2023
a24e954
add reset
star-e Aug 14, 2023
4d4c992
remove unnecessary reset
star-e Aug 14, 2023
0814256
adding object pool
star-e Aug 14, 2023
ae06698
adding object pool
star-e Aug 14, 2023
a98ad1d
change default batch size
star-e Aug 14, 2023
6d26cd6
reset added
star-e Aug 14, 2023
6bd4c74
Merge pull request #159 from GengineJS/v3.8.1-pipeline-0808
star-e Aug 14, 2023
94889a2
add pool creation
star-e Aug 16, 2023
34c75e8
Merge branch 'v3.8.1-pipeline' of https://github.com/star-e/cocos-eng…
star-e Aug 16, 2023
a8bf3d5
Merge branch 'v3.8.1' into v3.8.1-pipeline
star-e Aug 16, 2023
f95ab81
fix reset bug
star-e Aug 16, 2023
8b077f7
[Modify]Adjusting the logic of Reflection Probes
GengineJS Aug 16, 2023
f5f63c5
Merge branch 'v3.8.1-pipeline' of https://github.com/star-e/cocos-eng…
GengineJS Aug 16, 2023
603a050
Merge branch 'v3.8.1' into v3.8.1-pipeline
star-e Aug 17, 2023
b4f3ebc
[Completed] the logic adjustment for reflection probes
GengineJS Aug 17, 2023
bc87d44
Merge branch 'v3.8.1-pipeline' of https://github.com/star-e/cocos-eng…
GengineJS Aug 17, 2023
4af68a8
[Update]
GengineJS Aug 17, 2023
f556cbb
Merge pull request #166 from GengineJS/v3.8.1-pipeline-0814
star-e Aug 17, 2023
6d5125a
remove view type from subresource view
star-e Aug 17, 2023
b1b3535
Merge branch 'v3.8.1' into v3.8.1-pipeline
star-e Aug 17, 2023
230f04b
Merge branch 'v3.8.1' into v3.8.1-pipeline
star-e Aug 23, 2023
0c3e594
add reflection probe
star-e Aug 23, 2023
2a1931a
[Modify] Native reflectionProbe
GengineJS Aug 25, 2023
766f549
Merge branch 'v3.8.1-pipeline' of https://github.com/star-e/cocos-eng…
GengineJS Aug 25, 2023
1ce2d37
add builtin reflection probe pass builder
star-e Aug 25, 2023
9c7a443
Update
GengineJS Aug 25, 2023
b73fcd6
Merge branch 'v3.8.1-pipeline' of https://github.com/star-e/cocos-eng…
GengineJS Aug 25, 2023
cee296c
remove render queue
star-e Aug 25, 2023
81e555c
Merge branch 'v3.8.1-pipeline' of https://github.com/star-e/cocos-eng…
GengineJS Aug 28, 2023
72522b0
Complete reflection probes for the native new pipeline
GengineJS Aug 29, 2023
f444e0b
Fixed lint
GengineJS Aug 29, 2023
749bc15
Update
GengineJS Aug 29, 2023
f565651
Merge pull request #167 from GengineJS/v3.8.1-pipeline-0820
star-e Aug 30, 2023
ec12686
Merge branch 'v3.8.1' into v3.8.1-pipeline
star-e Aug 30, 2023
fa34683
add generated code
star-e Aug 30, 2023
df20a52
remove width and height
star-e Aug 30, 2023
a6465b7
fix missing header
star-e Aug 30, 2023
94dd7be
add missing web change
star-e Aug 30, 2023
24d124d
add missing change
star-e Aug 30, 2023
b5c272a
Replace old pipeline (#168)
GengineJS Aug 31, 2023
518e3d5
Merge branch 'v3.8.1' into v3.8.1-pipeline
star-e Aug 31, 2023
bcf72ba
Revert "Replace old pipeline (#168)"
star-e Aug 31, 2023
fd7368d
[Fixed] the problem that the wireframe is not displayed (#170)
GengineJS Sep 1, 2023
1c8ae59
adding builtin lights
star-e Sep 1, 2023
dfe3d9f
Merge branch 'v3.8.1' into v3.8.1-pipeline
star-e Sep 1, 2023
81e82bc
adding culling
star-e Sep 1, 2023
2df4429
Merge branch 'v3.8.1' into v3.8.1-pipeline
star-e Sep 6, 2023
93b1895
Update (#169)
GengineJS Sep 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions cocos/core/memop/recycle-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@

import { ScalableContainer } from './scalable-container';

export class UpdateRecyclePool {
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type, @typescript-eslint/no-empty-function
update (...args: any[]) {}
}

/**
* @en Recyclable object pool. It's designed to be entirely reused each time.
* There is no put and get method, each time you get the [[data]], you can use all elements as new.
Expand All @@ -36,7 +41,7 @@ import { ScalableContainer } from './scalable-container';
* @see [[Pool]]
*/
export class RecyclePool<T = any> extends ScalableContainer {
private _fn: () => T;
private _fn: (...args: any[]) => T;
private _dtor: ((obj: T) => void) | null = null;
private _count = 0;
private _data: T[];
Expand All @@ -49,7 +54,7 @@ export class RecyclePool<T = any> extends ScalableContainer {
* @param size Initial pool size
* @param dtor The finalizer of element, it's invoked when this container is destroyed or shrunk
*/
constructor (fn: () => T, size: number, dtor?: (obj: T) => void) {
constructor (fn: (...args: any[]) => T, size: number, dtor?: (obj: T) => void) {
super();
this._fn = fn;
this._dtor = dtor || null;
Expand Down Expand Up @@ -110,6 +115,25 @@ export class RecyclePool<T = any> extends ScalableContainer {
return this._data[this._count++];
}

/**
* @en Create objects with given parameters. If object creation is parameter-based, it is recommended to start with an initial length of 0.
* @zh 通过给定参数构建对象,如果是通过参数构建对象的方式,建议Pool初始长度为0,并让目标类继承UpdateRecyclePool,便于更新操作。
*/
public addWithArgs (...args: any[]): T {
const data = this._data[this._count];
if (data) {
this._count++;
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
if (data instanceof UpdateRecyclePool) { data.update(...args); }
return data;
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
const newObj = this._fn(...args); // 使用传入的参数创建新对象
this._data[this._count++] = newObj;

return newObj;
}

/**
* @en Destroy the object pool. Please don't use it any more after it is destroyed.
* @zh 销毁对象池。销毁后不能继续使用。
Expand Down
20 changes: 20 additions & 0 deletions cocos/gfx/base/define.ts
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,15 @@ export class Viewport {
this.maxDepth = info.maxDepth;
return this;
}

public reset (): void {
this.left = 0;
this.top = 0;
this.width = 0;
this.height = 0;
this.minDepth = 0;
this.maxDepth = 1;
}
}

export class Color {
Expand Down Expand Up @@ -1006,6 +1015,13 @@ export class Color {
this.w = w;
return this;
}

public reset (): void {
this.x = 0;
this.y = 0;
this.z = 0;
this.w = 0;
}
}

export class BindingMappingInfo {
Expand Down Expand Up @@ -1756,6 +1772,10 @@ export class DescriptorSetLayoutInfo {
deepCopy(this.bindings, info.bindings, DescriptorSetLayoutBinding);
return this;
}

reset (): void {
this.bindings.length = 0;
}
}

export class DescriptorSetInfo {
Expand Down
32 changes: 7 additions & 25 deletions cocos/rendering/custom/define.ts
Original file line number Diff line number Diff line change
Expand Up @@ -755,8 +755,10 @@ export function buildReflectionProbePass (
probeCamera.clearStencil,
probeCamera.clearFlag,
);
const passBuilder = probePass.addQueue(QueueHint.RENDER_OPAQUE);
passBuilder.addSceneOfCamera(camera, new LightInfo(), SceneFlags.REFLECTION_PROBE);
const passBuilder = probePass.addQueue(QueueHint.RENDER_OPAQUE, 'reflect-map');
const lightInfo = new LightInfo();
lightInfo.probe = probe;
passBuilder.addSceneOfCamera(camera, lightInfo, SceneFlags.REFLECTION_PROBE | SceneFlags.OPAQUE_OBJECT);
updateCameraUBO(passBuilder as unknown as any, probeCamera, ppl);
}

Expand Down Expand Up @@ -1206,33 +1208,13 @@ export function updateGlobalDescBinding (data: RenderData, layoutName = 'default
applyGlobalDescBinding(data, layoutName, true);
}

export function mergeSrcToTargetDesc (fromDesc, toDesc, isForce = false): number[] {
export function mergeSrcToTargetDesc (fromDesc, toDesc): number[] {
fromDesc.update();
const fromGpuDesc = fromDesc.gpuDescriptorSet;
const toGpuDesc = toDesc.gpuDescriptorSet;
const extResId: number[] = [];
if (isForce) {
toGpuDesc.gpuDescriptors = fromGpuDesc.gpuDescriptors;
toGpuDesc.descriptorIndices = fromGpuDesc.descriptorIndices;
return extResId;
}
for (let i = 0; i < toGpuDesc.gpuDescriptors.length; i++) {
const fromRes = fromGpuDesc.gpuDescriptors[i];
if (!fromRes) continue;
const currRes = toGpuDesc.gpuDescriptors[i];
if (!currRes.gpuBuffer && fromRes.gpuBuffer) {
currRes.gpuBuffer = fromRes.gpuBuffer;
extResId.push(i);
} else if ('gpuTextureView' in currRes && !currRes.gpuTextureView) {
currRes.gpuTextureView = fromRes.gpuTextureView;
currRes.gpuSampler = fromRes.gpuSampler;
extResId.push(i);
} else if ('gpuTexture' in currRes && !currRes.gpuTexture) {
currRes.gpuTexture = fromRes.gpuTexture;
currRes.gpuSampler = fromRes.gpuSampler;
extResId.push(i);
}
}
toGpuDesc.gpuDescriptors = fromGpuDesc.gpuDescriptors;
toGpuDesc.descriptorIndices = fromGpuDesc.descriptorIndices;
return extResId;
}

Expand Down
Loading