mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-10 12:41:30 +11:00
piet-gpu-types: remove unused Segment and SegChunk types
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
parent
4bbc7dee1d
commit
bd450ef461
|
@ -67,24 +67,5 @@ piet_gpu! {
|
|||
SolidMask(CmdSolidMask),
|
||||
Jump(CmdJump),
|
||||
}
|
||||
|
||||
// TODO: strongly consider using f16. If so, these would be
|
||||
// relative to the tile. We're doing f32 for now to minimize
|
||||
// divergence from piet-metal originals.
|
||||
struct Segment {
|
||||
start: [f32; 2],
|
||||
end: [f32; 2],
|
||||
|
||||
// This is used for fills only, but we're including it in
|
||||
// the general structure for simplicity.
|
||||
y_edge: f32,
|
||||
}
|
||||
|
||||
struct SegChunk {
|
||||
n: u32,
|
||||
next: Ref<SegChunk>,
|
||||
// Actually a reference to a variable-sized slice.
|
||||
segs: Ref<Segment>,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,14 +48,6 @@ struct CmdRef {
|
|||
uint offset;
|
||||
};
|
||||
|
||||
struct SegmentRef {
|
||||
uint offset;
|
||||
};
|
||||
|
||||
struct SegChunkRef {
|
||||
uint offset;
|
||||
};
|
||||
|
||||
struct CmdCircle {
|
||||
vec2 center;
|
||||
float radius;
|
||||
|
@ -195,30 +187,6 @@ CmdRef Cmd_index(CmdRef ref, uint index) {
|
|||
return CmdRef(ref.offset + index * Cmd_size);
|
||||
}
|
||||
|
||||
struct Segment {
|
||||
vec2 start;
|
||||
vec2 end;
|
||||
float y_edge;
|
||||
};
|
||||
|
||||
#define Segment_size 20
|
||||
|
||||
SegmentRef Segment_index(SegmentRef ref, uint index) {
|
||||
return SegmentRef(ref.offset + index * Segment_size);
|
||||
}
|
||||
|
||||
struct SegChunk {
|
||||
uint n;
|
||||
SegChunkRef next;
|
||||
SegmentRef segs;
|
||||
};
|
||||
|
||||
#define SegChunk_size 12
|
||||
|
||||
SegChunkRef SegChunk_index(SegChunkRef ref, uint index) {
|
||||
return SegChunkRef(ref.offset + index * SegChunk_size);
|
||||
}
|
||||
|
||||
CmdCircle CmdCircle_read(CmdCircleRef ref) {
|
||||
uint ix = ref.offset >> 2;
|
||||
uint raw0 = ptcl[ix + 0];
|
||||
|
@ -514,45 +482,3 @@ void Cmd_Jump_write(CmdRef ref, CmdJump s) {
|
|||
CmdJump_write(CmdJumpRef(ref.offset + 4), s);
|
||||
}
|
||||
|
||||
Segment Segment_read(SegmentRef ref) {
|
||||
uint ix = ref.offset >> 2;
|
||||
uint raw0 = ptcl[ix + 0];
|
||||
uint raw1 = ptcl[ix + 1];
|
||||
uint raw2 = ptcl[ix + 2];
|
||||
uint raw3 = ptcl[ix + 3];
|
||||
uint raw4 = ptcl[ix + 4];
|
||||
Segment s;
|
||||
s.start = vec2(uintBitsToFloat(raw0), uintBitsToFloat(raw1));
|
||||
s.end = vec2(uintBitsToFloat(raw2), uintBitsToFloat(raw3));
|
||||
s.y_edge = uintBitsToFloat(raw4);
|
||||
return s;
|
||||
}
|
||||
|
||||
void Segment_write(SegmentRef ref, Segment s) {
|
||||
uint ix = ref.offset >> 2;
|
||||
ptcl[ix + 0] = floatBitsToUint(s.start.x);
|
||||
ptcl[ix + 1] = floatBitsToUint(s.start.y);
|
||||
ptcl[ix + 2] = floatBitsToUint(s.end.x);
|
||||
ptcl[ix + 3] = floatBitsToUint(s.end.y);
|
||||
ptcl[ix + 4] = floatBitsToUint(s.y_edge);
|
||||
}
|
||||
|
||||
SegChunk SegChunk_read(SegChunkRef ref) {
|
||||
uint ix = ref.offset >> 2;
|
||||
uint raw0 = ptcl[ix + 0];
|
||||
uint raw1 = ptcl[ix + 1];
|
||||
uint raw2 = ptcl[ix + 2];
|
||||
SegChunk s;
|
||||
s.n = raw0;
|
||||
s.next = SegChunkRef(raw1);
|
||||
s.segs = SegmentRef(raw2);
|
||||
return s;
|
||||
}
|
||||
|
||||
void SegChunk_write(SegChunkRef ref, SegChunk s) {
|
||||
uint ix = ref.offset >> 2;
|
||||
ptcl[ix + 0] = s.n;
|
||||
ptcl[ix + 1] = s.next.offset;
|
||||
ptcl[ix + 2] = s.segs.offset;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue