9class RelaxationStepProcessor;
10class RelaxationEmitProcessor;
60 using ShaderSource = std::variant<std::string, Portal::Graphics::ShaderSpec>;
81 size_t cell_stride_bytes,
125 return static_cast<size_t>(m_width) * m_height * m_cell_stride_bytes;
139 void seed_state(
const void* data,
size_t size);
145 [[nodiscard]] uint32_t
front_index()
const {
return m_front_is_a ? 0 : 1; }
151 [[nodiscard]] uint32_t
back_index()
const {
return m_front_is_a ? 1 : 0; }
171 [[nodiscard]] std::shared_ptr<Vruta::BroadcastSource<std::vector<uint8_t>>>
snapshot_source()
const
173 return m_snapshot_source;
177 [[nodiscard]] std::shared_ptr<RelaxationStepProcessor>
step_processor()
const {
return m_step_processor; }
180 [[nodiscard]] std::shared_ptr<RelaxationEmitProcessor>
emit_processor()
const {
return m_emit_processor; }
188 return m_snapshot_requested.exchange(
false, std::memory_order_acq_rel);
194 std::shared_ptr<Vruta::BroadcastSource<std::vector<uint8_t>>> m_snapshot_source {
195 std::make_shared<Vruta::BroadcastSource<std::vector<uint8_t>>>()
205 bool m_front_is_a {
true };
206 std::atomic<bool> m_snapshot_requested {
false };
ComputeProcessor that reads the current front generation's raw state buffer from a RelaxationGridBuff...
~RelaxationGridBuffer() override=default
Destructor.
std::shared_ptr< RelaxationEmitProcessor > m_emit_processor
Emit stage, retained for parameter access.
ShaderSource m_emit_source
Either a path to a hand-written emit shader or a generated ShaderSpec.
bool consume_snapshot_request()
std::shared_ptr< RelaxationEmitProcessor > emit_processor() const
The attached emit-stage processor, valid after setup_processors().
uint32_t get_cell_count() const
Total cell count, width * height.
uint32_t get_grid_width() const
Grid width in cells.
std::shared_ptr< RelaxationStepProcessor > m_step_processor
Rule stage, retained for parameter access.
size_t get_state_bytes() const
Total byte size of one generation's state buffer.
size_t m_cell_stride_bytes
Size in bytes of one cell's state, fixed at construction.
std::shared_ptr< RelaxationStepProcessor > step_processor() const
The attached rule-stage processor, valid after setup_processors().
uint32_t m_width
Grid width in cells.
ShaderSource m_rule_source
Either a path to a hand-written rule shader or a generated ShaderSpec.
std::variant< std::string, Portal::Graphics::ShaderSpec > ShaderSource
Either a shader file path or a generated ShaderSpec, resolved at construction time by setup_processor...
std::shared_ptr< Vruta::BroadcastSource< std::vector< uint8_t > > > snapshot_source() const
BroadcastSource of completed generation snapshots.
uint32_t back_index() const
Index into m_resources.back_buffers currently serving as the write target for the next rule dispatch.
uint32_t front_index() const
Index into m_resources.back_buffers currently holding the most recently completed generation's state.
uint32_t get_grid_height() const
Grid height in cells.
void request_snapshot()
Request a snapshot of the next completed generation.
uint32_t m_height
Grid height in cells.
GPU-resident, double-buffered SSBO state for synchronous local-rule systems evaluated over a fixed 2D...
ComputeProcessor specialization driving one generation step of a RelaxationGridBuffer per dispatch.
Vulkan-backed buffer wrapper used in processing chains.
ProcessingToken
Bitfield enum defining processing characteristics and backend requirements for buffer operations.
Unified rendering configuration for graphics buffers.