177 const std::shared_ptr<Buffers::VKBuffer>& source,
178 std::span<const DrawRun> runs,
180 std::optional<Kakshya::VertexLayout> layout = std::nullopt);
189 [[nodiscard]] std::shared_ptr<Buffers::VKBuffer>
output()
const;
205 bool ensure_kernel();
215 const std::shared_ptr<Buffers::VKBuffer>& source,
226 void collect_completed();
233 void resolve_pending();
242 std::vector<std::shared_ptr<Buffers::VKBuffer>>
m_outputs;
279 std::span<const uint8_t> src,
281 std::span<const DrawRun> runs,
284 std::vector<uint8_t>& dst,
285 std::span<const uint32_t> indices = {});
Vulkan-backed buffer wrapper used in processing chains.
PrimitiveMill(MillSpec spec={}, uint32_t output_ring=2)
std::shared_ptr< Buffers::VKBuffer > output() const
The milled triangles: the ring slot the last mill() wrote.
std::unique_ptr< SlotArena > m_prefix_arena
PrimitiveMill(PrimitiveMill &&)=delete
PrimitiveMill & operator=(PrimitiveMill &&)=delete
std::vector< uint32_t > m_prefix
uint32_t mill(const std::shared_ptr< Buffers::VKBuffer > &source, std::span< const DrawRun > runs, const MillView &view, std::optional< Kakshya::VertexLayout > layout=std::nullopt)
Mill runs out of source into the owned buffer.
uint32_t milled_count() const
Vertices written by the last mill().
static uint32_t milled_vertex_count(std::span< const DrawRun > runs)
Vertices runs would mill to.
size_t m_push_constant_size
PrimitiveMill(const PrimitiveMill &)=delete
void set_spec(const MillSpec &spec)
Replace the spec.
const MillSpec & spec() const
The current shaping parameters.
uint32_t m_output_capacity
std::unique_ptr< SlotArena > m_run_arena
std::vector< std::shared_ptr< Buffers::VKBuffer > > m_outputs
Milled buffers rotated between dispatches, all at m_output_capacity.
ComputePipelineID m_pipeline
PrimitiveMill & operator=(const PrimitiveMill &)=delete
std::vector< FenceID > m_in_flight
Dispatches submitted and not yet observed complete, oldest first.
std::vector< uint32_t > m_run_words
Kakshya::VertexLayout mill_on_host(std::span< const uint8_t > src, const Kakshya::VertexLayout &layout, std::span< const DrawRun > runs, const MillSpec &spec, const MillView &view, std::vector< uint8_t > &dst, std::span< const uint32_t > indices)
Host equivalent of PrimitiveMill::mill, over raw bytes.
constexpr ShaderID INVALID_SHADER
constexpr ComputePipelineID INVALID_COMPUTE_PIPELINE
uint64_t ComputePipelineID
Complete description of vertex data layout in a buffer.
Ribbon
Plane that line ribbons and point quads are built in.
@ WorldFacing
Turned to face the viewpoint, in world space.
@ WorldPlane
Held in the XY plane, viewpoint ignored.
bool synthesize_uv
Write 0..1 UVs across each ribbon and quad instead of copying the source.
float fallback_extent
Extent used when the layout carries no scalar attribute.
float width_scale
World units of total ribbon width per unit of a vertex's scalar.
bool billboard_instances
Keep point quads and ribbons unexpanded for an instanced draw.
bool use_vertex_extent
Take ribbon width and point size from each vertex's own scalar (LineVertex::thickness,...
float point_scale
World units per unit of a vertex's own size, on point spans.
How a PrimitiveMill shapes spans.