mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-10 20:51:29 +11:00
remove unused commands from pathseg
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
parent
3557df24c5
commit
79d722df48
|
@ -3,21 +3,6 @@ use piet_gpu_derive::piet_gpu;
|
||||||
piet_gpu! {
|
piet_gpu! {
|
||||||
#[gpu_write]
|
#[gpu_write]
|
||||||
mod pathseg {
|
mod pathseg {
|
||||||
struct PathFillLine {
|
|
||||||
p0: [f32; 2],
|
|
||||||
p1: [f32; 2],
|
|
||||||
path_ix: u32,
|
|
||||||
// A note: the layout of this struct is shared with
|
|
||||||
// PathStrokeLine. In that case, we actually write
|
|
||||||
// [0.0, 0.0] as the stroke field, to minimize divergence.
|
|
||||||
}
|
|
||||||
struct PathStrokeLine {
|
|
||||||
p0: [f32; 2],
|
|
||||||
p1: [f32; 2],
|
|
||||||
path_ix: u32,
|
|
||||||
// halfwidth in both x and y for binning
|
|
||||||
stroke: [f32; 2],
|
|
||||||
}
|
|
||||||
struct PathFillCubic {
|
struct PathFillCubic {
|
||||||
p0: [f32; 2],
|
p0: [f32; 2],
|
||||||
p1: [f32; 2],
|
p1: [f32; 2],
|
||||||
|
@ -37,31 +22,10 @@ piet_gpu! {
|
||||||
// halfwidth in both x and y for binning
|
// halfwidth in both x and y for binning
|
||||||
stroke: [f32; 2],
|
stroke: [f32; 2],
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
struct PathQuad {
|
|
||||||
p0: [f32; 2],
|
|
||||||
p1: [f32; 2],
|
|
||||||
p2: [f32; 2],
|
|
||||||
stroke: [f32; 2],
|
|
||||||
}
|
|
||||||
struct PathCubic {
|
|
||||||
p0: [f32; 2],
|
|
||||||
p1: [f32; 2],
|
|
||||||
p2: [f32; 2],
|
|
||||||
p3: [f32; 2],
|
|
||||||
stroke: [f32; 2],
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
enum PathSeg {
|
enum PathSeg {
|
||||||
Nop,
|
Nop,
|
||||||
FillLine(PathFillLine),
|
|
||||||
StrokeLine(PathStrokeLine),
|
|
||||||
FillCubic(PathFillCubic),
|
FillCubic(PathFillCubic),
|
||||||
StrokeCubic(PathStrokeCubic),
|
StrokeCubic(PathStrokeCubic),
|
||||||
/*
|
|
||||||
Quad(AnnoQuadSeg),
|
|
||||||
Cubic(AnnoCubicSeg),
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,14 +2,6 @@
|
||||||
|
|
||||||
// Code auto-generated by piet-gpu-derive
|
// Code auto-generated by piet-gpu-derive
|
||||||
|
|
||||||
struct PathFillLineRef {
|
|
||||||
uint offset;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PathStrokeLineRef {
|
|
||||||
uint offset;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PathFillCubicRef {
|
struct PathFillCubicRef {
|
||||||
uint offset;
|
uint offset;
|
||||||
};
|
};
|
||||||
|
@ -22,31 +14,6 @@ struct PathSegRef {
|
||||||
uint offset;
|
uint offset;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PathFillLine {
|
|
||||||
vec2 p0;
|
|
||||||
vec2 p1;
|
|
||||||
uint path_ix;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define PathFillLine_size 20
|
|
||||||
|
|
||||||
PathFillLineRef PathFillLine_index(PathFillLineRef ref, uint index) {
|
|
||||||
return PathFillLineRef(ref.offset + index * PathFillLine_size);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct PathStrokeLine {
|
|
||||||
vec2 p0;
|
|
||||||
vec2 p1;
|
|
||||||
uint path_ix;
|
|
||||||
vec2 stroke;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define PathStrokeLine_size 28
|
|
||||||
|
|
||||||
PathStrokeLineRef PathStrokeLine_index(PathStrokeLineRef ref, uint index) {
|
|
||||||
return PathStrokeLineRef(ref.offset + index * PathStrokeLine_size);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct PathFillCubic {
|
struct PathFillCubic {
|
||||||
vec2 p0;
|
vec2 p0;
|
||||||
vec2 p1;
|
vec2 p1;
|
||||||
|
@ -77,67 +44,14 @@ PathStrokeCubicRef PathStrokeCubic_index(PathStrokeCubicRef ref, uint index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PathSeg_Nop 0
|
#define PathSeg_Nop 0
|
||||||
#define PathSeg_FillLine 1
|
#define PathSeg_FillCubic 1
|
||||||
#define PathSeg_StrokeLine 2
|
#define PathSeg_StrokeCubic 2
|
||||||
#define PathSeg_FillCubic 3
|
|
||||||
#define PathSeg_StrokeCubic 4
|
|
||||||
#define PathSeg_size 48
|
#define PathSeg_size 48
|
||||||
|
|
||||||
PathSegRef PathSeg_index(PathSegRef ref, uint index) {
|
PathSegRef PathSeg_index(PathSegRef ref, uint index) {
|
||||||
return PathSegRef(ref.offset + index * PathSeg_size);
|
return PathSegRef(ref.offset + index * PathSeg_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
PathFillLine PathFillLine_read(Alloc a, PathFillLineRef ref) {
|
|
||||||
uint ix = ref.offset >> 2;
|
|
||||||
uint raw0 = read_mem(a, ix + 0);
|
|
||||||
uint raw1 = read_mem(a, ix + 1);
|
|
||||||
uint raw2 = read_mem(a, ix + 2);
|
|
||||||
uint raw3 = read_mem(a, ix + 3);
|
|
||||||
uint raw4 = read_mem(a, ix + 4);
|
|
||||||
PathFillLine s;
|
|
||||||
s.p0 = vec2(uintBitsToFloat(raw0), uintBitsToFloat(raw1));
|
|
||||||
s.p1 = vec2(uintBitsToFloat(raw2), uintBitsToFloat(raw3));
|
|
||||||
s.path_ix = raw4;
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PathFillLine_write(Alloc a, PathFillLineRef ref, PathFillLine s) {
|
|
||||||
uint ix = ref.offset >> 2;
|
|
||||||
write_mem(a, ix + 0, floatBitsToUint(s.p0.x));
|
|
||||||
write_mem(a, ix + 1, floatBitsToUint(s.p0.y));
|
|
||||||
write_mem(a, ix + 2, floatBitsToUint(s.p1.x));
|
|
||||||
write_mem(a, ix + 3, floatBitsToUint(s.p1.y));
|
|
||||||
write_mem(a, ix + 4, s.path_ix);
|
|
||||||
}
|
|
||||||
|
|
||||||
PathStrokeLine PathStrokeLine_read(Alloc a, PathStrokeLineRef ref) {
|
|
||||||
uint ix = ref.offset >> 2;
|
|
||||||
uint raw0 = read_mem(a, ix + 0);
|
|
||||||
uint raw1 = read_mem(a, ix + 1);
|
|
||||||
uint raw2 = read_mem(a, ix + 2);
|
|
||||||
uint raw3 = read_mem(a, ix + 3);
|
|
||||||
uint raw4 = read_mem(a, ix + 4);
|
|
||||||
uint raw5 = read_mem(a, ix + 5);
|
|
||||||
uint raw6 = read_mem(a, ix + 6);
|
|
||||||
PathStrokeLine s;
|
|
||||||
s.p0 = vec2(uintBitsToFloat(raw0), uintBitsToFloat(raw1));
|
|
||||||
s.p1 = vec2(uintBitsToFloat(raw2), uintBitsToFloat(raw3));
|
|
||||||
s.path_ix = raw4;
|
|
||||||
s.stroke = vec2(uintBitsToFloat(raw5), uintBitsToFloat(raw6));
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PathStrokeLine_write(Alloc a, PathStrokeLineRef ref, PathStrokeLine s) {
|
|
||||||
uint ix = ref.offset >> 2;
|
|
||||||
write_mem(a, ix + 0, floatBitsToUint(s.p0.x));
|
|
||||||
write_mem(a, ix + 1, floatBitsToUint(s.p0.y));
|
|
||||||
write_mem(a, ix + 2, floatBitsToUint(s.p1.x));
|
|
||||||
write_mem(a, ix + 3, floatBitsToUint(s.p1.y));
|
|
||||||
write_mem(a, ix + 4, s.path_ix);
|
|
||||||
write_mem(a, ix + 5, floatBitsToUint(s.stroke.x));
|
|
||||||
write_mem(a, ix + 6, floatBitsToUint(s.stroke.y));
|
|
||||||
}
|
|
||||||
|
|
||||||
PathFillCubic PathFillCubic_read(Alloc a, PathFillCubicRef ref) {
|
PathFillCubic PathFillCubic_read(Alloc a, PathFillCubicRef ref) {
|
||||||
uint ix = ref.offset >> 2;
|
uint ix = ref.offset >> 2;
|
||||||
uint raw0 = read_mem(a, ix + 0);
|
uint raw0 = read_mem(a, ix + 0);
|
||||||
|
@ -213,14 +127,6 @@ uint PathSeg_tag(Alloc a, PathSegRef ref) {
|
||||||
return read_mem(a, ref.offset >> 2);
|
return read_mem(a, ref.offset >> 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
PathFillLine PathSeg_FillLine_read(Alloc a, PathSegRef ref) {
|
|
||||||
return PathFillLine_read(a, PathFillLineRef(ref.offset + 4));
|
|
||||||
}
|
|
||||||
|
|
||||||
PathStrokeLine PathSeg_StrokeLine_read(Alloc a, PathSegRef ref) {
|
|
||||||
return PathStrokeLine_read(a, PathStrokeLineRef(ref.offset + 4));
|
|
||||||
}
|
|
||||||
|
|
||||||
PathFillCubic PathSeg_FillCubic_read(Alloc a, PathSegRef ref) {
|
PathFillCubic PathSeg_FillCubic_read(Alloc a, PathSegRef ref) {
|
||||||
return PathFillCubic_read(a, PathFillCubicRef(ref.offset + 4));
|
return PathFillCubic_read(a, PathFillCubicRef(ref.offset + 4));
|
||||||
}
|
}
|
||||||
|
@ -233,16 +139,6 @@ void PathSeg_Nop_write(Alloc a, PathSegRef ref) {
|
||||||
write_mem(a, ref.offset >> 2, PathSeg_Nop);
|
write_mem(a, ref.offset >> 2, PathSeg_Nop);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PathSeg_FillLine_write(Alloc a, PathSegRef ref, PathFillLine s) {
|
|
||||||
write_mem(a, ref.offset >> 2, PathSeg_FillLine);
|
|
||||||
PathFillLine_write(a, PathFillLineRef(ref.offset + 4), s);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PathSeg_StrokeLine_write(Alloc a, PathSegRef ref, PathStrokeLine s) {
|
|
||||||
write_mem(a, ref.offset >> 2, PathSeg_StrokeLine);
|
|
||||||
PathStrokeLine_write(a, PathStrokeLineRef(ref.offset + 4), s);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PathSeg_FillCubic_write(Alloc a, PathSegRef ref, PathFillCubic s) {
|
void PathSeg_FillCubic_write(Alloc a, PathSegRef ref, PathFillCubic s) {
|
||||||
write_mem(a, ref.offset >> 2, PathSeg_FillCubic);
|
write_mem(a, ref.offset >> 2, PathSeg_FillCubic);
|
||||||
PathFillCubic_write(a, PathFillCubicRef(ref.offset + 4), s);
|
PathFillCubic_write(a, PathFillCubicRef(ref.offset + 4), s);
|
||||||
|
|
Loading…
Reference in a new issue