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

◆ set_texture()

void MayaFlux::Buffers::GeometryBuffer::set_texture ( std::shared_ptr< Core::VKImage image,
std::string  binding = "diffuseTex" 
)

Supply a diffuse texture, bound on the next graphics tick.

Follows the FormaBuffer model: if the bindings processor is not yet created (setup_processors not called), the texture is queued and applied in setup_processors. Otherwise it is forwarded to the processor, which binds it on the next cycle. The descriptor slot is declared in setup_rendering; call set_texture before setup_rendering, or pass a default_texture_binding in the RenderConfig, so the slot exists.

Parameters
imageGPU image. nullptr clears the binding.
bindingDescriptor name (default: "diffuseTex").

Definition at line 150 of file GeometryBuffer.cpp.

151{
153 m_diffuse_binding = binding;
154
156 m_pending_textures.emplace_back(std::move(image), std::move(binding));
157 return;
158 }
159 m_bindings_processor->set_texture(std::move(image), std::move(binding));
160}
IO::ImageData image
Definition Decoder.cpp:57
std::vector< std::pair< std::shared_ptr< Core::VKImage >, std::string > > m_pending_textures
std::shared_ptr< Core::VKImage > m_diffuse_texture
std::shared_ptr< GeometryBindingsProcessor > m_bindings_processor

References image, m_bindings_processor, m_diffuse_binding, m_diffuse_texture, and m_pending_textures.

Referenced by setup_rendering().

+ Here is the caller graph for this function: