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 270 of file GpuResourceManager.cpp.

275{
276 auto& foundry = Portal::Graphics::get_shader_foundry();
277
278 if (index >= m_image_slots.size())
279 m_image_slots.resize(index + 1);
280 m_image_slots[index] = image;
281
282 foundry.update_descriptor_image(
283 m_descriptor_set_ids[spec.set],
284 spec.binding,
285 image->get_image_view(),
286 sampler,
287 vk::ImageLayout::eShaderReadOnlyOptimal);
288}
IO::ImageData image
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: