MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ update_image()

void MayaFlux::Core::VKDescriptorManager::update_image ( vk::Device  device,
vk::DescriptorSet  set,
uint32_t  binding,
vk::ImageView  image_view,
vk::Sampler  sampler = nullptr,
vk::ImageLayout  layout = vk::ImageLayout::eGeneral 
)

Update descriptor set with image binding.

Parameters
deviceLogical device
setDescriptor set to update
bindingBinding index
image_viewImage view to bind
samplerSampler (for combined image samplers, null for storage images)
layoutImage layout (typically eGeneral or eShaderReadOnlyOptimal)

Binds an image to the specified binding point in the descriptor set. For storage images: sampler = null, layout = eGeneral For sampled images: provide sampler, layout = eShaderReadOnlyOptimal

Definition at line 358 of file VKDescriptorManager.cpp.

365{
366 if (!set) {
368 "Cannot update null descriptor set");
369 return;
370 }
371
372 if (!image_view) {
374 "Cannot bind null image view to descriptor set");
375 return;
376 }
377
378 vk::DescriptorImageInfo image_info;
379 image_info.imageView = image_view;
380 image_info.sampler = sampler;
381 image_info.imageLayout = layout;
382
383 vk::WriteDescriptorSet write;
384 write.dstSet = set;
385 write.dstBinding = binding;
386 write.dstArrayElement = 0;
387 write.descriptorCount = 1;
388 write.descriptorType = sampler ? vk::DescriptorType::eCombinedImageSampler : vk::DescriptorType::eStorageImage;
389 write.pImageInfo = &image_info;
390
391 device.updateDescriptorSets(1, &write, 0, nullptr);
392
394 "Updated descriptor set binding {} with image (layout: {})",
395 binding, vk::to_string(layout));
396}
#define MF_ERROR(comp, ctx,...)
#define MF_DEBUG(comp, ctx,...)
@ GraphicsBackend
Graphics/visual rendering backend (Vulkan, OpenGL)
@ Core
Core engine, backend, subsystems.

References MayaFlux::Journal::Core, MayaFlux::Journal::GraphicsBackend, MF_DEBUG, and MF_ERROR.