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

V3.8.2 merge v3.8.1 #16378

Merged
merged 13 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 19 additions & 0 deletions .github/workflows/native-compile-platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,25 @@ jobs:
(! contains(github.event.pull_request.body, '[X] does not change any runtime related code or build configuration'))
runs-on: ubuntu-latest
steps:
- name: Before free space
run: |
df -h

- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@d5af243ce7bacb67384aa6c5b1fc5f169e30903e
with:
tool-cache: true
android: false
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- name: After free space
run: |
df -h

- uses: actions/checkout@v2
- name: Download external libraries
shell: bash
Expand Down
8 changes: 8 additions & 0 deletions EngineErrorMap.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ Expected 'data' dict, but not found. Config file: %s

Please load the resource first : %s

### 1102

Effect settings not found, effects will not be imported.

### 1103

Success to load scene: %s

### 1200

cocos2d: Director: Error in gettimeofday
Expand Down
4 changes: 2 additions & 2 deletions cocos/core/platform/macro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -987,9 +987,9 @@

/**
* @en
* Used to set float output, the default value is false.
* Used to set float output render target, more accurate multiple light sources, fog, and translucent effects, custom pipeline only, the default value is false.

Check warning on line 990 in cocos/core/platform/macro.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 164. Maximum allowed is 150
* @zh
* 用于开启浮点格式的输出, 默认值为 false。
* 用于开启浮点格式的RT输出, 更精确的多光源、雾化和半透明效果, 仅用于自定义管线, 默认值为 false。
* @default false
*/
ENABLE_FLOAT_OUTPUT: boolean;
Expand Down
36 changes: 22 additions & 14 deletions cocos/game/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import { Pacer } from 'pal/pacer';
import { ConfigOrientation } from 'pal/screen-adapter';
import assetManager, { IAssetManagerOptions } from '../asset/asset-manager/asset-manager';
import { EventTarget, AsyncDelegate, sys, macro, VERSION, cclegacy, screen, Settings, settings, assert, garbageCollectionManager, DebugMode, warn, log, _resetDebugSetting } from '../core';
import { EventTarget, AsyncDelegate, sys, macro, VERSION, cclegacy, screen, Settings, settings, assert, garbageCollectionManager, DebugMode, warn, log, _resetDebugSetting, errorID, logID } from '../core';

Check warning on line 32 in cocos/game/game.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 204. Maximum allowed is 150
import { input } from '../input';
import { deviceManager, LegacyRenderMode } from '../gfx';
import { SplashScreen } from './splash-screen';
Expand Down Expand Up @@ -723,6 +723,7 @@
})
.then((): void => {
if (DEBUG) {
// eslint-disable-next-line no-console
console.time('Init Base');
}
const debugMode = config.debugMode || DebugMode.NONE;
Expand All @@ -735,6 +736,7 @@
.then((): Promise<void> => settings.init(config.settingsPath, config.overrideSettings))
.then((): Promise<void[]> => {
if (DEBUG) {
// eslint-disable-next-line no-console
console.timeEnd('Init Base');
}
this.emit(Game.EVENT_POST_BASE_INIT);
Expand All @@ -748,6 +750,7 @@
})
.then((): void => {
if (DEBUG) {
// eslint-disable-next-line no-console
console.time('Init Infrastructure');
}
macro.init();
Expand All @@ -769,6 +772,7 @@
Layers.init();
this.initPacer();
if (DEBUG) {
// eslint-disable-next-line no-console
console.timeEnd('Init Infrastructure');
}
})
Expand All @@ -795,27 +799,36 @@
}
const data = effectSettings.data;
if (data === null) {
console.error('Effect settings not found, effects will not be imported.');
errorID(1102);
return;
}
cclegacy.rendering.init(deviceManager.gfxDevice, data);
})
.then((): Promise<any[]> => {
const scriptPackages = settings.querySettings<string[]>(Settings.Category.SCRIPTING, 'scriptPackages');
if (scriptPackages) {
return Promise.all(scriptPackages.map((pack): Promise<any> => import(pack)));
}
return Promise.resolve([]);
})
.then((): Promise<void> => {
if (DEBUG) {
// eslint-disable-next-line no-console
console.time('Init SubSystem');
}
director.init();
return builtinResMgr.loadBuiltinAssets();
})
.then((): Promise<void[]> => {
if (DEBUG) {
// eslint-disable-next-line no-console
console.timeEnd('Init SubSystem');
}
this.emit(Game.EVENT_POST_SUBSYSTEM_INIT);
return this.onPostSubsystemInitDelegate.dispatch();
})
.then((): void => {
console.log(`Cocos Creator v${VERSION}`);
log(`Cocos Creator v${VERSION}`);
this.emit(Game.EVENT_ENGINE_INITED);
this._engineInited = true;
})
Expand All @@ -827,6 +840,7 @@
})
.then((): Promise<void> => {
if (DEBUG) {
// eslint-disable-next-line no-console
console.time('Init Project');
}
const jsList = settings.querySettings<string[]>(Settings.Category.PLUGINS, 'jsList');
Expand All @@ -838,13 +852,6 @@
}
return promise;
})
.then((): Promise<any[]> => {
const scriptPackages = settings.querySettings<string[]>(Settings.Category.SCRIPTING, 'scriptPackages');
if (scriptPackages) {
return Promise.all(scriptPackages.map((pack): Promise<any> => import(pack)));
}
return Promise.resolve([]);
})
.then((): Promise<any[]> => this._loadProjectBundles())
.then((): Promise<void> => this._loadCCEScripts())
.then((): void | Promise<void> => this._setupRenderPipeline())
Expand All @@ -855,6 +862,7 @@
})
.then((): Promise<void[]> => {
if (DEBUG) {
// eslint-disable-next-line no-console
console.timeEnd('Init Project');
}
this.emit(Game.EVENT_POST_PROJECT_INIT);
Expand Down Expand Up @@ -1013,11 +1021,11 @@
SplashScreen.instance.update(this._calculateDT(false));
} else if (this._shouldLoadLaunchScene) {
this._shouldLoadLaunchScene = false;
const launchScene = settings.querySettings(Settings.Category.LAUNCH, 'launchScene');
const launchScene = settings.querySettings(Settings.Category.LAUNCH, 'launchScene') as string;
if (launchScene) {
// load scene
director.loadScene(launchScene, (): void => {
console.log(`Success to load scene: ${launchScene}`);
logID(1103, launchScene);
this._initTime = performance.now();
director.startAnimation();
this.onStart?.();
Expand Down Expand Up @@ -1098,7 +1106,7 @@
}

private _setupRenderPipeline (): void | Promise<void> {
const renderPipeline = settings.querySettings(Settings.Category.RENDERING, 'renderPipeline');
const renderPipeline = settings.querySettings(Settings.Category.RENDERING, 'renderPipeline') as string;
if (!renderPipeline) {
return this._setRenderPipeline();
}
Expand All @@ -1124,7 +1132,7 @@
this._safeEmit(Game.EVENT_RENDERER_INITED);
}

private _safeEmit (event): void {
private _safeEmit (event: string | number): void {
if (EDITOR) {
try {
this.emit(event);
Expand Down
6 changes: 0 additions & 6 deletions cocos/physics/framework/deprecated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,6 @@ removeProperty(RigidBody.prototype, 'RigidBody.prototype', [
},
]);

removeProperty(EConstraintType, 'EConstraintType.prototype', [
{
name: 'CONE_TWIST',
},
]);

/**
* Alias of [[RigidBody]]
* @deprecated Since v1.2
Expand Down
8 changes: 0 additions & 8 deletions cocos/physics/framework/physics-enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,6 @@ export enum EConstraintType {
* 铰链约束。
*/
HINGE,
/**
* @en
* Cone twist constraint.
* @zh
* 锥形扭转约束。
* @deprecated coneTwist is deprecated, please use configurable instead
*/
CONE_TWIST,
/**
* @en
* Fixed constraint.
Expand Down
17 changes: 2 additions & 15 deletions cocos/physics/framework/physics-selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */
/* eslint-disable @typescript-eslint/no-unsafe-return */
import { EDITOR, TEST } from 'internal:constants';
import { IBaseConstraint, IPointToPointConstraint, IHingeConstraint, IConeTwistConstraint, IFixedConstraint,
import { IBaseConstraint, IPointToPointConstraint, IHingeConstraint, IFixedConstraint,
IConfigurableConstraint } from '../spec/i-physics-constraint';
import {
IBoxShape, ISphereShape, ICapsuleShape, ITrimeshShape, ICylinderShape,
Expand Down Expand Up @@ -58,10 +58,6 @@
PlaneShape?: Constructor<IPlaneShape>,
PointToPointConstraint?: Constructor<IPointToPointConstraint>,
HingeConstraint?: Constructor<IHingeConstraint>,
/**
* @deprecated cone twist constraint is deprecated, please use configurable instead
*/
ConeTwistConstraint?: Constructor<IConeTwistConstraint>,
FixedConstraint?: Constructor<IFixedConstraint>,
ConfigurableConstraint?: Constructor<IConfigurableConstraint>,
}
Expand Down Expand Up @@ -129,7 +125,7 @@
}

function register (id: IPhysicsEngineId, wrapper: IPhysicsWrapperObject): void {
if (!EDITOR && !TEST) console.info(`[PHYSICS]: register ${id}.`);

Check failure on line 128 in cocos/physics/framework/physics-selector.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected console statement
selector.backend[id] = wrapper;
if (!selector.physicsWorld || selector.id === id) {
updateLegacyMacro(id);
Expand All @@ -151,13 +147,13 @@
const mutableSelector = selector as Mutable<IPhysicsSelector>;
if (selector.physicsWorld && id !== selector.id && selector.backend[id] != null) {
selector.physicsWorld.destroy();
if (!TEST) console.info(`[PHYSICS]: switch from ${selector.id} to ${id}.`);

Check failure on line 150 in cocos/physics/framework/physics-selector.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected console statement
updateLegacyMacro(id);
mutableSelector.id = id;
mutableSelector.wrapper = selector.backend[id];
mutableSelector.physicsWorld = createPhysicsWorld();
} else {
if (!EDITOR && !TEST) console.info(`[PHYSICS]: using ${id}.`);

Check failure on line 156 in cocos/physics/framework/physics-selector.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected console statement
mutableSelector.physicsWorld = createPhysicsWorld();
}
if (worldInitData) {
Expand Down Expand Up @@ -189,7 +185,7 @@
if (!worldInitData) worldInitData = data;
if (!selector.runInEditor) return;
if (!selector.physicsWorld) {
if (!TEST) console.info(`[PHYSICS]: using ${selector.id}.`);

Check failure on line 188 in cocos/physics/framework/physics-selector.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected console statement
const mutableSelector = selector as Mutable<IPhysicsSelector>;
const world = mutableSelector.physicsWorld = createPhysicsWorld();
world.setGravity(worldInitData.gravity);
Expand Down Expand Up @@ -238,10 +234,6 @@
// JOINT //
PointToPointConstraint,
HingeConstraint,
/**
* @deprecated cone twist constraint is deprecated, please use configurable instead
*/
ConeTwistConstraint,
FixedConstraint,
ConfigurableConstraint,
// CHARACTER CONTROLLER //
Expand Down Expand Up @@ -424,7 +416,7 @@

const CREATE_CONSTRAINT_PROXY = { INITED: false };

interface IEntireConstraint extends IPointToPointConstraint, IHingeConstraint, IConeTwistConstraint, IFixedConstraint, IConfigurableConstraint { }
interface IEntireConstraint extends IPointToPointConstraint, IHingeConstraint, IFixedConstraint, IConfigurableConstraint { }
const ENTIRE_CONSTRAINT: IEntireConstraint = {
impl: null,
initialize: FUNC,
Expand Down Expand Up @@ -490,11 +482,6 @@
return new selector.wrapper.HingeConstraint!();
};

CREATE_CONSTRAINT_PROXY[EConstraintType.CONE_TWIST] = function createConeTwistConstraint (): IConeTwistConstraint {
if (check(selector.wrapper.ConeTwistConstraint, ECheckType.ConeTwistConstraint)) { return ENTIRE_CONSTRAINT; }
return new selector.wrapper.ConeTwistConstraint!();
};

CREATE_CONSTRAINT_PROXY[EConstraintType.FIXED] = function createFixedConstraint (): IFixedConstraint {
if (check(selector.wrapper.FixedConstraint, ECheckType.FixedConstraint)) { return ENTIRE_CONSTRAINT; }
return new selector.wrapper.FixedConstraint!();
Expand Down
5 changes: 0 additions & 5 deletions cocos/physics/spec/i-physics-constraint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,3 @@ export interface IConfigurableConstraint extends IBaseConstraint {
setBreakForce(v: number): void;
setBreakTorque(v: number): void;
}

/**
* @deprecated ConeTwistConstraint is deprecated, please use ConfigurableConstraint instead
*/
export type IConeTwistConstraint = IBaseConstraint
9 changes: 6 additions & 3 deletions cocos/rendering/custom/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -715,13 +715,15 @@ class SubmitInfo {

class RenderPassLayoutInfo {
protected _layoutID = 0;
protected _vertID = -1;
protected _stage: RenderStageData | null = null;
protected _layout: PipelineLayoutData;
protected _inputName: string;
protected _descriptorSet: DescriptorSet | null = null;
constructor (layoutId: number, input: [string, ComputeView[]]) {
constructor (layoutId: number, vertId: number, input: [string, ComputeView[]]) {
this._inputName = input[0];
this._layoutID = layoutId;
this._vertID = vertId;
const lg = context.layoutGraph;
this._stage = lg.getRenderStage(layoutId);
this._layout = lg.getLayout(layoutId);
Expand Down Expand Up @@ -778,6 +780,7 @@ class RenderPassLayoutInfo {
}
get descriptorSet (): DescriptorSet | null { return this._descriptorSet; }
get layoutID (): number { return this._layoutID; }
get vertID (): number { return this._vertID; }
get stage (): RenderStageData | null { return this._stage; }
get layout (): PipelineLayoutData { return this._layout; }
}
Expand Down Expand Up @@ -992,7 +995,7 @@ class DeviceRenderPass {
const layoutGraph = context.layoutGraph;
const stageId = layoutGraph.locateChild(layoutGraph.nullVertex(), stageName);
if (stageId !== 0xFFFFFFFF) {
this._layout = new RenderPassLayoutInfo(stageId, input);
this._layout = new RenderPassLayoutInfo(stageId, this.rasterPassInfo.id, input);
}
}
}
Expand Down Expand Up @@ -1246,7 +1249,7 @@ class DeviceComputePass {
const layoutGraph = context.layoutGraph;
const stageId = layoutGraph.locateChild(layoutGraph.nullVertex(), stageName);
if (stageId !== 0xFFFFFFFF) {
this._layout = new RenderPassLayoutInfo(stageId, input);
this._layout = new RenderPassLayoutInfo(stageId, this._computeInfo.id, input);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion cocos/terrain/terrain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1997,7 +1997,7 @@ export class Terrain extends Component {
if (EDITOR && this._asset) {
this._asset.weights[index * 4 + 0] = w.x * 255;
this._asset.weights[index * 4 + 1] = w.y * 255;
this._asset.weights[index * 4 + 2] = w.x * 255;
this._asset.weights[index * 4 + 2] = w.z * 255;
this._asset.weights[index * 4 + 3] = w.w * 255;
}
}
Expand Down
7 changes: 7 additions & 0 deletions native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3302,6 +3302,13 @@ if(APPLE)
CC_KEYBOARD_SUPPORT
)
elseif(IOS)

if("${XCODE_VERSION}" VERSION_GREATER_EQUAL "15.0")
# For Xcode 15 and newer, add extra link flags to fix crash in __cxx_global_var_init.
message(STATUS "Using Xcode 15 or newer, adding extra link flags: -Wl,-ld_classic.")
target_link_options(${ENGINE_NAME} PUBLIC -Wl,-ld_classic)
endif()

target_link_libraries(${ENGINE_NAME} PUBLIC
"-framework QuartzCore"
"-framework MetalPerformanceShaders"
Expand Down
2 changes: 2 additions & 0 deletions native/cocos/core/builtin/DebugInfos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ ccstd::unordered_map<uint32_t, ccstd::string> debugInfos = {
{ 1008, "[Action reverse]. override me" },
{ 1100, "Expected 'data' dict, but not found. Config file: %s" },
{ 1101, "Please load the resource first : %s" },
{ 1102, "Effect settings not found, effects will not be imported." },
{ 1103, "Success to load scene: %s" },
{ 1200, "cocos2d: Director: Error in gettimeofday" },
{ 1204, "Running scene should not be null" },
{ 1205, "The scene should not be null" },
Expand Down
Loading
Loading