From 868b0320a477b16338cab9eb6a743e07865dbe42 Mon Sep 17 00:00:00 2001 From: Raph Levien Date: Fri, 15 May 2020 16:51:37 -0700 Subject: [PATCH] Render strokes As of this point, it mostly renders stroke outlines for tiger. Some dropouts are because the scan in the elements pass doesn't do lookback yet, others are probably a bug. --- piet-gpu/shader/coarse.comp | 53 ++++++++++++++++++++++++++++++---- piet-gpu/shader/coarse.spv | Bin 21540 -> 28508 bytes piet-gpu/shader/elements.comp | 4 +-- piet-gpu/shader/elements.spv | Bin 35448 -> 35448 bytes piet-gpu/src/pico_svg.rs | 3 +- 5 files changed, 52 insertions(+), 8 deletions(-) diff --git a/piet-gpu/shader/coarse.comp b/piet-gpu/shader/coarse.comp index da25ce4..f94dc6b 100644 --- a/piet-gpu/shader/coarse.comp +++ b/piet-gpu/shader/coarse.comp @@ -57,6 +57,26 @@ void alloc_cmd(inout CmdRef cmd_ref, inout uint cmd_limit) { } } +// Ensure that there is space to encode a segment. +void alloc_chunk(inout uint chunk_n_segs, inout SegChunkRef seg_chunk_ref, + inout SegChunkRef first_seg_chunk, inout uint seg_limit) +{ + // TODO: Reduce divergence of atomic alloc? + if (chunk_n_segs == 0) { + if (seg_chunk_ref.offset + 40 > seg_limit) { + seg_chunk_ref.offset = atomicAdd(alloc, SEG_CHUNK_ALLOC); + seg_limit = seg_chunk_ref.offset + SEG_CHUNK_ALLOC - Segment_size; + } + first_seg_chunk = seg_chunk_ref; + } else if (seg_chunk_ref.offset + SegChunk_size + Segment_size * chunk_n_segs > seg_limit) { + uint new_chunk_ref = atomicAdd(alloc, SEG_CHUNK_ALLOC); + seg_limit = new_chunk_ref + SEG_CHUNK_ALLOC - Segment_size; + SegChunk_write(seg_chunk_ref, SegChunk(chunk_n_segs, SegChunkRef(new_chunk_ref))); + seg_chunk_ref.offset = new_chunk_ref; + chunk_n_segs = 0; + } +} + void main() { // Could use either linear or 2d layouts for both dispatch and // invocations within the workgroup. We'll use variables to abstract. @@ -71,6 +91,12 @@ void main() { CmdRef cmd_ref = CmdRef(tile_ix * PTCL_INITIAL_ALLOC); uint cmd_limit = cmd_ref.offset + PTCL_INITIAL_ALLOC - 2 * Cmd_size; + // Allocation and management of segment output + SegChunkRef seg_chunk_ref = SegChunkRef(0); + SegChunkRef first_seg_chunk = SegChunkRef(0); + uint seg_limit = 0; + uint chunk_n_segs = 0; + uint wr_ix = 0; uint rd_ix = 0; uint first_el; @@ -216,13 +242,30 @@ void main() { tag = Annotated_tag(ref); switch (tag) { + case Annotated_Line: + AnnoLineSeg line = Annotated_Line_read(ref); + Segment seg = Segment(line.p0, line.p1); + alloc_chunk(chunk_n_segs, seg_chunk_ref, first_seg_chunk, seg_limit); + Segment_write(SegmentRef(seg_chunk_ref.offset + SegChunk_size + Segment_size * chunk_n_segs), seg); + chunk_n_segs++; + break; case Annotated_Fill: + chunk_n_segs = 0; + break; case Annotated_Stroke: - // Note: we take advantage of the fact that fills and strokes - // have compatible layout. - AnnoFill fill = Annotated_Fill_read(ref); - alloc_cmd(cmd_ref, cmd_limit); - Cmd_Solid_write(cmd_ref, CmdSolid(fill.rgba_color)); + if (chunk_n_segs > 0) { + AnnoStroke stroke = Annotated_Stroke_read(ref); + SegChunk_write(seg_chunk_ref, SegChunk(chunk_n_segs, SegChunkRef(0))); + seg_chunk_ref.offset += SegChunk_size + Segment_size * chunk_n_segs; + CmdStroke cmd_stroke; + cmd_stroke.seg_ref = first_seg_chunk.offset; + cmd_stroke.half_width = 0.5 * stroke.linewidth; + cmd_stroke.rgba_color = stroke.rgba_color; + alloc_cmd(cmd_ref, cmd_limit); + Cmd_Stroke_write(cmd_ref, cmd_stroke); + cmd_ref.offset += Cmd_size; + chunk_n_segs = 0; + } break; } diff --git a/piet-gpu/shader/coarse.spv b/piet-gpu/shader/coarse.spv index ed005fcf53c3c20dd1d3a805994839aeea4d576a..92ecbaeaacb77cb54ebebc5636530de4b14dbc82 100644 GIT binary patch literal 28508 zcmai+2b^A2wZ$))0z&A$nh-jK-fJL0D3OF-Wt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d2X=ZDw!iC}Bzy0j&SPOzHyd+U4(SWREoEZ27uwy9v(q|NoqbAG0Q z_19)C$;FSxaL#A>a%FZu(oRc L&X~H{XMg-3Y(pb` diff --git a/piet-gpu/shader/elements.comp b/piet-gpu/shader/elements.comp index c31dd2e..94084c8 100644 --- a/piet-gpu/shader/elements.comp +++ b/piet-gpu/shader/elements.comp @@ -71,7 +71,7 @@ State map_element(ElementRef ref) { c.bbox = vec4(0.0, 0.0, 0.0, 0.0); c.mat = vec4(1.0, 0.0, 0.0, 1.0); c.translate = vec2(0.0, 0.0); - c.linewidth = 0.0; + c.linewidth = 1.0; // TODO should be 0.0 c.flags = 0; switch (tag) { case Element_Line: @@ -169,7 +169,7 @@ void main() { exclusive.bbox = vec4(0.0, 0.0, 0.0, 0.0); exclusive.mat = vec4(1.0, 0.0, 0.0, 1.0); exclusive.translate = vec2(0.0, 0.0); - exclusive.linewidth = 0.0; + exclusive.linewidth = 1.0; //TODO should be 0.0 exclusive.flags = 0; // TODO: do decoupled look-back diff --git a/piet-gpu/shader/elements.spv b/piet-gpu/shader/elements.spv index afb63b582b1547a2ecc25bf900952a97b01489fb..f8581291afe66b3857e17afb0579e5de40d76d18 100644 GIT binary patch delta 23 dcmew{h3Ur>rVTdwjORDo>OT(vQmPHXTmXR|3F80& delta 23 dcmew{h3Ur>rVTdwjAu66>OT(vQmPHXTmXRP3Ecny diff --git a/piet-gpu/src/pico_svg.rs b/piet-gpu/src/pico_svg.rs index 4ddf94b..a630f70 100644 --- a/piet-gpu/src/pico_svg.rs +++ b/piet-gpu/src/pico_svg.rs @@ -61,7 +61,8 @@ impl PicoSvg { for item in &self.items { match item { Item::Fill(fill_item) => { - rc.fill(&fill_item.path, &fill_item.color); + //rc.fill(&fill_item.path, &fill_item.color); + rc.stroke(&fill_item.path, &fill_item.color, 1.0); } Item::Stroke(stroke_item) => { rc.stroke(&stroke_item.path, &stroke_item.color, stroke_item.width);