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

◆ SDFMeshProcessor() [2/2]

MayaFlux::Buffers::SDFMeshProcessor::SDFMeshProcessor ( std::shared_ptr< VKBuffer grid_buf,
std::shared_ptr< VKBuffer counter_buf,
const glm::vec3 &  bounds_min,
const glm::vec3 &  bounds_max,
uint32_t  res_x,
uint32_t  res_y,
uint32_t  res_z,
float  iso_level 
)

Construct in GPU-field mode with externally owned buffers.

grid_buf and counter_buf are owned by SdfPrepProcessor and pre-zeroed before this processor runs. evaluate_grid() is never called in this mode.

Parameters
grid_bufCorner grid buffer written by SdfFieldProcessor.
counter_bufAtomic vertex counter buffer, zeroed by SdfPrepProcessor.
bounds_minWorld-space minimum corner.
bounds_maxWorld-space maximum corner.
res_xCell count along X.
res_yCell count along Y.
res_zCell count along Z.
iso_levelIsosurface threshold.

Definition at line 48 of file SDFMeshProcessor.cpp.

57 : ComputeProcessor("mc_emit.comp.spv", 64)
58 , m_bounds_min(bounds_min)
59 , m_bounds_max(bounds_max)
60 , m_res_x(std::max(res_x, 1U))
61 , m_res_y(std::max(res_y, 1U))
62 , m_res_z(std::max(res_z, 1U))
63 , m_iso_level(iso_level)
64 , m_grid_buf(std::move(grid_buf))
65 , m_counter_buf(std::move(counter_buf))
66 , m_owns_buffers(false)
67{
68 m_config.push_constant_size = sizeof(McPC);
69
70 m_config.bindings["sdf_grid"] = ShaderBinding(0, 0, vk::DescriptorType::eStorageBuffer);
71 m_config.bindings["edge_table"] = ShaderBinding(0, 1, vk::DescriptorType::eStorageBuffer);
72 m_config.bindings["tri_table"] = ShaderBinding(0, 2, vk::DescriptorType::eStorageBuffer);
73 m_config.bindings["vertices"] = ShaderBinding(0, 3, vk::DescriptorType::eStorageBuffer);
74 m_config.bindings["counter"] = ShaderBinding(0, 4, vk::DescriptorType::eStorageBuffer);
75
77
79}
ComputeProcessor(const std::string &shader_path, uint32_t workgroup_x=256)
Construct processor with shader path.
void set_dispatch_mode(ShaderDispatchConfig::DispatchMode mode)
Set dispatch mode.
std::shared_ptr< VKBuffer > m_grid_buf
bool m_owns_buffers
false in GPU-field mode; buffers owned by SdfPrepProcessor.
std::shared_ptr< VKBuffer > m_counter_buf
std::unordered_map< std::string, ShaderBinding > bindings

References MayaFlux::Buffers::ShaderConfig::bindings, MayaFlux::Buffers::ShaderProcessor::m_config, MayaFlux::Buffers::ShaderDispatchConfig::MANUAL, MayaFlux::Buffers::ShaderConfig::push_constant_size, rebuild_lookup_buffers(), and MayaFlux::Buffers::ComputeProcessor::set_dispatch_mode().

+ Here is the call graph for this function: