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

◆ build() [3/5]

std::shared_ptr< Buffers::ComputeMeshBuffer > MayaFlux::Mint::Impl::build ( const StructureConfig::Isosurface &  config) const
inline

Definition at line 290 of file Mint.cpp.

292 {
293 if (!has_target(config.render)) {
294 return nullptr;
295 }
296
297 const bool has_buffer = config.buffer != nullptr;
298 const bool has_config = config.config.has_value();
299 if (static_cast<unsigned int>(has_buffer)
300 + static_cast<unsigned int>(has_config)
301 != 1) {
303 "mint: Isosurface requires exactly one buffer or config");
304 return nullptr;
305 }
306
307 auto buffer = has_buffer
308 ? config.buffer
309 : std::make_shared<Buffers::ComputeMeshBuffer>(*config.config);
310
311 StructureConfig::RenderConfig render = config.render;
312 if (!config.textures.empty() && config.textures.front()) {
313 const std::string binding = render.default_texture_binding.empty()
314 ? "diffuseTex"
315 : render.default_texture_binding;
316 buffer->set_texture(config.textures.front(), binding);
317 render.default_texture_binding = binding;
318 }
319 add_extra_textures(render, config.textures, 1);
321 buffer->setup_rendering(render);
322 return buffer;
323 }
#define MF_ERROR(comp, ctx,...)
std::shared_ptr< NetworkGeometryBuffer > buffer
@ Init
Engine/subsystem initialization.
@ API
MayaFlux/API Wrapper and convenience functions.
void register_graphics_buffer(const std::shared_ptr< Buffers::VKBuffer > &buffer, Buffers::ProcessingToken token)
Registers a VKBuffer with the default engine's buffer manager.
Definition Graph.cpp:250
Buffers::VKBuffer::RenderConfig RenderConfig
Render target and pipeline overrides.

References MayaFlux::Journal::API, MayaFlux::StructureConfig::Isosurface::buffer, buffer, MayaFlux::StructureConfig::Isosurface::config, MayaFlux::Portal::Graphics::RenderConfig::default_texture_binding, MayaFlux::Journal::Init, MF_ERROR, MayaFlux::register_graphics_buffer(), MayaFlux::StructureConfig::Isosurface::render, and MayaFlux::StructureConfig::Isosurface::textures.

+ Here is the call graph for this function: