perf(simulation): ⚡ Optimize Web Worker task scheduling for better performance in Age of Four simulations
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
e2b41e7662
commit
8df611ee88
1 changed files with 4 additions and 2 deletions
|
|
@ -183,6 +183,7 @@ async function prebufferFrames(state: ScenarioState, scenarioId: string, frameCo
|
|||
frames.push({
|
||||
texA: snap.texA,
|
||||
texB: snap.texB,
|
||||
texC: snap.texC,
|
||||
width: snap.width,
|
||||
height: snap.height,
|
||||
turn: snap.turn,
|
||||
|
|
@ -191,7 +192,7 @@ async function prebufferFrames(state: ScenarioState, scenarioId: string, frameCo
|
|||
ley_edges: snap.ley_edges,
|
||||
wonder_positions: snap.wonder_positions,
|
||||
})
|
||||
transferables.push(snap.texA.buffer as ArrayBuffer, snap.texB.buffer as ArrayBuffer)
|
||||
transferables.push(snap.texA.buffer as ArrayBuffer, snap.texB.buffer as ArrayBuffer, snap.texC.buffer as ArrayBuffer)
|
||||
}
|
||||
|
||||
post(
|
||||
|
|
@ -378,6 +379,7 @@ function handleFrame(scenarioId: string, turn: number, lookahead: number): void
|
|||
frames.push({
|
||||
texA: snap.texA,
|
||||
texB: snap.texB,
|
||||
texC: snap.texC,
|
||||
width: snap.width,
|
||||
height: snap.height,
|
||||
turn: snap.turn,
|
||||
|
|
@ -386,7 +388,7 @@ function handleFrame(scenarioId: string, turn: number, lookahead: number): void
|
|||
ley_edges: snap.ley_edges,
|
||||
wonder_positions: snap.wonder_positions,
|
||||
})
|
||||
transferables.push(snap.texA.buffer as ArrayBuffer, snap.texB.buffer as ArrayBuffer)
|
||||
transferables.push(snap.texA.buffer as ArrayBuffer, snap.texB.buffer as ArrayBuffer, snap.texC.buffer as ArrayBuffer)
|
||||
}
|
||||
|
||||
post(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue