mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2024-12-26 03:38:29 +00:00
[adapters] 增加 CC_WORKER_ASSET_PIPELINE_INCLUDE_LOAD 宏,并调整 CC_WORKER_DEBUG 默认值为 false
This commit is contained in:
parent
29427f6bf6
commit
9df0cdee8f
@ -96,6 +96,7 @@ const ipcMain = {
|
|||||||
_handlers,
|
_handlers,
|
||||||
CC_WORKER_FS_SYNC,
|
CC_WORKER_FS_SYNC,
|
||||||
CC_WORKER_ASSET_PIPELINE,
|
CC_WORKER_ASSET_PIPELINE,
|
||||||
|
CC_WORKER_ASSET_PIPELINE_INCLUDE_LOAD,
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -9,11 +9,14 @@ const hasWorker = sdkVersion[0] > 2 || (sdkVersion[0] === 2 && (sdkVersion[1] >
|
|||||||
// 是否启用 Worker 驱动资源管线(下载、缓存)
|
// 是否启用 Worker 驱动资源管线(下载、缓存)
|
||||||
globalThis.CC_WORKER_ASSET_PIPELINE = false;
|
globalThis.CC_WORKER_ASSET_PIPELINE = false;
|
||||||
|
|
||||||
|
// 是否启用 Worker 驱动资源管线(加载)
|
||||||
|
globalThis.CC_WORKER_ASSET_PIPELINE_INCLUDE_LOAD = false;
|
||||||
|
|
||||||
// 是否启用 Worker
|
// 是否启用 Worker
|
||||||
globalThis.CC_USE_WORKER = (CC_WORKER_ASSET_PIPELINE) && hasWorker && !isSubContext;
|
globalThis.CC_USE_WORKER = (CC_WORKER_ASSET_PIPELINE) && hasWorker && !isSubContext;
|
||||||
|
|
||||||
// 是否启用 Worker 调试模式
|
// 是否启用 Worker 调试模式
|
||||||
globalThis.CC_WORKER_DEBUG = true;
|
globalThis.CC_WORKER_DEBUG = false;
|
||||||
|
|
||||||
// 是否启用 Worker 调度模式,这也许能减少通信次数带来的性能消耗(必须一致)
|
// 是否启用 Worker 调度模式,这也许能减少通信次数带来的性能消耗(必须一致)
|
||||||
globalThis.CC_WORKER_SCHEDULER = true;
|
globalThis.CC_WORKER_SCHEDULER = true;
|
||||||
|
@ -144,6 +144,7 @@ function _initFromWorker(id, meta) {
|
|||||||
wrappers,
|
wrappers,
|
||||||
CC_WORKER_FS_SYNC,
|
CC_WORKER_FS_SYNC,
|
||||||
CC_WORKER_ASSET_PIPELINE,
|
CC_WORKER_ASSET_PIPELINE,
|
||||||
|
CC_WORKER_ASSET_PIPELINE_INCLUDE_LOAD,
|
||||||
] = meta;
|
] = meta;
|
||||||
|
|
||||||
for (const wrapper of wrappers) {
|
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_FS_SYNC = CC_WORKER_FS_SYNC;
|
||||||
globalThis.CC_WORKER_ASSET_PIPELINE = CC_WORKER_ASSET_PIPELINE;
|
globalThis.CC_WORKER_ASSET_PIPELINE = CC_WORKER_ASSET_PIPELINE;
|
||||||
|
globalThis.CC_WORKER_ASSET_PIPELINE_INCLUDE_LOAD = CC_WORKER_ASSET_PIPELINE_INCLUDE_LOAD;
|
||||||
|
|
||||||
_inited = true;
|
_inited = true;
|
||||||
if (_initCallback) _initCallback();
|
if (_initCallback) _initCallback();
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
globalThis.CC_WORKER_SCHEDULER = true;
|
globalThis.CC_WORKER_SCHEDULER = true;
|
||||||
|
|
||||||
// 是否启用 Worker 调试模式
|
// 是否启用 Worker 调试模式
|
||||||
globalThis.CC_WORKER_DEBUG = true;
|
globalThis.CC_WORKER_DEBUG = false;
|
||||||
|
|
||||||
// --- 以下从主线程同步值 ---
|
// --- 以下从主线程同步值 ---
|
||||||
|
|
||||||
@ -11,3 +11,6 @@ globalThis.CC_WORKER_FS_SYNC = null;
|
|||||||
|
|
||||||
// 是否启用 Worker 驱动资源管线(下载、缓存)
|
// 是否启用 Worker 驱动资源管线(下载、缓存)
|
||||||
globalThis.CC_WORKER_ASSET_PIPELINE = null;
|
globalThis.CC_WORKER_ASSET_PIPELINE = null;
|
||||||
|
|
||||||
|
// 是否启用 Worker 驱动资源管线(加载)
|
||||||
|
globalThis.CC_WORKER_ASSET_PIPELINE_INCLUDE_LOAD = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user