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

◆ bind_image_sampled()

void MayaFlux::Yantra::GpuResourceManager::bind_image_sampled ( 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
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 304 of file GpuResourceManager.cpp.

309{
310 auto& foundry = Portal::Graphics::get_shader_foundry();
311
312 if (index >= m_image_slots.size())
313 m_image_slots.resize(index + 1);
314 m_image_slots[index] = image;
315
316 foundry.update_descriptor_image(
317 m_descriptor_set_ids[spec.set],
318 spec.binding,
319 image->get_image_view(),
320 sampler,
321 vk::ImageLayout::eShaderReadOnlyOptimal);
322}
IO::ImageData image
Definition Decoder.cpp:57
std::vector< std::shared_ptr< Core::VKImage > > m_image_slots
std::vector< Portal::Graphics::DescriptorSetID > m_descriptor_set_ids
MAYAFLUX_API ShaderFoundry & get_shader_foundry()
Get the global shader compiler instance.

References MayaFlux::Yantra::GpuBufferBinding::binding, MayaFlux::Portal::Graphics::get_shader_foundry(), image, m_descriptor_set_ids, m_image_slots, and MayaFlux::Yantra::GpuBufferBinding::set.

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

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