Class Player

Class Documentation

class Player

Public Functions

Player(TCHAR const *const *prePlaybackLayers, TCHAR const *const *postPlaybackLayers, serialization::Storage *resourceStorage, playback::IPlaybackListener *playbackListener, LayerArgLookup const *argLookup = nullptr, bool enableD3D12DDIHooks = true)

Sets up player class and loads the given layers.

Note

The "playback-layer" is always loaded. It will be inserted in between the pre and post playback layers.

Parameters
  • prePlaybackLayers -- Layers that will be executed before the recorded call is played back. If not null, the last entry must be null.

  • postPlaybackLayers -- Layers that will be executed after the recorded call is played back. If not null, the last entry must be null.

  • resourceStorage -- resource storage belonging to the stream to be played back. This parameter must be valid.

  • playbackListener -- pointer to what acts on callbacks resulting from playback, such as window resizing. This parameter must be valid.

  • argLookup -- a mapping of layer names to a list of parameters to be passed to that specific layer. Not every layer accepts parameters.

Player(TCHAR const *const *prePlaybackLayers, TCHAR const *const *postPlaybackLayers, serialization::Storage *resourceStorage, playback::IPlaybackListener *playbackListener, STD_STRING const &processNameOverride, LayerArgLookup const *argLookup = nullptr, bool enableD3D12DDIHooks = true)

The player constructor allowing immediate process name override.

~Player()
bool UpdateContext(Callable *callable, bool isRepeating = false, uint64_t repeatPass = 0)

Updates the playback context for the given callable, prepping it for use in playback operations.

Parameters
  • callable -- The callable whose context should be updated.

  • isRepeating -- True if we are currently playing iterations of a range of calls; this triggers special range repeat state collection during the range.

  • repeatPass -- The current iteration of the range being played; 0 if this is the first time the call is encountered.

bool Play(Callable *callable, bool isRepeating = false, bool isRepeated = false, uint64_t repeatPass = 0, bool releaseCallableResources = true, bool shouldExecute = true)

Plays the given callable.

This reads the callable data (if needed), executes it, and performs any other playback logic in order for the call to successfully execute.

Parameters
  • callable -- The callable to execute.

  • isRepeating -- True if we are currently playing iterations of a range of calls; this triggers special range repeat state collection during the range.

  • isRepeated -- True if we should collect state information important for range repeat or other data extraction.

  • repeatPass -- The current iteration of the range being played; 0 if this is the first time the call is encountered.

  • releaseCallableResources -- Whether or not to release callable resources after execution.

gpa::Surface *RequestSurface(SurfaceCreateInfo const &surfaceCreateInfo)

Requests a Surface that fulfills the given SurfaceCreateInfo.

This method is a request and may not be fulfilled, for example with offscreen rendering enabled no surface will be created

Parameters

surfaceCreateInfo -- The creation parameters for the requested surface

bool Ingress(Callable *callable, const void **params = nullptr, size_t paramCount = 0)

Apply pre execution state updates for Callable context.

Parameters
  • callable -- The callable to use during the operation.

  • params -- is a caller allocated output array to contain addresses of object parameter for the call.

  • paramCount -- is the number of allocated paramValues in the array.

bool Egress(Callable *callable, bool releaseResources = false, uint64_t returnValue = 0)

Apply post execution state updates for Callable context.

Parameters
  • callable -- The callable to use during the operation.

  • releaseResources -- Whether or not to release resources.

  • returnValue -- is the user provided return value from the external call.

void SetProcessNameOverride(STD_STRING const &nameOverride)

Supply an optional name to override the reported process name. This is usually used to enable internal driver optimizations based on the current running process.

Parameters

nameOverride -- The name to return if the application queries the current process name

void SetAgilitySDKPath(TCHAR const *path)

Supply an optional path to D3D12 Agility SDK DLLs embedded in a stream, or elsewhere. If present, D3D12 device creation will use this path to locate the runtime DLLs to load.

Parameters

sdkPathRoot -- Relative or absolute path to location of versioned D3D12 runtime DLLs. This will typically be <stream folder>\D3D12, and this location will contain additional folders, one per SDK version captured.