[adapters] 增加 CC_WORKER_ASSET_PIPELINE_INCLUDE_LOAD 宏,并调整 CC_WORKER_DEBUG 默认值为 false

This commit is contained in:
SmallMain 2024-10-22 14:29:26 +08:00
parent 29427f6bf6
commit 9df0cdee8f
No known key found for this signature in database
4 changed files with 11 additions and 2 deletions

View File

@ -96,6 +96,7 @@ const ipcMain = {
_handlers,
CC_WORKER_FS_SYNC,
CC_WORKER_ASSET_PIPELINE,
CC_WORKER_ASSET_PIPELINE_INCLUDE_LOAD,
]);
},

View File

@ -9,11 +9,14 @@ const hasWorker = sdkVersion[0] > 2 || (sdkVersion[0] === 2 && (sdkVersion[1] >
// 是否启用 Worker 驱动资源管线(下载、缓存)
globalThis.CC_WORKER_ASSET_PIPELINE = false;
// 是否启用 Worker 驱动资源管线(加载)
globalThis.CC_WORKER_ASSET_PIPELINE_INCLUDE_LOAD = false;
// 是否启用 Worker
globalThis.CC_USE_WORKER = (CC_WORKER_ASSET_PIPELINE) && hasWorker && !isSubContext;
// 是否启用 Worker 调试模式
globalThis.CC_WORKER_DEBUG = true;
globalThis.CC_WORKER_DEBUG = false;
// 是否启用 Worker 调度模式,这也许能减少通信次数带来的性能消耗(必须一致)
globalThis.CC_WORKER_SCHEDULER = true;

View File

@ -144,6 +144,7 @@ function _initFromWorker(id, meta) {
wrappers,
CC_WORKER_FS_SYNC,
CC_WORKER_ASSET_PIPELINE,
CC_WORKER_ASSET_PIPELINE_INCLUDE_LOAD,
] = meta;
for (const wrapper of wrappers) {
@ -158,6 +159,7 @@ function _initFromWorker(id, meta) {
globalThis.CC_WORKER_FS_SYNC = CC_WORKER_FS_SYNC;
globalThis.CC_WORKER_ASSET_PIPELINE = CC_WORKER_ASSET_PIPELINE;
globalThis.CC_WORKER_ASSET_PIPELINE_INCLUDE_LOAD = CC_WORKER_ASSET_PIPELINE_INCLUDE_LOAD;
_inited = true;
if (_initCallback) _initCallback();

View File

@ -2,7 +2,7 @@
globalThis.CC_WORKER_SCHEDULER = true;
// 是否启用 Worker 调试模式
globalThis.CC_WORKER_DEBUG = true;
globalThis.CC_WORKER_DEBUG = false;
// --- 以下从主线程同步值 ---
@ -11,3 +11,6 @@ globalThis.CC_WORKER_FS_SYNC = null;
// 是否启用 Worker 驱动资源管线(下载、缓存)
globalThis.CC_WORKER_ASSET_PIPELINE = null;
// 是否启用 Worker 驱动资源管线(加载)
globalThis.CC_WORKER_ASSET_PIPELINE_INCLUDE_LOAD = null;