1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use TypeId;
use TimelineSyncObj;
/// should use Drop to release
// PLAN
//
// Pimitives:
// Arc<dyn ReadOp>, a shareable handle to a read op on a resource
// Box<dyn WriteOp>, a non-clonable handle to a mutating op, for an actual gpu submission this is
// moved into the function/method recording the action
//
//
// Private Resources:
// auto assign aqcuire and release points, create Arc<dyn ReadResource>
// keep returning same Arc<dyn ReadResource> until a mutable operation is scheduled (gpu side or cpu
// side)
// upon a mut op being scheduled advance the acquire and release points
//
// Shared Resources:
// has something like T::read_op(acquire_point: u64, release_point: u64) -> Arc<TSpecificReadOp>
// has something like T::write_op(acquire_point: u64, release_point: u64) -> Box<TSpecificWriteOp>
// they might need to be unsafe, since else memory corruption might happen (2 writes at the same
// time)
//
// TODO: how does this work with secondary command buffers? how does this work with transient
// attachments, would they just go through a different system entirely?
// Transient Attachments stuff:
// RenderAttachment enum:
// Image(Box<dyn ImageWriteOp>),
// TransientAttachment(TransientAttachmentReadOp)
//
// TransientAttachmentReadOp is returned by a method that records the local_read barrier (i think,
// idk how to quite do that)
// idk, just treat transient attachments as unsafe for now, nice and safe abstraction later