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::RPI::PassAttachmentBinding Struct Referencefinal

#include <PassAttachment.h>

Public Member Functions

 PassAttachmentBinding (const PassSlot &slot)
void SetAttachment (const Ptr< PassAttachment > &attachment)
 Getter and Setter for attachment.
const Ptr< PassAttachment > & GetAttachment () const
void SetOriginalAttachment (Ptr< PassAttachment > &attachment)
 Set the attachment and the original attachment to the provided value.
RHI::ScopeAttachmentAccess GetAttachmentAccess () const
 Returns the corresponding ScopeAttachmentAccess for this binding.
void ValidateDeviceFormats (const AZStd::vector< RHI::Format > &formatFallbacks)
 Sets all formats to nearest device supported formats and warns if changes where made.
void UpdateConnection (bool useFallback)
 Updates the set attachment from the binding connection.

Public Attributes

Name m_name
 Name of the attachment binding so we can find it in a list of attachment binding.
Name m_shaderInputName = Name("AutoBind")
 Name of the SRG member this binds to (see PassSlot::m_shaderInputName for more details)
RHI::ShaderInputNameIndex m_shaderImageDimensionsNameIndex
PassSlotType m_slotType = PassSlotType::Uninitialized
 Whether binding is an input, output or inputOutput.
RHI::ScopeAttachmentUsage m_scopeAttachmentUsage = RHI::ScopeAttachmentUsage::Uninitialized
 ScopeAttachmentUsage used when binding the attachment with the RHI.
RHI::UnifiedScopeAttachmentDescriptor m_unifiedScopeDesc
 The scope descriptor to be used for this binding during rendering.
PassAttachmentBindingm_connectedBinding = nullptr
 Pointer to the binding slot connected to this binding slot.
PassAttachmentBindingm_fallbackBinding = nullptr
int16_t m_shaderInputIndex = ShaderInputAutoBind
uint16_t m_shaderInputArrayIndex = 0
uint8_t m_attachmentUsageIndex = 0

Static Public Attributes

static const int16_t ShaderInputAutoBind = -1
static const int16_t ShaderInputNoBind = -2

Detailed Description

An attachment binding points to a PassAttachment and specifies how the pass uses that attachment. In data driven usages, a PassAttachmentBinding is constructed from a PassSlot (specifies how to use the attachment) and a PassConnection (specifies which attachment to use).

A attachment binding can point to another attachment binding, which means it is connected to that binding. In this case, the attachment pointed to by the connected binding will be used. Example: an input binding can point to another Pass's output binding, in which case the input binding will refer to the same attachment at the connected output binding.

Member Data Documentation

◆ m_attachmentUsageIndex

uint8_t AZ::RPI::PassAttachmentBinding::m_attachmentUsageIndex = 0

An attachment can be used multiple times by the same pass (for example reading an writing to different mips of the same texture). This indicates which number usage this binding corresponds to.

◆ m_fallbackBinding

PassAttachmentBinding* AZ::RPI::PassAttachmentBinding::m_fallbackBinding = nullptr

Only used if this PassAttachmentBinding is an output, in which case this is the fallback we will use when the pass is disabled.

◆ m_shaderImageDimensionsNameIndex

RHI::ShaderInputNameIndex AZ::RPI::PassAttachmentBinding::m_shaderImageDimensionsNameIndex

Name index of the SRG constant to which, if specified, we automatically calculate and bind the image dimensions (if this binding is of type image)

◆ m_shaderInputIndex

int16_t AZ::RPI::PassAttachmentBinding::m_shaderInputIndex = ShaderInputAutoBind

This tracks which SRG slot to bind the attachment to. This value gets applied in RenderPass::BindPassSrg after being converted to either an RHI::ShaderInputImageIndex or an RHI::ShaderInputBufferIndex using the specified shader name (see m_shaderInputName)

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