WebGPU renderer complete: dirty uploads, default limits, legacy removed, WebGPU required, warm-up (t88 phase 2d)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@ let ents = []; // loose objects (bars)
|
||||
let bgm; // background layer: trees. Liquids, powders and gases pass in front of it.
|
||||
let flyers = []; // grains in flight, blown out of the bot
|
||||
let ghostBlocks = new Map(), ghostMolds = [];
|
||||
let renderDirty; // GPU world textures, one invalidation bit per 32x32 chunk.
|
||||
let awake, hot, hotLvl, powderArea, roofDirty;
|
||||
let loadWakeOrder = null, loadWakePending = null, loadWakeIndex = 0;
|
||||
let tick = 0, tickStamp = 1;
|
||||
@@ -53,6 +54,7 @@ function alloc(w, h) {
|
||||
surfY = new Int16Array(w); roofY = new Int16Array(w); dirtY = new Int16Array(w); graniteY = new Int16Array(w); basaltY = new Int16Array(w); magmaY = new Int16Array(w);
|
||||
AMB = new Float32Array(h);
|
||||
loadWakeOrder = loadWakePending = null; loadWakeIndex = 0;
|
||||
renderDirty = new Uint8Array(NCH).fill(1);
|
||||
cleatChunks = new Uint8Array(NCH);
|
||||
awake = new Uint8Array(NCH); hot = new Uint8Array(NCH); hotLvl = new Uint8Array(NCH);
|
||||
roofDirty = new Uint8Array(CW).fill(1);
|
||||
@@ -90,7 +92,10 @@ function fillNoise() {
|
||||
}
|
||||
|
||||
// ---------- Waking ----------
|
||||
function renderDirtyXY(x, y) { renderDirty[(y >> 5) * CW + (x >> 5)] = 1; }
|
||||
function renderDirtyIdx(i) { renderDirtyXY(i % W, (i / W) | 0); }
|
||||
function wakeXY(x, y) {
|
||||
renderDirtyXY(x, y);
|
||||
const cx = x >> 5, cy = y >> 5, c = cy * CW + cx;
|
||||
roofDirty[cx] = 1;
|
||||
awake[c] = 3;
|
||||
@@ -99,6 +104,7 @@ function wakeXY(x, y) {
|
||||
if (ly === 0) { if (cy > 0) awake[c - CW] = 3; } else if (ly === 31 && cy < CH - 1) awake[c + CW] = 3;
|
||||
}
|
||||
function wakeHeatXY(x, y) {
|
||||
renderDirtyXY(x, y);
|
||||
const c = (y >> 5) * CW + (x >> 5);
|
||||
roofDirty[x >> 5] = 1;
|
||||
hot[c] = 6; hotLvl[c] = 2;
|
||||
|
||||
Reference in New Issue
Block a user