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

#include <DrawPacketBuilder.h>

Classes

struct  DrawRequest
 

Public Member Functions

 DrawPacketBuilder (RHI::MultiDevice::DeviceMask deviceMask)
 
 DrawPacketBuilder (const DrawPacketBuilder &other)
 
DrawPacketBuilderoperator= (const DrawPacketBuilder &other)
 
void Begin (IAllocator *allocator)
 
void SetGeometryView (GeometryView *geometryView)
 Passes the GeometryView to all single-device DrawPacketBuilders.
 
void SetDrawInstanceArguments (DrawInstanceArguments drawInstanceArguments)
 Passes the DrawInstanceArguments to all single-device DrawPacketBuilders.
 
void SetRootConstants (AZStd::span< const uint8_t > rootConstants)
 Passes the RootConstants to all single-device DrawPacketBuilders.
 
void SetScissors (AZStd::span< const Scissor > scissors)
 Passes the Scissors to all single-device DrawPacketBuilders.
 
void SetScissor (const Scissor &scissor)
 Passes a Scissor to all single-device DrawPacketBuilders.
 
void SetViewports (AZStd::span< const Viewport > viewports)
 Passes the Viewports to all single-device DrawPacketBuilders.
 
void SetViewport (const Viewport &viewport)
 Passes a Viewport to all singl-device DrawPacketBuilders.
 
void AddShaderResourceGroup (const ShaderResourceGroup *shaderResourceGroup)
 Passes the DeviceShaderResourceGroup to all single-device DrawPacketBuilders.
 
void AddDrawItem (DrawRequest &request)
 
RHI::Ptr< DrawPacketEnd ()
 
RHI::Ptr< DrawPacketClone (const DrawPacket *original)
 

Static Public Attributes

static const size_t DrawItemCountMax = 16
 

Detailed Description

DrawPacketBuilder builds a DrawPacket and its DrawItems contiguously in memory for cache efficiency Start by calling DrawPacketBuilder::Begin( ) Then Set the necessary data and add a DrawRequest for each DrawItem Finalize the DrawPacket with a call to DrawPacketBuilder::End( )

Member Function Documentation

◆ AddDrawItem()

void AZ::RHI::DrawPacketBuilder::AddDrawItem ( DrawRequest request)

Passes the single-device DrawRequests to all single-device DrawPacketBuilders, keeps the multi-device DeviceDrawRequest and sets the DrawListMask in the current multi-device DeviceDrawPacket

◆ Begin()

void AZ::RHI::DrawPacketBuilder::Begin ( IAllocator *  allocator)

Passes the linear allocator to all single-device DrawPacketBuilders and initializes the multi-device DeviceDrawPacket which will be returned after calling End()

◆ Clone()

RHI::Ptr< DrawPacket > AZ::RHI::DrawPacketBuilder::Clone ( const DrawPacket original)

Clones all single-device DrawPackets and then sets all corresponding pointers in the multi-device DeviceDrawPacket and DeviceDrawItem objects

◆ End()

RHI::Ptr< DrawPacket > AZ::RHI::DrawPacketBuilder::End ( )

Builds all single-device DrawPackets linearly in memory using their allocator and captures them in the multi-device DeviceDrawPacket, correctly linking the single-device DrawItems with the corresponding multi-device DeviceDrawItem as well


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