This class manages all the native objects associated with a ShaderResourceGroup. More...
#include <ArgumentBuffer.h>
Inherits AZ::RHI::DeviceObject.
Public Types | |
using | ResourcesForCompute = AZStd::unordered_set<id <MTLResource>, MetalResourceHash> |
using | ResourcesPerStageForGraphics = AZStd::array<AZStd::unordered_set<id <MTLResource>, MetalResourceHash>, RHI::ShaderStageGraphicsCount> |
Public Member Functions | |
AZ_CLASS_ALLOCATOR (ArgumentBuffer, AZ::SystemAllocator) | |
AZ_RTTI (ArgumentBuffer, "FEFE8823-7772-4EA0-9241-65C49ADFF6B3", Base) | |
void | Init (Device *device, RHI::ConstPtr< RHI::ShaderResourceGroupLayout > srgLayout, ShaderResourceGroupPool *srgPool) |
void | Init (Device *device, AZStd::vector< MTLArgumentDescriptor * > argBufferDescriptors, AZStd::string argBufferName) |
void | UpdateImageViews (const RHI::ShaderInputImageDescriptor &shaderInputImage, const AZStd::span< const RHI::ConstPtr< RHI::ImageView > > &imageViews) |
void | UpdateSamplers (const RHI::ShaderInputSamplerDescriptor &shaderInputSampler, const AZStd::span< const RHI::SamplerState > &samplerStates) |
void | UpdateBufferViews (const RHI::ShaderInputBufferDescriptor &shaderInputBuffer, const AZStd::span< const RHI::ConstPtr< RHI::BufferView > > &bufferViews) |
void | UpdateConstantBufferViews (AZStd::span< const uint8_t > rawData) |
id< MTLBuffer > | GetArgEncoderBuffer () const |
Return the native MTLBuffer that holds SRG data. | |
const id< MTLArgumentEncoder > | GetArgEncoder () const |
Return the native Argument buffer encoder is used to write into the native MTLBuffer. | |
size_t | GetOffset () const |
Return the offset associated with the native MTLBuffer for this argument buffer. | |
void | CollectUntrackedResources (const ShaderResourceGroupVisibility &srgResourcesVisInfo, ResourcesPerStageForGraphics &untrackedResourcesRead, ResourcesPerStageForGraphics &untrackedResourcesReadWrite) const |
void | CollectUntrackedResources (const ShaderResourceGroupVisibility &srgResourcesVisInfo, ResourcesForCompute &untrackedResourceComputeRead, ResourcesForCompute &untrackedResourceComputeReadWrite) const |
bool | IsNullHeapNeededForVertexStage (const ShaderResourceGroupVisibility &srgResourcesVisInfo) const |
bool | IsNullDescHeapNeeded () const |
void | UpdateTextureView (id< MTLTexture > mtlTexture, uint32_t index) |
Update the texture related descriptor at a specific id index within the Argument buffer. | |
void | UpdateBufferView (id< MTLBuffer > mtlBuffer, uint32_t offset, uint32_t index) |
Update the buffer related descriptor at a specific id index within the Argument buffer. | |
void | Shutdown () override |
![]() | |
AZ_RTTI (DeviceObject, "{17D34F71-944C-4AF5-9823-627474C4C0A6}", Object) | |
bool | IsInitialized () const |
Returns whether the device object is initialized. | |
Device & | GetDevice () const |
![]() | |
AZ_RTTI (Object, "{E43378F1-2331-4173-94B8-990ED20E6003}") | |
void | SetName (const Name &name) |
Sets the name of the object. | |
const Name & | GetName () const |
Returns the name set on the object by SetName. | |
uint32_t | use_count () |
Returns the current use count of the object. | |
Static Public Member Functions | |
static RHI::Ptr< ArgumentBuffer > | Create () |
Additional Inherited Members | |
![]() | |
void | Init (Device &device) |
The derived class should call this method to assign the device. | |
void | Shutdown () override |
Clears the current bound device to null. | |
![]() | |
void | add_ref () const |
void | release () const |
![]() | |
AZStd::atomic_int | m_useCount = 0 |
This class manages all the native objects associated with a ShaderResourceGroup.
|
overridevirtual |
Shuts down the object. Derived classes can make this public if it fits with their lifecycle model (i.e. if they use an explicit Init / Shutdown). By default, it is private in order to maintain consistency with a simpler RAII lifecycle.
Reimplemented from AZ::RHI::Object.