Class RangeRepeatCache

Inheritance Relationships

Base Type

Derived Type

Class Documentation

class RangeRepeatCache : public gpa::capture_support::ObjectData

Used to collect and track state of objects during playback for range repeat.

These caches are created during invocation of FunctionCall::Pre/PostPlaybackBeforeRepeat as new objects are created during playback. Subclasses of this class have unique state that can be updated over time as the FunctionCall::Pre/PostPlaybackBefore/DuringRepeat methods are called during playback.

Subclassed by gpa::playback::repeat::RangeRepeatCacheForCommandBuffers

Public Types

typedef std::shared_ptr<RangeRepeatCache> Ptr

Public Functions

RangeRepeatCache(playback::Context *context, playback::Callable *creationCallable)
virtual ~RangeRepeatCache()
void SetObject(uint64_t captureKey, void *liveObject)

Sets the live object associated with this cache and its capture time key.

uint64_t GetObjectKey() const

Returns the capture key of the object associated with this cache.

void *Object() const

Returns the live object pointer associated with this cache.

virtual void OnQueueSynchronizationRequired(GPADispatchTable const *&table)

This should be called when queues need to be synchronized.

virtual void OnRangeEnter(GPADispatchTable const *&table)

This should be called when we reach the range of interest for the first time.

This could be where some state of an object is snapshotted, resource data is copied, or any other special handling that should be done up front that will be needed while we are repeating the range.

virtual void OnRangeCollected(GPADispatchTable const *&table)

This is called after we finish collecting / processing the range of interest the first time it's seen, but before any replays are executed.

virtual void OnRangeRepeatRecreateObject(GPADispatchTable const *&table, uint64_t repeatPass)

This should be called when we repeat the range of interest before state restoration.

This could be where the object is recreated if it was destroyed during repeat in order to replay the range again.

virtual void OnRangeRepeatDestroyObject(GPADispatchTable const *&table, uint64_t repeatPass)

This should be called when we repeat the range of interest before state restoration.

This could be where the object is destroyed if it was created during repeat in order to replay the range again.

virtual void OnRangeRepeatRestoreState(GPADispatchTable const *&table, uint64_t repeatPass)

This should be called when we repeat the range of interest after object recreation.

This could be where the state of an object is restored in order to replay the range again.

virtual void OnRangeExit(GPADispatchTable const *&table)

This should be called when we go to play back the range of interest for the final time.

This could be where cleanup logic is added.

virtual void OnReleaseDuringRange(GPADispatchTable const *&table)

This should be called if the corresponding live object is deleted during the range.

bool ReleasedDuringRange()

Tells if the object was released during repeat range.

bool CreatedDuringRange()

Tells if the object was created during repeat range.

uint64_t CreatedOnRepeatPass()

Tells what repeat pass the object was created.

uint64_t CreationTimestamp()

Returns rdtsc timestamp taken when the cache object was created.

inline virtual void SetUsedInRange(bool value)

Flags the object as used in the repeat range.

inline bool UsedInRange()

Tells if the object is used in the repeat range.

Not all objects are marked as used in range

inline bool IsDestroyingObjectCreatedInRange()
serialization::PacketType GetCallApi()

Protected Attributes

void *mObject = nullptr
uint64_t mObjectKey = 0
bool mReleasedDuringRange = false
bool mCreatedDuringRange = false
uint64_t mCreatedOnRepeatPass = UINT64_MAX
playback::Context *mContext = nullptr
uint64_t mCreationTimestamp = RDTSC()
bool mUsedInRange = false
bool mDestroyingObjectCreatedInRange = false
serialization::PacketType mCallApi