bigwheels
bigwheels copied to clipboard
Simplify RenderPass creation logic
There are currently a lot of ways to create a render pass:
RenderPass
- RenderPassCreateInfo - RTVs and/or DSV exist (swapchain, graphics benchmark)
- RenderPassCreateInfo2 - will create images and views for you (sample shadows project)
- RenderPassCreateInfo3 - will create views for you (cube, drawpass)
DrawPass - encapsulate multiple render passes with different load operations
- DrawPassCreateInfo - will create images and views for you (FishTornado shadow pass, gbuffer, async compute, benchmarks)
- DrawPassCreateInfo2 - will create views for you (OIT demo)
- DrawPassCreateInfo3 - RTVs and/or DSV exist (gbuffer)
This causes some confusion as to which one to use, and personally it's hard to remember which number does what. They do not match with RenderPass and DrawPass (different numbering naming scheme, for renderpass 1 is views exist, for draw pass that is 3). Render passes also need to include some info for various features (shading rate, multiview), so we need to propagate that across all versions, and creation flows.
Do we need this many versions of creating the underlying render pass? Perhaps we could simplify or at least improve naming here.
Some options (from least intrusive to most, not mutually exclusive):
- Rename to remove numbering scheme, for example RenderPassCreateInfoWithViews, RenderPassCreateInfoWithImages
- Remove RenderPassCreateInfo2, it is only used in a single place. It should be easy enough to create images and then use RenderPassCreateInfo from there
- Remove DrawPassses, I am still trying to figure out the usage. It seems like DrawPass encapsulates multiple render passes with different load behaviour (clear all, clear render targets, clear depth, clear stencil). However I haven't been able to find any usage where a single draw pass is used with multiple clear behaviours, so perhaps it is sufficient to use RenderPass?