9#include "common/multires_conduction.hlsli"
18 [[nodiscard]] multires::MrBlock
Block(uint32_t slot)
const {
return nest->blocks[slot]; }
20 [[nodiscard]] uint32_t
Lookup(int32_t level, int64_t originX, int64_t originY, int64_t originZ)
const {
28 return nest.
cells[slot];
32 return nest.
cells[slot];
36 return nest.
cells[nest.
blocks.size() + (
size_t{page} * multires::MR_BLOCK_CELLS) + index];
41 FX_ASSERT(!multires::MrIsUniform(nest.
blocks[slot]));
53 FX_ASSERT(nest.
counters[multires::MR_COUNTER_FREE_PAGES] > 0);
60 if (fractionSlot == multires::MR_NO_FRACTION)
61 return multires::MrMakeEmptyFraction();
63 return nest.
fractions[(
size_t{fractionSlot} * multires::MR_BLOCK_CELLS) + index];
67 const multires::MrFraction& fraction) {
68 nest.
fractions[(
size_t{fractionSlot} * multires::MR_BLOCK_CELLS) + index] = fraction;
77 return nest.
blocks.size() + (
size_t{page} * multires::MR_BLOCK_CELLS) + index;
103 std::span<uint8_t> stepped, uint64_t worldSeed, uint64_t tick,
108 const multires::MrEnergyDelta& delta);
123 [[nodiscard]] multires::MrThermal
At(uint32_t slot, uint32_t index);
142 std::span<const uint8_t> frozen, std::span<const uint8_t> wantsFraction,
144 std::span<multires::MrEnergyDelta> deltas);
153 std::span<const uint8_t> frozen,
155 [[nodiscard]]
bool IsImplicitBlock(std::span<const uint8_t> implicitBlocks, uint32_t slot);
158 std::span<multires::MrEnergyDelta> deltas);
164 uint32_t wakeMark, std::span<BlockStepResult> results);
172 nest.
seeds[slot] = 1;
173 nest.
blocks[slot].busyTick = multires::MR_BUSY_POKED;
CellThermals(const MultiresNest &nest, const ReactionTableView &view)
const MultiresNest * m_nest
void Invalidate(uint32_t slot)
std::vector< multires::MrThermal > m_values
multires::MrThermal At(uint32_t slot, uint32_t index)
std::vector< uint8_t > m_known
CellThermals(const MultiresNest &nest, const ReactionTableView &view)
size_t PageCellAddress(const MultiresNest &nest, uint32_t page, uint32_t index)
void ComputeConduction(MultiresNest &nest, CellThermals &thermals, std::span< const uint8_t > stepped, std::span< const uint8_t > frozen, std::span< const uint8_t > wantsFraction, std::span< const uint8_t > implicitBlocks, const MultiresStepOptions &options, std::span< MrEnergyDelta > deltas)
void WakeAround(MultiresNest &nest, uint32_t slot, uint32_t mark)
uint32_t & FreePageAt(MultiresNest &nest, uint32_t position)
std::vector< BlockStepResult > StepBlocks(MultiresNest &nest, const ReactionTableView &view, std::span< uint8_t > stepped, uint64_t worldSeed, uint64_t tick, const MultiresStepOptions &options, uint32_t wakeMark)
multires::MrFraction FractionAt(const MultiresNest &nest, uint32_t fractionSlot, uint32_t index)
void PokeBlock(MultiresNest &nest, uint32_t slot)
std::vector< uint8_t > ExpandForStep(MultiresNest &nest, std::span< BlockStepResult > results)
std::vector< uint32_t > ExpandWantedPages(MultiresNest &nest)
std::vector< uint8_t > MarkImplicitBlocks(MultiresNest &nest, CellThermals &thermals, std::span< const uint8_t > frozen, const MultiresStepOptions &options)
void RecordWaitResults(MultiresNest &nest, std::span< const BlockStepResult > results, uint64_t tick)
std::vector< uint8_t > MarkConductionWants(MultiresNest &nest, CellThermals &thermals, std::span< const uint8_t > stepped, const MultiresStepOptions &options)
reaction::RxCell & UniformAt(MultiresNest &nest, uint32_t slot)
void ApplyEnergyDelta(MultiresNest &nest, uint32_t slot, uint32_t index, RxCell &cell, const MrEnergyDelta &delta)
bool InImplicitConduction(const MultiresNest &nest, uint32_t slot, const MultiresStepOptions &options)
reaction::RxCell & PageCellAt(MultiresNest &nest, uint32_t page, uint32_t index)
void SetFraction(MultiresNest &nest, uint32_t fractionSlot, uint32_t index, const multires::MrFraction &fraction)
uint32_t PopPage(MultiresNest &nest)
std::vector< MrEnergyDelta > StepConduction(MultiresNest &nest, const ReactionTableView &view, std::span< uint8_t > stepped, const MultiresStepOptions &options, uint32_t wakeMark, std::span< BlockStepResult > results)
void ResolvePokes(MultiresNest &nest, uint64_t tick)
reaction::RxCell & CellAt(MultiresNest &nest, uint32_t slot, uint32_t index)
bool IsImplicitBlock(std::span< const uint8_t > implicitBlocks, uint32_t slot)
void AddImplicitConduction(MultiresNest &nest, CellThermals &thermals, std::span< const uint8_t > frozen, std::span< const uint8_t > implicitBlocks, const MultiresStepOptions &options, std::span< MrEnergyDelta > deltas)
uint32_t LookupBlock(const MultiresNest &nest, int32_t level, int64_t originX, int64_t originY, int64_t originZ)
std::vector< uint8_t > seeds
std::vector< reaction::RxCell > cells
MultiresCapacity capacity
std::vector< multires::MrBlock > blocks
std::vector< multires::MrFraction > fractions
std::vector< uint32_t > freeBlocks
std::array< uint32_t, multires::MR_COUNTER_COUNT > counters
uint32_t Lookup(int32_t level, int64_t originX, int64_t originY, int64_t originZ) const
multires::MrBlock Block(uint32_t slot) const
const MultiresNest * nest