@@ -32,25 +32,18 @@ const fn patch_lanes<V: Sized>() -> usize {
3232 if size_of :: < V > ( ) < 8 { 32 } else { 16 }
3333}
3434
35+ /// A cached accessor to the patch values.
3536pub struct PatchAccessor < ' a > {
3637 n_lanes : usize ,
3738 lane_offsets : & ' a [ u32 ] ,
3839 indices : & ' a [ u16 ] ,
3940}
4041
41- pub struct PatchOffset {
42- /// Global offset into the list of patches. These are some of the
43- pub index : usize ,
44- /// This is the value stored in the `indices` buffer, which encodes the offset of the `index`-th
45- /// patch
46- pub chunk_offset : u16 ,
47- }
48-
4942impl < ' a > PatchAccessor < ' a > {
5043 /// Get an iterator over indices and values offsets.
5144 ///
52- /// The first component is the index into the `indices` and `values`, and the second component
53- /// is the set of values instead here...I think?
45+ /// The first component is the index into the `indices` and `values`, and the second is
46+ /// the datum from `indices[index]` already prefetched.
5447 pub fn offsets_iter (
5548 & self ,
5649 chunk : usize ,
@@ -62,25 +55,3 @@ impl<'a> PatchAccessor<'a> {
6255 std:: iter:: zip ( start..stop, self . indices [ start..stop] . iter ( ) . copied ( ) )
6356 }
6457}
65-
66- pub struct LanePatches < ' a , V > {
67- pub indices : & ' a [ u16 ] ,
68- pub values : & ' a [ V ] ,
69- }
70-
71- impl < ' a , V : Copy > LanePatches < ' a , V > {
72- pub fn len ( & self ) -> usize {
73- self . indices . len ( )
74- }
75-
76- pub fn is_empty ( & self ) -> bool {
77- self . indices . is_empty ( )
78- }
79-
80- pub fn iter ( & self ) -> impl Iterator < Item = ( u16 , V ) > {
81- self . indices
82- . iter ( )
83- . copied ( )
84- . zip ( self . values . iter ( ) . copied ( ) )
85- }
86- }
0 commit comments