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

◆ update_combined_image_sampler()

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

Update descriptor set with combined image+sampler.

Parameters
deviceLogical device
setDescriptor set to update
bindingBinding index
image_viewImage view to bind
samplerSampler to bind
layoutImage layout (typically eShaderReadOnlyOptimal)

This is the standard way to bind textures in graphics shaders.

Definition at line 435 of file VKDescriptorManager.cpp.

442{
443 if (!set) {
445 "Cannot update null descriptor set");
446 return;
447 }
448
449 if (!image_view || !sampler) {
451 "Cannot bind null image view or sampler");
452 return;
453 }
454
455 vk::DescriptorImageInfo image_info;
456 image_info.imageView = image_view;
457 image_info.sampler = sampler;
458 image_info.imageLayout = layout;
459
460 vk::WriteDescriptorSet write;
461 write.dstSet = set;
462 write.dstBinding = binding;
463 write.dstArrayElement = 0;
464 write.descriptorCount = 1;
465 write.descriptorType = vk::DescriptorType::eCombinedImageSampler;
466 write.pImageInfo = &image_info;
467
468 device.updateDescriptorSets(1, &write, 0, nullptr);
469
471 "Updated descriptor set binding {} with combined image sampler", binding);
472}
#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.