The image must match the GPU image's format and size, which must be writable (transfer-destination usage). Retained host pixels that are marked dirty re-upload over this write.
176{
177 auto payload = std::make_shared<Kakshya::ImageData>(std::move(
image));
179 using Portal::Graphics::TextureLoom;
180
181 const auto texture = std::dynamic_pointer_cast<TextureBuffer>(vk);
183 auto& loom = TextureLoom::instance();
184 const auto format = TextureLoom::writable_format(gpu_image);
186 ||
payload->width != gpu_image->get_width() ||
payload->height != gpu_image->get_height()
187 || !
payload->is_consistent()) {
189 "DataWriteProcessor write_texture_pixels needs a TextureBuffer with a writable GPU image "
190 "and an image of its format and size");
191 return;
192 }
193
195 if (!self.m_write_image_staging || self.m_write_image_staging->get_size_bytes() <
size) {
197 }
198 if (self.m_write_image_staging) {
199 loom.upload_data(gpu_image,
payload->data(),
size, self.m_write_image_staging);
200 } else {
201 loom.upload_data(gpu_image,
payload->data(),
size);
202 }
203 });
204}
#define MF_RT_ERROR(comp, ctx,...)
void enqueue_write(WriteFn fn)
std::shared_ptr< VKBuffer > create_image_staging_buffer(size_t size)
Allocate a persistent host-visible staging buffer sized for repeated streaming uploads to an image of...
std::shared_ptr< Core::VKImage > resolve_gpu_image(const T &buffer)
Resolve the GPU-resident image from any GpuImageSource buffer.
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.