1 module gfx.graal.renderpass;
2 
3 import gfx.core.rc;
4 import gfx.core.typecons : Option;
5 import gfx.graal.cmd : Access, PipelineStage;
6 import gfx.graal.format;
7 import gfx.graal.image;
8 import gfx.graal.types;
9 
10 import std.typecons : Flag;
11 
12 enum LoadOp {
13     load, clear, dontCare
14 }
15 
16 enum StoreOp {
17     store, dontCare
18 }
19 
20 struct AttachmentOps {
21     LoadOp load;
22     StoreOp store;
23 }
24 
25 struct AttachmentDescription
26 {
27     Format format;
28     uint samples=1;
29     AttachmentOps colorDepthOps = AttachmentOps(LoadOp.dontCare, StoreOp.dontCare);
30     AttachmentOps stencilOps = AttachmentOps(LoadOp.dontCare, StoreOp.dontCare);
31     Trans!ImageLayout layoutTrans;
32     Flag!"mayAlias" mayAlias;
33 }
34 
35 struct AttachmentRef {
36     uint attachment;
37     ImageLayout layout;
38 }
39 
40 struct SubpassDescription
41 {
42     AttachmentRef[] inputs;
43     AttachmentRef[] colors;
44     Option!AttachmentRef depthStencil;
45     uint[] preserves;
46 }
47 
48 enum subpassExternal = uint.max;
49 
50 struct SubpassDependency
51 {
52     Trans!uint subpass;
53     Trans!PipelineStage stageMask;
54     Trans!Access accessMask;
55 }
56 
57 interface RenderPass : AtomicRefCounted
58 {
59     import gfx.graal.device : Device;
60     /// Get the parent device
61     @property Device device();
62 }
63 
64 interface Framebuffer : AtomicRefCounted
65 {
66     import gfx.graal.device : Device;
67     /// Get the parent device
68     @property Device device();
69 }