32 void read_bytes(
size_t byte_count = 0);
40 void read_buffer(std::shared_ptr<VKBuffer> source,
size_t byte_count = 0);
48 void read_field(std::string
name);
56 void read_back_buffer(
size_t index,
size_t byte_count);
74 void read_host_pixels();
81 void read_texture_pixels();
84 [[nodiscard]]
bool has_result() const noexcept;
87 [[nodiscard]]
bool is_pending() const noexcept;
97 void set_skip_while_pending(
bool skip) noexcept { m_skip_while_pending = skip; }
107 [[nodiscard]] std::optional<Kakshya::DataVariant> resolve_bytes();
118 [[nodiscard]] std::optional<std::vector<Kakshya::DataVariant>> resolve_vertices();
126 [[nodiscard]] std::optional<Kakshya::MeshData> resolve_mesh();
134 [[nodiscard]] std::optional<Kakshya::ImageData> resolve_pixels();
136 [[nodiscard]]
bool is_compatible_with(
const std::shared_ptr<Buffer>&
buffer)
const override;
139 void on_attach(
const std::shared_ptr<Buffer>&
buffer)
override;
140 void on_detach(
const std::shared_ptr<Buffer>&
buffer)
override;
141 void processing_function(
const std::shared_ptr<Buffer>&
buffer)
override;
146 enum class ReadKind { Bytes, Vertices, Mesh, Pixels };
152 static bool submit_read(
154 std::shared_ptr<VKBuffer>& staging,
155 size_t available_bytes,
160 std::unique_ptr<PendingRead> collect_result(
ReadKind kind);
164 std::atomic<bool> m_result_occupied {
false };
165 std::atomic<bool> m_result_ready {
false };
168 bool m_skip_while_pending {};