Skip to content

LiteFX::Rendering::TimingEvent

An event that is used to measure timestamps in a command queue.

Synopsis

Declared in <litefx/rendering_api.hpp>

class [[dllimport, dllexport]] TimingEvent final
    : public SharedObject

Description

Timing events are used to collect GPU time stamps asynchronously. A timing event can be inserted to a ICommandBuffer by calling ICommandBuffer::writeTimingEvent. This will cause the GPU to write the current time stamp when the command gets executed. Since command order is not preserved within command buffers, this is not guaranteed to be accurate an accurate point of time for when a certain command in order has been executed. However, since a time stamp is always written at the bottom of the pipe, the difference between two timestamps resembles the actual time the GPU was occupied with the commands between them.

Timing events are asynchronous. They are set for a certain back buffer of a ISwapChain. Reading the time stamp requires the back buffer to be ready (i.e., the frame in flight needs to have executed). The earliest point where this is guaranteed is, if the swap chain swaps to the back buffer again. This means that the time stamps issued in one frame can only be read the next time the frame's back buffer is used again.

Note that timing events are only supported on graphics and compute ICommandQueue "ICommandQueues".

Base Classes

NameDescription
SharedObjectBase class for an object that can be shared.

Type Aliases

Name
_Esft_type

Member Functions

NameDescription
TimingEvent [constructor]Constructors
~TimingEvent [destructor] [virtual]Releases the render target instance.
operator= Assignment operators
name Gets the name of the timing event.
queryId Returns the query ID for the timing event.
readTimestamp Reads the current timestamp (as a tick count) of the event.
shared_from_this Returns a shared pointer to the current object instance.
weak_from_this Returns a weak pointer to the current object instance.

Protected Types

NameDescription
Allocator An allocator used to allocate the shared object.

Protected Member Functions

NameDescription
operator= Assignment operators

Protected Static Member Functions

NameDescription
create Generic factory method used to create instances of the shared object.

Friends

NameDescription
LiteFX::SharedObject::AllocatorAn allocator used to allocate the shared object.
LiteFX::Rendering::ISwapChainInterface for a swap chain.
LiteFX::Rendering::TimingEvent::TimingEventImpl
LiteFX::PimplPtrA smart pointer that manages an implementation instance for a public interface class.

See Also

ISwapChain