Skip to content
Permalink
Browse files

feat(api): reallocateCPUMemoryJobAPI add reallocateGeometry api

  • Loading branch information...
yyc-git committed May 24, 2019
1 parent 22594a6 commit 58f6e1c412f1e92dfc01c45bee2d5a19b46e4354
Showing with 9 additions and 4 deletions.
  1. +2 −0 src/Index.re
  2. +4 −1 src/api/job/ReallocateCPUMemoryJobAPI.re
  3. +3 −3 src/job/utils/ReallocateCPUMemoryJobUtils.re
@@ -532,6 +532,8 @@ let registerNoWorkerInitJob = JobAPI.registerNoWorkerInitJob;

let resetDisposeCount = ReallocateCPUMemoryJobAPI.resetDisposeCount;

let reallocateGeometry = ReallocateCPUMemoryJobAPI.reallocateGeometry;

let initGeometryBufferData = ReallocateCPUMemoryJobAPI.initGeometryBufferData;

let reAllocateToBuffer = ReallocateCPUMemoryJobAPI.reAllocateToBuffer;
@@ -21,7 +21,7 @@ let reAllocateToBuffer = (newBufferData, state) => {
newBufferData,
RecordGeometryMainService.getRecord(state),
)
|. Some,
->Some,
};

let initGeometryBufferData = ({settingRecord}) => {
@@ -35,6 +35,9 @@ let initGeometryBufferData = ({settingRecord}) => {
);
};

let reallocateGeometry = (percent, state) =>
ReallocateCPUMemoryJobUtils.reallocateGeometry(percent, state);

let resetDisposeCount = state => {
...state,
geometryRecord:
@@ -22,7 +22,7 @@ let reallocateGameObjectByDisposeCount =
state;
};

let _reallocateGeometry = ({settingRecord} as state) => {
let reallocateGeometry = (percent, {settingRecord} as state) => {
...state,
geometryRecord:
Some(
@@ -34,7 +34,7 @@ let _reallocateGeometry = ({settingRecord} as state) => {
settingRecord,
)
|| QueryCPUMemoryService.isGeometryBufferNearlyFull(
0.9,
percent,
geometryRecord,
)) {
geometryRecord.disposeCount = 0;
@@ -49,4 +49,4 @@ let _reallocateGeometry = ({settingRecord} as state) => {
};

let execJob = state =>
state |> reallocateGameObjectByDisposeCount |> _reallocateGeometry;
state |> reallocateGameObjectByDisposeCount |> reallocateGeometry(0.9);

0 comments on commit 58f6e1c

Please sign in to comment.
You can’t perform that action at this time.