Open 3D Engine Atom Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::RHI::ScopeProducer Class Referenceabstract

#include <ScopeProducer.h>

Inherited by AZ::RHI::ScopeProducerEmpty, AZ::RHI::ScopeProducerFunction< UserData, PrepareFunction, CompileFunction, ExecuteFunction >, AZ::RPI::ImageAttachmentCopy, AZ::RPI::ImageAttachmentPreviewPass, AZ::RPI::RenderPass, AZ::Render::DepthOfFieldCopyFocusDepthToCpuPass, and AZ::Render::RayTracingAccelerationStructurePass.

Public Member Functions

 ScopeProducer (const ScopeId &scopeId)
 
const ScopeId & GetScopeId () const
 Returns the scope id associated with this scope producer.
 
const ScopeGetScope () const
 Returns the scope associated with this scope producer.
 

Protected Member Functions

 ScopeProducer ()
 
void SetHardwareQueueClass (HardwareQueueClass hardwareQueueClass)
 Sets the HardwareQueueClass on the scope.
 
void SetScopeId (const ScopeId &scopeId)
 
void InitScope (const ScopeId &scopeId, HardwareQueueClass hardwareQueueClass=HardwareQueueClass::Graphics)
 

Friends

class FrameScheduler
 

Detailed Description

ScopeProducer is the base class for systems which produce scopes on the frame scheduler. The user is expected to inherit from this class and implement three virtual methods:

  • SetupFrameGraphDependencies
  • CompileResources
  • BuildCommandList It can then be registered with the frame scheduler each frame. Internally, this process generates a Scope which is inserted to the frame graph internally.

EXAMPLE:

class MyScope : public RHI::ScopeProducer { public: MyScope() : RHI::ScopeProducer(RHI::ScopeId{"MyScopeId"}) {}

private: void SetupFrameGraphDependencies(FrameGraphInterface frameGraph) override { // Create attachments on the builder, use them. }

void CompileResources(const FrameGraphCompileContext& context) override { // Use the provided context to access image / buffer views and // build ShaderResourceGroups. }

void BuildCommandList(const FrameGraphExecuteContext& context) override { // A context is provided which allows you to access the command // list for execution. } };

MyScope scope;

// Register with the scheduler each frame. Callbacks will be // invoked. frameScheduler.AddScope(scope);

Constructor & Destructor Documentation

◆ ScopeProducer()

AZ::RHI::ScopeProducer::ScopeProducer ( )
protected

Protected default constructor for classes that inherit from ScopeProducer but that can't supply a ScopeId at construction.

Member Function Documentation

◆ InitScope()

void AZ::RHI::ScopeProducer::InitScope ( const ScopeId &  scopeId,
HardwareQueueClass  hardwareQueueClass = HardwareQueueClass::Graphics 
)
protected

Initializes the scope with a ScopeId and HardwareQueueClass. Used by classes that inherit from ScopeProducer but can't supply a ScopeId at construction.

◆ SetScopeId()

void AZ::RHI::ScopeProducer::SetScopeId ( const ScopeId &  scopeId)
protected

DEPRECATED.

Deprecated:
Use InitScope instead

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