@aardworx/wombat.rendering 0.18.1 → 0.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/core/renderObject.d.ts +16 -0
  2. package/dist/core/renderObject.d.ts.map +1 -1
  3. package/dist/runtime/heapAdapter.d.ts.map +1 -1
  4. package/dist/runtime/heapAdapter.js +24 -0
  5. package/dist/runtime/heapAdapter.js.map +1 -1
  6. package/dist/runtime/heapScene/freelist.d.ts +5 -0
  7. package/dist/runtime/heapScene/freelist.d.ts.map +1 -1
  8. package/dist/runtime/heapScene/freelist.js +28 -0
  9. package/dist/runtime/heapScene/freelist.js.map +1 -1
  10. package/dist/runtime/heapScene/pools.d.ts +19 -0
  11. package/dist/runtime/heapScene/pools.d.ts.map +1 -1
  12. package/dist/runtime/heapScene/pools.js +115 -12
  13. package/dist/runtime/heapScene/pools.js.map +1 -1
  14. package/dist/runtime/heapScene.d.ts +21 -1
  15. package/dist/runtime/heapScene.d.ts.map +1 -1
  16. package/dist/runtime/heapScene.js +237 -10
  17. package/dist/runtime/heapScene.js.map +1 -1
  18. package/dist/runtime/hybridScene.d.ts +8 -0
  19. package/dist/runtime/hybridScene.d.ts.map +1 -1
  20. package/dist/runtime/hybridScene.js +15 -0
  21. package/dist/runtime/hybridScene.js.map +1 -1
  22. package/dist/runtime/textureAtlas/atlasPool.d.ts +12 -0
  23. package/dist/runtime/textureAtlas/atlasPool.d.ts.map +1 -1
  24. package/dist/runtime/textureAtlas/atlasPool.js +20 -0
  25. package/dist/runtime/textureAtlas/atlasPool.js.map +1 -1
  26. package/package.json +2 -2
  27. package/src/core/renderObject.ts +16 -0
  28. package/src/runtime/heapAdapter.ts +24 -0
  29. package/src/runtime/heapScene/freelist.ts +35 -0
  30. package/src/runtime/heapScene/pools.ts +131 -12
  31. package/src/runtime/heapScene.ts +257 -11
  32. package/src/runtime/hybridScene.ts +23 -0
  33. package/src/runtime/textureAtlas/atlasPool.ts +19 -0
@@ -611,6 +611,25 @@ export class AtlasPool {
611
611
  this.lru.set(e.ref, e);
612
612
  }
613
613
 
614
+ /**
615
+ * Bump refcount on an entry that's already live (used by the heap
616
+ * path when a cached HeapDrawSpec is re-introduced: the spec already
617
+ * carries `poolRef` from the original acquire, but every add/remove
618
+ * cycle fires the release closure once — without a matching incRef
619
+ * the refcount underflows and the entry gets actuallyFree'd while
620
+ * live drawHeaders still reference it).
621
+ *
622
+ * Returns `true` if the bump was applied; `false` if the entry has
623
+ * been evicted in the meantime (caller must fall back to re-acquire).
624
+ */
625
+ incRef(ref: number): boolean {
626
+ const e = this.entriesByRef.get(ref);
627
+ if (e === undefined) return false;
628
+ if (e.refcount === 0) this.lru.delete(e.ref);
629
+ e.refcount++;
630
+ return true;
631
+ }
632
+
614
633
  /**
615
634
  * Drop an LRU entry for real: remove its packer slot, drop the entry
616
635
  * from every lookup map. Caller must guarantee `refcount === 0`.