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::Query Class Reference

#include <Query.h>

Inherits AZ::RHI::Resource.

Inherited by AZ::DX12::Query, AZ::Metal::Query, AZ::Null::Query, and AZ::Vulkan::Query.

Public Member Functions

 AZ_RTTI (Query, "{5E4AAD1B-E1A5-45FA-B965-9E212CE58B57}", Resource)
 
void ReportMemoryUsage (MemoryStatisticsBuilder &builder) const override
 Reports memory usage of this image to the memory statistics builder.
 
const QueryPoolGetQueryPool () const
 Returns the query pool that this query belongs to.
 
QueryPoolGetQueryPool ()
 
QueryHandle GetHandle () const
 Returns the handle of the query.
 
ResultCode Begin (CommandList &commandList, QueryControlFlags flags=QueryControlFlags::None)
 
ResultCode End (CommandList &commandList)
 
ResultCode WriteTimestamp (CommandList &commandList)
 
- Public Member Functions inherited from AZ::RHI::Resource
 AZ_RTTI (Resource, "{9D02CDAC-80EB-4B77-8E62-849AC6E69206}", DeviceObject)
 
bool IsAttachment () const
 Returns whether the resource is currently an attachment on a frame graph.
 
void Shutdown () override final
 Shuts down the buffer by detaching it from its parent pool.
 
const ResourcePoolGetPool () const
 
ResourcePoolGetPool ()
 
uint32_t GetVersion () const
 
virtual void ReportMemoryUsage (MemoryStatisticsBuilder &builder) const =0
 Reports memory usage of this image to the memory statistics builder.
 
const FrameAttachmentGetFrameAttachment () const
 Returns the frame attachment associated with this image (if it exists).
 
void InvalidateViews ()
 
bool IsInResourceCache (const ImageViewDescriptor &imageViewDescriptor)
 Returns true if the ResourceView is in the cache.
 
bool IsInResourceCache (const BufferViewDescriptor &bufferViewDescriptor)
 
void EraseResourceView (ResourceView *resourceView) const
 Removes the provided ResourceView from the cache.
 
- Public Member Functions inherited from AZ::RHI::DeviceObject
 AZ_RTTI (DeviceObject, "{17D34F71-944C-4AF5-9823-627474C4C0A6}", Object)
 
bool IsInitialized () const
 Returns whether the device object is initialized.
 
DeviceGetDevice () const
 
- Public Member Functions inherited from AZ::RHI::Object
 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.
 

Friends

class QueryPool
 

Additional Inherited Members

- Protected Member Functions inherited from AZ::RHI::Resource
Ptr< ImageViewGetResourceView (const ImageViewDescriptor &imageViewDescriptor) const
 Returns view based on the descriptor.
 
Ptr< BufferViewGetResourceView (const BufferViewDescriptor &bufferViewDescriptor) const
 
- Protected Member Functions inherited from AZ::RHI::DeviceObject
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.
 
- Protected Member Functions inherited from AZ::RHI::Object
void add_ref () const
 
void release () const
 
- Protected Attributes inherited from AZ::RHI::Object
AZStd::atomic_int m_useCount = 0
 

Detailed Description

Query resource for recording gpu data like occlusion, timestamp or pipeline statistics. Queries belong to a QueryPool and their types are determined by the pool.

Member Function Documentation

◆ Begin()

ResultCode AZ::RHI::Query::Begin ( CommandList commandList,
QueryControlFlags  flags = QueryControlFlags::None 
)

Begin recording of a query. Timestamp queries don't support a "Begin" operation.

Parameters
commandListCommand list for begin recording into the query.
flagsControl how the query will begin recording the information.

◆ End()

ResultCode AZ::RHI::Query::End ( CommandList commandList)

End recording of a query. Queries must be began before they can be ended. Timestamp queries don't support an "End" operation.

Parameters
commandListCommand list for end recording into the query. Must be the same command list used for beginning the query.

◆ ReportMemoryUsage()

void AZ::RHI::Query::ReportMemoryUsage ( MemoryStatisticsBuilder builder) const
overridevirtual

Reports memory usage of this image to the memory statistics builder.

Implements AZ::RHI::Resource.

◆ WriteTimestamp()

ResultCode AZ::RHI::Query::WriteTimestamp ( CommandList commandList)

Writes the GPU timestamp into a query. Only timestamp queries support this function.

Parameters
commandListCommand list used for end recording into the query.

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