Home -> IRenderPassNode -> SetAttachmentLoadStoreBehavior
Description
The SetAttachmentLoadStoreBehavior method allows the application to relax requirements around whether framebuffer contents must be retained before or after this render pass is drawn. While framebuffer contents are undefined at the start of each new frame, by default, the contents of framebuffer targets are retained after each render pass. If a framebuffer is being reused by multiple render passes, but the contents of the framebuffer don't need to be retained in all cases, this method allows the storage requirements to be relaxed. Not all renderers are capable of acting on the information provided here, but the ones that can may be able to improve performance or memory usage.
Important
If a render pass is clearing a framebuffer attachment, the AttachmentLoadBehavior is essentially ignored, as it's clear there's no requirement to retain existing buffer data.
Important
Where multisample anti-aliasing (MSAA) is being used, it's possible to set the AttachmentStoreBehavior setting to UndefinedFinalData where the EnableAttachmentMultiSamplingResolution method has been used to setup a resolve target for the framebuffer attachment within the same render pass. In this case, the framebuffer contents will be retained until the resolve process is complete.
Usage
void SetAttachmentLoadStoreBehavior(IFrameBuffer::AttachmentType type, size_t index, AttachmentLoadBehavior loadBehavior, AttachmentStoreBehavior storeBehavior);
Argument list
- type [IFrameBuffer::AttachmentType]
- The type of the target framebuffer attachment
- index [size_t]
- The index of the target framebuffer attachment within the selected attachment type
- loadBehavior [AttachmentLoadBehavior]
- The behaviour to apply for the target framebuffer attachment when the render pass is beginning
- storeBehavior [AttachmentStoreBehavior]
- The behaviour to apply for the target framebuffer attachment when the render pass is ending