1    type RenderPass =
2        val format : RenderPassFormat
3        val object : VkRenderPass
4        val samples : SampleCountFlags
5    
6    type EnterOp =
7        | Clear
8        | Continue
9        | Load
10   
11   type ExitOp =
12       | Continue
13       | Read
14       | Discard
15   
16   type Settings @data =
17       val color_enter_op : EnterOp
18       val color_exit_op : ExitOp
19       val depth_enter_op : EnterOp
20       val depth_exit_op : ExitOp
21       val no_dependencies : bool
22   
23   type RenderPassCache =
24       let map = Map<Settings, RenderPass>.new
25   
26       def get (settings : Settings) = map[settings]
27       def contains (settings : Settings) = map.contains settings
28   
29       def add (settings : Settings) (render_pass : RenderPass) =
30           map.add settings render_pass
31   
32   object AttachmentDescription =
33       val default = AttachmentDescription
34           flags = AttachmentDescriptionFlags@zero
35           format = VkFormat/UNDEFINED
36           samples = SampleCountFlags/1
37           load_op = AttachmentLoadOp/Load
38           store_op = AttachmentStoreOp/Store
39           stencil_load_op = AttachmentLoadOp/Load
40           stencil_store_op = AttachmentStoreOp/Store
41           initial_layout = ImageLayout/Undefined
42           final_layout = ImageLayout/Undefined
43