MayaFlux 1.0.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 526 of file GpuResourceManager.cpp.

531{
532 auto& unit = unit_for(key);
533 auto& foundry = Portal::Graphics::get_shader_foundry();
534
535 if (index >= unit.image_slots.size())
536 unit.image_slots.resize(index + 1);
537 unit.image_slots[index] = image;
538
539 foundry.update_descriptor_image(
540 unit.descriptor_set_ids[spec.set],
541 spec.binding,
542 image->get_image_view(),
543 sampler,
544 vk::ImageLayout::eShaderReadOnlyOptimal);
545}
IO::ImageData image
Definition Decoder.cpp:47
uint32_t index
Definition VKDevice.cpp:122
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, index, MayaFlux::Portal::Graphics::GpuBufferBinding::set, and unit_for().

+ Here is the call graph for this function: