The core processing function that must be implemented by derived classes.
This method is where the actual transformation logic is implemented. It should contain the algorithmic details of how the buffer's data is transformed, analyzed, or processed. The implementation can utilize any backend capabilities available to the processor, including:
Derived classes must override this method to provide specific processing behavior.
63{
64 auto vk = std::dynamic_pointer_cast<VKBuffer>(buffer);
65 if (!vk) {
67 "GeometryWriteProcessor attached to non-VKBuffer");
68 return;
69 }
70
74
77 const size_t available = vk->get_size_bytes();
78
79 if (required > available) {
80 vk->resize(static_cast<size_t>((float)required * 1.5F), false);
83 }
84 }
85
87 std::min<size_t>(required, vk->get_size_bytes()),
89
91 return;
92 }
93 }
94
96 return;
97 }
98
101
103 return;
104 }
105
106 std::optional<Kakshya::VertexAccess> access;
110 break;
113 break;
116 break;
117 }
118
119 if (!access.has_value()) {
121 "GeometryWriteProcessor: as_vertex_access returned nullopt — unsupported variant type");
122 return;
123 }
124
126
127 vk->set_vertex_layout(access->layout);
128}
#define MF_RT_ERROR(comp, ctx,...)
std::shared_ptr< VKBuffer > m_staging
std::optional< Kakshya::DataVariant > m_pending_data
std::atomic_flag m_vertices_dirty
std::atomic_flag m_data_dirty
std::optional< Kakshya::DataVariant > m_active_data
std::optional< VertexSnapshot > m_pending_vertices
std::optional< VertexSnapshot > m_active_vertices
Kakshya::VertexAccessConfig m_config
void upload_resizing(const void *data, size_t size, const std::shared_ptr< VKBuffer > &target, const std::shared_ptr< VKBuffer > &staging, float growth_factor)
Upload size bytes to target, growing both buffers first if needed.
std::shared_ptr< VKBuffer > create_staging_buffer(size_t size)
Create staging buffer for transfers.
@ LINE
Interpret vertex data as Nodes::LineVertex.
@ MESH
Interpret vertex data as Nodes::MeshVertex.
@ POINT
Interpret vertex data as Nodes::PointVertex.
void upload_to_gpu(const void *data, size_t size, const std::shared_ptr< VKBuffer > &target, const std::shared_ptr< VKBuffer > &staging)
Upload raw data to GPU buffer (auto-detects host-visible vs device-local)
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.
std::optional< VertexAccess > as_line_vertex_access(const DataVariant &variant, const VertexAccessConfig &config)
Convert DataVariant to line-vertex-compatible bytes.
std::optional< VertexAccess > as_mesh_vertex_access(const DataVariant &variant, const VertexAccessConfig &config)
Convert DataVariant to mesh-vertex-compatible bytes.
std::optional< VertexAccess > as_point_vertex_access(const DataVariant &variant, const VertexAccessConfig &config)
Convert DataVariant to point-vertex-compatible bytes.