Open 3D Engine Atom Gem API Reference  2205.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Classes | Public Types | Public Member Functions | List of all members
AZ::RPI::AttachmentReadback Class Reference

A scope producer which reads back buffer or image attachments. More...

#include <AttachmentReadback.h>

Classes

struct  ReadbackResult
 

Public Types

enum  ReadbackState : uint32_t {
  Uninitialized = 0, Idle, AttachmentSet, Reading,
  Success, Failed
}
 
using CallbackFunction = AZStd::function< void(const ReadbackResult &)>
 

Public Member Functions

 AZ_RTTI (AttachmentReadback, "{9C70ACD3-8694-4EF3-A556-9DA25BD1237C}")
 
 AZ_CLASS_ALLOCATOR (AttachmentReadback, SystemAllocator, 0)
 
 AttachmentReadback (const RHI::ScopeId &scopeId)
 
bool ReadPassAttachment (const PassAttachment *attachment, const AZ::Name &readbackName)
 
void Reset ()
 
ReadbackState GetReadbackState ()
 
void SetCallback (CallbackFunction callback)
 Set a callback function which will be called when readback is finished or failed.
 
bool IsFinished () const
 Whether the previous readback is finished.
 
bool IsReady () const
 
void FrameBegin (Pass::FramePrepareParams params)
 Prepare this scope producer for the frame.
 

Detailed Description

A scope producer which reads back buffer or image attachments.

Member Function Documentation

◆ IsReady()

bool AZ::RPI::AttachmentReadback::IsReady ( ) const

Whether it's ready to readback an attachment Returns false if it's not initialized or it's in the process of readback from another attachment

◆ ReadPassAttachment()

bool AZ::RPI::AttachmentReadback::ReadPassAttachment ( const PassAttachment attachment,
const AZ::Name &  readbackName 
)

Readback a pass attachment.

Parameters
readbackNameis the name for the readback buffer. And it will be saved in ReadbackResult::m_name. If the name is empty, a name will be generated automatically. Return true if the pass attachment readback request was submitted.
The callback function set by SetCallback(CallbackFunction callback) will be called once the readback is finished

The documentation for this class was generated from the following file: