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::DrawPacket Class Referencefinal

#include <DrawPacket.h>

Inherits AZStd::intrusive_base.

Public Types

using DrawItemVisitor = AZStd::function< void(DrawListTag, DrawItemProperties)>
 

Public Member Functions

 AZ_DISABLE_COPY_MOVE (DrawPacket)
 
DrawListMask GetDrawListMask () const
 Returns the mask representing all the draw lists affected by the packet.
 
size_t GetDrawItemCount () const
 Returns the number of draw items stored in the packet.
 
DrawItemProperties GetDrawItem (size_t index) const
 Returns the draw item and its properties associated with the provided index.
 
DrawListTag GetDrawListTag (size_t index) const
 Returns the draw list tag associated with the provided index, used to filter the draw item into an appropriate pass.
 
DrawFilterMask GetDrawFilterMask (size_t index) const
 Returns the draw filter mask associated with the provided index, used to filter the draw item into an appropriate render pipeline.
 
void operator delete (void *p, size_t size)
 Overloaded operator delete for freeing a draw packet.
 
void SetRootConstant (uint32_t offset, const AZStd::span< uint8_t > &data)
 Update the root constant at the specified interval. The same root constants are shared by all draw items in the draw packet.
 
void SetInstanceCount (uint32_t instanceCount)
 Set the instance count in all draw items.
 

Friends

class DrawPacketBuilder
 

Detailed Description

DrawPacket is a packed data structure (one contiguous allocation) containing a collection of DrawItems and their associated array data. Each draw item in the packet is associated with a DrawListTag. All draw items in the packet share the same set of shader resource groups, index buffer, one DrawFilterMask, and draw arguments.

Some notes about design and usage:

  • Draw packets should be used to 'broadcast' variations of the same 'object' to multiple passes. For example: 'Shadow', 'Depth', 'Forward'.
  • Draw packets can be re-used between different views, scenes, or passes. The embedded shader resource groups should represent only the local data necessary to describe the 'object', not the full context including scene / view / pass specific state. They serve as a 'template'.
  • The packet is self-contained and does not reference external memory. Use DrawPacketBuilder to construct an instance and either store in an RHI::Ptr or call 'delete' to release.

Member Function Documentation

◆ AZ_DISABLE_COPY_MOVE()

AZ::RHI::DrawPacket::AZ_DISABLE_COPY_MOVE ( DrawPacket  )

Draw packets cannot be move constructed or copied, as they contain an additional memory payload. Use DrawPacketBuilder::Clone to copy a draw packet.


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