initial chunk render caching

This commit is contained in:
2024-09-01 23:34:32 +10:00
parent da26773221
commit 5f372a9398
9 changed files with 220 additions and 10 deletions

View File

@ -65,7 +65,7 @@ public struct Chunk: Hashable {
public func forEach(_ body: @escaping (Block, SIMD3<Int>) throws -> Void) rethrows {
for i in 0..<Self.blockCount {
try body(blocks[i], self.origin &+ SIMD3(
try body(blocks[i], SIMD3(
x: i & Self.mask,
y: (i &>> Self.shift) & Self.mask,
z: (i &>> (Self.shift + Self.shift)) & Self.mask))