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

◆ bind_image_sampled()

void MayaFlux::Yantra::GpuResourceManager::bind_image_sampled ( const std::string &  key,
size_t  index,
const std::shared_ptr< Core::VKImage > &  image,
vk::Sampler  sampler,
const GpuBufferBinding spec 
)

Bind a combined image+sampler descriptor at the given slot index.

Parameters
keyPipeline unit to bind into.
indexSlot index matching the binding declaration.
imageVKImage to bind. Must be in eShaderReadOnlyOptimal layout.
samplerVulkan sampler handle from SamplerForge.
specBinding declaration. element_type must be IMAGE_SAMPLED.

Definition at line 434 of file GpuResourceManager.cpp.

439{
440 auto& unit = unit_for(key);
441 auto& foundry = Portal::Graphics::get_shader_foundry();
442
443 if (index >= unit.image_slots.size())
444 unit.image_slots.resize(index + 1);
445 unit.image_slots[index] = image;
446
447 foundry.update_descriptor_image(
448 unit.descriptor_set_ids[spec.set],
449 spec.binding,
450 image->get_image_view(),
451 sampler,
452 vk::ImageLayout::eShaderReadOnlyOptimal);
453}
IO::ImageData image
Definition Decoder.cpp:64
PipelineUnit & unit_for(const std::string &key)
MAYAFLUX_API ShaderFoundry & get_shader_foundry()
Get the global shader compiler instance.

References MayaFlux::Portal::Graphics::GpuBufferBinding::binding, MayaFlux::Portal::Graphics::get_shader_foundry(), image, MayaFlux::Portal::Graphics::GpuBufferBinding::set, and unit_for().

Referenced by MayaFlux::Yantra::GpuDispatchCore::prepare_gpu_inputs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: