161 [[nodiscard]]
static uint32_t milled_vertex_count(std::span<const DrawRun> runs);
193 const std::shared_ptr<Buffers::VKBuffer>& source,
194 std::span<const DrawRun> runs,
204 [[nodiscard]] std::shared_ptr<Buffers::VKBuffer>
output()
const;
219 bool ensure_kernel();
230 const std::shared_ptr<Buffers::VKBuffer>& source,
243 void write_descriptors(
const std::shared_ptr<Buffers::VKBuffer>& source);
251 void resolve_pending();
258 size_t m_push_constant_size { 0 };
261 std::vector<std::shared_ptr<Buffers::VKBuffer>>
m_outputs;
270 uint32_t m_output_ring { 2 };
271 size_t m_output_slot { 0 };
274 size_t m_bound_slot { 0 };
275 bool m_descriptors_written {
false };
277 uint32_t m_milled_count { 0 };
278 uint32_t m_output_capacity { 0 };
300 std::span<const uint8_t>
src,
302 std::span<const DrawRun> runs,
303 const MillSpec& spec,
304 const MillView& view,
305 std::vector<uint8_t>&
dst);
std::shared_ptr< Core::VKImage > output
PrimitiveMill(PrimitiveMill &&)=delete
PrimitiveMill & operator=(PrimitiveMill &&)=delete
std::vector< uint32_t > m_prefix
uint32_t milled_count() const
Vertices written by the last mill().
std::weak_ptr< Buffers::VKBuffer > m_bound_source
Source the descriptor set currently points at, for invalidation.
PrimitiveMill(const PrimitiveMill &)=delete
std::shared_ptr< Buffers::VKBuffer > m_prefix_buf
std::shared_ptr< Buffers::VKBuffer > m_run_buf
void set_spec(const MillSpec &spec)
Replace the spec.
const MillSpec & spec() const
std::vector< DescriptorSetID > m_sets
std::vector< std::shared_ptr< Buffers::VKBuffer > > m_outputs
Milled buffers rotated between dispatches, all at m_output_capacity.
PrimitiveMill & operator=(const PrimitiveMill &)=delete
Mills spans of mixed primitive topology into one TRIANGLE_LIST vertex buffer on the GPU.
uint64_t ComputePipelineID
constexpr ShaderID INVALID_SHADER
constexpr FenceID INVALID_FENCE
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)
Host equivalent of PrimitiveMill::mill, over raw bytes.
constexpr ComputePipelineID INVALID_COMPUTE_PIPELINE
Complete description of vertex data layout in a buffer.
Ribbon
Plane a line span's ribbon and a point span's quad 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 across each ribbon and quad rather than copying 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 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.