From 19f4d9fa95fb1867687443f581c04c10083a8985 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Tue, 1 Dec 2020 18:06:09 +0100 Subject: [PATCH] change tile segment representation to (origin, vector) Eliminates the precision loss of the subtraction in the sign(end.x - start.x) expression in kernel4. That's important for the next change that avoids inconsistent line intersections in path_coarse. Updates #23 Signed-off-by: Elias Naur --- piet-gpu-types/src/tile.rs | 4 ++-- piet-gpu/shader/kernel4.comp | 10 +++++----- piet-gpu/shader/kernel4.spv | Bin 31784 -> 31680 bytes piet-gpu/shader/path_coarse.comp | 10 ++++++---- piet-gpu/shader/path_coarse.spv | Bin 28916 -> 29056 bytes piet-gpu/shader/tile.h | 16 ++++++++-------- 6 files changed, 21 insertions(+), 19 deletions(-) diff --git a/piet-gpu-types/src/tile.rs b/piet-gpu-types/src/tile.rs index 18318e3..38ee93b 100644 --- a/piet-gpu-types/src/tile.rs +++ b/piet-gpu-types/src/tile.rs @@ -13,8 +13,8 @@ piet_gpu! { } // Segments within a tile are represented as a linked list. struct TileSeg { - start: [f32; 2], - end: [f32; 2], + origin: [f32; 2], + vector: [f32; 2], y_edge: f32, next: Ref, } diff --git a/piet-gpu/shader/kernel4.comp b/piet-gpu/shader/kernel4.comp index 72ab396..bf9ec44 100644 --- a/piet-gpu/shader/kernel4.comp +++ b/piet-gpu/shader/kernel4.comp @@ -65,8 +65,8 @@ float[CHUNK] computeArea(vec2 xy, int backdrop, uint tile_ref) { TileSeg seg = TileSeg_read(tile_seg_ref); for (uint k = 0; k < CHUNK; k++) { vec2 my_xy = vec2(xy.x, xy.y + float(k * CHUNK_DY)); - vec2 start = seg.start - my_xy; - vec2 end = seg.end - my_xy; + vec2 start = seg.origin - my_xy; + vec2 end = start + seg.vector; vec2 window = clamp(vec2(start.y, end.y), 0.0, 1.0); if (window.x != window.y) { vec2 t = (window - start.y) / (end.y - start.y); @@ -79,7 +79,7 @@ float[CHUNK] computeArea(vec2 xy, int backdrop, uint tile_ref) { float a = (b + 0.5 * (d * d - c * c) - xmin) / (xmax - xmin); area[k] += a * (window.x - window.y); } - area[k] += sign(end.x - start.x) * clamp(my_xy.y - seg.y_edge + 1.0, 0.0, 1.0); + area[k] += sign(seg.vector.x) * clamp(my_xy.y - seg.y_edge + 1.0, 0.0, 1.0); } tile_seg_ref = seg.next; } while (tile_seg_ref.offset != 0); @@ -131,9 +131,9 @@ void main() { TileSegRef tile_seg_ref = TileSegRef(stroke.tile_ref); do { TileSeg seg = TileSeg_read(tile_seg_ref); - vec2 line_vec = seg.end - seg.start; + vec2 line_vec = seg.vector; for (uint k = 0; k < CHUNK; k++) { - vec2 dpos = xy + vec2(0.5, 0.5) - seg.start; + vec2 dpos = xy + vec2(0.5, 0.5) - seg.origin; dpos.y += float(k * CHUNK_DY); float t = clamp(dot(line_vec, dpos) / dot(line_vec, line_vec), 0.0, 1.0); df[k] = min(df[k], length(line_vec * t - dpos)); diff --git a/piet-gpu/shader/kernel4.spv b/piet-gpu/shader/kernel4.spv index 808d7077de31636dd101bade005c49aba8df1c5a..fffdc4a97ab267eb9762f51ebb82bfe4503ccb49 100644 GIT binary patch literal 31680 zcmai+2b^71`Lz$sOb8_O-V&+Qu6xU6d9x#PxdkAGXWxH%}(+FdWa4jSn1JFcu<-J`618Tg;6I@l@epqF`C z3mzPRVwzRE$J(m3iEGw9yjriwaZq1x&$JYeZvEOlhU#CW8UxR`gE46OYxC&roqcR4 zeFwX8Ed77@|JPy%vkg{ky&DqWtan(oaWmKMvx-6;SKVW%&W>tRIOEp7&HB_lhU#0q z+8jRQ*IL-nP~{qqBc@qXN3~@$zEM1dH`YPTqpW8)FN}^?hLbB6i=-Ime|Yb&sK%hE+SlGmgI6T~Bq7nYHGAn*c9;|7%_KfMsnv6PLA` z*vzrl+?kC_q%oG7$537E)oyUc(y!qo_n6gvBEwFn!V%RZc1(72KmG5pMjVf(`kaicW|nd8%l}Vo?_lhR>i9a=jr4zn zHOBOz(%c6f6_5AoV4j}`b`s@SnXW2f#O}m^L_zZ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ysAH1#`KYwr~uVB^$%Mt0JBc;C==3{A~_D9-wJfgL|%%>*~E z-z+rs%=uWbnl0zL8*DCZ$@LL%^Ew}grXHUjaPxSx(bUcDew_n0PCYgBg4J#Q+aa#| zT(EU$bFFf{hr&r4u zXM)wr`JM$=kI&haPg%z~XzKZQPR<2e$NDtmwa0c|Vbjm+Dd+zJu=ew5*4Iz3ma#7a zH`n(uH1+s=yz(jQ`vjVLYPc9|ePd|GYj?a0>9u*yxF0VCt0nG};LJ;#wHtQ{y|%<% z4pvLtr@$FcoA(yuE~D3$xGTZVIdPu`Cr(@9t^jLG+|^*m3%?euPxxmlp5L9m4z7=S ze69yuPxuWLPt1*QebjTl7J<#BEq*tFuc2w{udeIQf~`?o@_$Y{ExA4q)=xb?UjV!Q z;WvZJm@mThQP00CbPL#A+FawS=+(^OH^HsoaTWI*e+jHl_Rp8W2hhrE;45(T_hbvjcq^LU*jbMs!qqe8Jz(S1`>Q?nBe42mwA>Hx1zU$dGuQ6*qdn*2$6#yK zFXR6N?7F&M8UH@8ddB)GSk3sv-49Nj=R>Za=VJ$Y&xd`^$Irl?kGyC99ITf2Y;9`B zZ%1$ZczVb4d+PzP>*UW8%<22_FW~BqzX`qE__6fH+Z*rq%!6QkE(E8hhv4e@_nUqR zR&$T|ej(qSwk6Gc_Kx*1y*`fhNM*D4{rXq*zovO;f2^|GXWYlZ=D3a8e8+hLtkzGA z> 2; uint old = atomicExchange(tile[tile_el], tile_offset); - tile_seg.start = p0; - tile_seg.end = p1; + tile_seg.origin = p0; + tile_seg.vector = p1 - p0; float y_edge = 0.0; if (tag == PathSeg_FillCubic) { y_edge = mix(p0.y, p1.y, (tile_x0 - p0.x) / dx); if (min(p0.x, p1.x) < tile_x0 && y_edge >= tile_y0 && y_edge < tile_y0 + TILE_HEIGHT_PX) { + vec2 p = vec2(tile_x0, y_edge); if (p0.x > p1.x) { - tile_seg.end = vec2(tile_x0, y_edge); + tile_seg.vector = p - p0; } else { - tile_seg.start = vec2(tile_x0, y_edge); + tile_seg.origin = p; + tile_seg.vector = p1 - p; } } else { y_edge = 1e9; diff --git a/piet-gpu/shader/path_coarse.spv b/piet-gpu/shader/path_coarse.spv index 3ba2cff61fa355dc14b10e644fa7c579fdf4a0bf..952863cb4c91267d7d3174a3aa3a37127969a46b 100644 GIT binary patch delta 5731 zcmZ9Qdz6+{6~@mn!-zOQ^rgrpK#5Q;C4rF%BvBE<)R0h0DKo%;69Xdy*|=7%Pb~jv z_2;{6wK5BmE~BEtD0f8gf`|$zl3-qy0|uU7P^>@wt>lqyp9)GfWdw#VI-{aad_7B($OsXBE{Ba^n2Zf=~nyrngD?5g~3 z_v`PkOzD=(66VU(As*d{_kr8yiL26Y!ONDnHqCGBec2*)gW%*EQYH$p<#h$t9kL zm`}VQThXh~w={`zs%AV|n&+1$ur%A&>!LxG=`Kf=(`-H~!j_I>y@pj(9Pa4bdt7zz z<1EjGc#dE>X3}4hHS`&D{vpN;hK*!-E4rj~7=EbZjy?}`ExKdua=MZM8!)+R!N;Pz zbHTN{dwK5e1s{OFyO-y0=D6eCzpxX(SlYx8bZ`^%{Nfz%PXf0y>~gme3uHYFmzvfxE@w zKLYMH2Y39IjuQjN3@Dxpyq6_hQr_P+;QMG3IhgJA@(I}VdjMQdyPdNne-NzpBU%k7 zL2WJATimT|kGSj5wHenVA}4OKH0U8n6DV*cqV=u z!K-PLDA=vq1a7CV$JXh?ifl&Ql#L!=$Zi~8Q@a(mg;v8146zMtT9?dldh264Lu-$8 zkAR(9q}!hD7+)wpin2YY?f_fFveQMRv=dD|vOWfmtVT74KCyb*BkSW}cPg?zAwM(8 z3rf>?5>Z1q?aCU)7iynE*+q-AyTOsxu#VElw5HG=X`cqW-Vt$+lkNKq%ATD1EVwk; zZ2yEpG4kw1jXcJ2)N{1hL+$2qulIw0lH<>Ve_ZBn&O)B_Ci9ZZQ*kI;HL*`^eQuv##^*5YHsYB4ci=-bb>sLjQ;S9V12}&o zUMZc3Kcc=uizr9HdaB3BKY@+*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ow`(YE93=g5!1daC>4xS!r1 zkCnC`(|$%XhuBKJSZl!^oZ#!gD```S>&$-w)<->N^HZPVPQMKYr;m_3dJ#-)5|c&H zHgIK<2jG=S9)#M=XvBPTm#h6WCkJ40P_#w~^S7SL!`QPyhI{V+SEnow>R-5VN zUJ_1J+6w0XVfh$skzgCx1o6^&46f#fv2nDiIei~QPT#&UmCAoFLn^QP4)}IjY??MT z1H{wKrR~S&(1n&d5H-@5SaPb&P)!t`-y0rdDf!v)QS!#nMyIZLD$(c^a-3L$s;I9G?Mi zLJR&Z`~t$pocF=i^s{7bYWjOy_Jh6m+IU`6rTtl-X+sMKvT@UjrGpp`l$~9`=fIDV zEP@|`tLbL|ZE6wxdGLNTZR6?XPIWifwX)aOBmDxl?Qkb9KU|Y8%Eg$u#>4F=rrq2B E|Fk!@Y5)KL diff --git a/piet-gpu/shader/tile.h b/piet-gpu/shader/tile.h index d7659ff..b6c5e14 100644 --- a/piet-gpu/shader/tile.h +++ b/piet-gpu/shader/tile.h @@ -35,8 +35,8 @@ TileRef Tile_index(TileRef ref, uint index) { } struct TileSeg { - vec2 start; - vec2 end; + vec2 origin; + vec2 vector; float y_edge; TileSegRef next; }; @@ -90,8 +90,8 @@ TileSeg TileSeg_read(TileSegRef ref) { uint raw4 = tile[ix + 4]; uint raw5 = tile[ix + 5]; TileSeg s; - s.start = vec2(uintBitsToFloat(raw0), uintBitsToFloat(raw1)); - s.end = vec2(uintBitsToFloat(raw2), uintBitsToFloat(raw3)); + s.origin = vec2(uintBitsToFloat(raw0), uintBitsToFloat(raw1)); + s.vector = vec2(uintBitsToFloat(raw2), uintBitsToFloat(raw3)); s.y_edge = uintBitsToFloat(raw4); s.next = TileSegRef(raw5); return s; @@ -99,10 +99,10 @@ TileSeg TileSeg_read(TileSegRef ref) { void TileSeg_write(TileSegRef ref, TileSeg s) { uint ix = ref.offset >> 2; - tile[ix + 0] = floatBitsToUint(s.start.x); - tile[ix + 1] = floatBitsToUint(s.start.y); - tile[ix + 2] = floatBitsToUint(s.end.x); - tile[ix + 3] = floatBitsToUint(s.end.y); + tile[ix + 0] = floatBitsToUint(s.origin.x); + tile[ix + 1] = floatBitsToUint(s.origin.y); + tile[ix + 2] = floatBitsToUint(s.vector.x); + tile[ix + 3] = floatBitsToUint(s.vector.y); tile[ix + 4] = floatBitsToUint(s.y_edge); tile[ix + 5] = s.next.offset; }