Class Experimentor
Defined in File experimentor.h
Inheritance Relationships
Base Types
public gpa::playback::CallableReceiver
(Class CallableReceiver)public gpa::playback::CallableBroadcaster
(Class CallableBroadcaster)public gpa::playback::CallableCallbacks
(Class CallableCallbacks)
Class Documentation
-
class Experimentor : public gpa::playback::CallableReceiver, public gpa::playback::CallableBroadcaster, public gpa::playback::CallableCallbacks
Provides an API agnostic interface for applying Experiments.
Public Functions
-
Experimentor()
Contructs this instance of Experimentor.
-
virtual ~Experimentor() = 0
Destroys this instance of Experimentor.
-
virtual Shader::Compiler const &GetShaderCompiler() const = 0
Gets this Experimentor's Shader::Compiler.
- Returns
This Experimentor's Shader::Compiler
-
void Apply(uint64_t startIndex, uint64_t endIndex, BaseExperiment const &experiment, size_t prefabCount = 0, BaseExperiment::Prefab const *pPrefabs = nullptr)
Applies an Experiment to a range of Callables.
- Parameters
startIndex -- The index of the first Callable at which to apply the Experiment
endIndex -- The index of the last Callable at which to apply the Experiment
experiment -- The Experiment to apply to the given range of Callables
prefabCount -- The number of Experiment::Prefabs to apply to the given range of Callables (optional = 0)
pPrefabs -- A pointer to prefabCount Experiment::Prefabs to apply to the given range of Callables (optional = nullptr)
-
void Apply(uint64_t callIndex, BaseExperiment const &experiment, size_t prefabCount = 0, BaseExperiment::Prefab const *pPrefabs = nullptr)
Applies an Experiment at a given Callable index.
- Parameters
callIndex -- The index of the Callable at which to apply the Experiment
experiment -- The Experiment to apply to the Callable at the given callIndex
prefabCount -- The number of Experiment::Prefabs to apply to the Callable at the given callIndex (optional = 0)
pPrefabs -- A pointer to prefabCount Experiment::Prefabs to apply to the Callable at the given callIndex (optional = nullptr)
-
void Apply(uint64_t startIndex, uint64_t endIndex, size_t prefabCount, BaseExperiment::Prefab const *pPrefabs)
Applies Experiment::Prefabs to a range of Callables.
- Parameters
startIndex -- The index of the first Callable at which to apply the Experiment::Preabs
endIndex -- The index of the last Callable at which to apply the Experiment::Prefabs
prefabCount -- The number of Experiment::Prefabs to apply to the given range of Callables
pPrefabs -- A pointer to prefabCount Experiment::Prefabs to apply to the given range of Callables
-
void Apply(uint64_t callIndex, size_t prefabCount, BaseExperiment::Prefab const *pPrefabs)
Applies Experiment::Prefabs at a given Callable index.
-
virtual void Clear(uint64_t startIndex, uint64_t endIndex)
Clears all Experiments from a range of Callables.
-
virtual void Clear(uint64_t callIndex)
Clears all Experiments at a given Callable index.
- Parameters
callIndex -- The index of the Callable at which to clear Experiments
-
virtual void Clear()
Clears all Experiments.
-
virtual void ConnectExecutionCallbacks(ExecutionCallbacks const &callbacks) override
Connects this Experimentor's ExecutionCallbacks.
Note
If this method is overriden, the base implementation must be called
- Parameters
callbacks -- The ExecutionCallbacks to connect this Experimentor to
-
virtual void DisconnectExecutionCallbacks() override
Disconnects this Experimentor's ExecutionCallbacks.
-
bool IsEnabled() const
Gets a value indicating whether or not this Experimentor is enabled.
- Returns
Whether or not this Experimentor is enabled
-
void IsEnabled(bool enabled)
Sets a value indicating whether or not this Experimentor is enabled.
- Parameters
enabled -- Whether or not this Experimentor is enabled
-
void GetMessages(size_t *pMessageCount, char const **pMessages) const
Returns any messages (info, error) generated by the Experimentor.
Note
The messages returned from this method are invalidated when a new playback is run using this applied Experimentor
Note
Call this method with nullptr for pMessageCount to populate only the pSizeBytes argument
Note
Messages will be provided as null terminated C strings
Note
Providing an array that isn't large enough results in undefined behavior
- Parameters
pMessageCount -- [out] The number of messages generated during the most recent playback where this Experimentor was applied
pMessages -- [out] A pointer to a preallocated array of char const pointers to populate with messages
-
std::vector<ExperimentError> const &GetExperimentErrors() const
Protected Functions
-
virtual void ApplyPrefabs(uint64_t startIndex, uint64_t endIndex, size_t prefabCount, BaseExperiment::Prefab const *pPrefabs)
This method should be overriden to recieve calls when this Experimentor has Experiment::Prefabs applied.
- Parameters
startIndex -- The index of the first Callable at which to apply the Experiment::Prefab
endIndex -- The index of the last Callable at which to apply the Experiment::Prefab
prefabCount -- The number of Experiment::Prefabs to apply to the given range of Callables
pPrefabs -- A pointer to prefabCount Experiment::Prefabs to apply to the given range of Callables
-
virtual void OnPostSetupRange(CallableCache *range)
This method should be overriden to recieve calls when the given range has copmpleted setup
NOTE : This method will only be called if this
Experimentor is enabled.- Parameters
range -- The CallableCache to execute Experiments on
-
virtual void OnPreExecuteRange(CallableCache *range)
This method should be overriden to recieve calls when the given range is ready for execution
NOTE : This method will only be called if this
Experimentor is enabled.- Parameters
range -- The CallableCache to execute Experiments on
-
virtual void OnPreExecuteCall(Callable *callable, uint64_t callIndex)
This method should be overriden to recieve calls when the given Callable
is ready for execution
NOTE : This method will only be called if this
Experimentor is enabled.
-
virtual void OnPostExecuteCall(Callable *callable, uint64_t callIndex)
This method should be overriden to recieve calls when the given Callable
has completed execution
NOTE : This method will only be called if this
Experimentor is enabled.
-
virtual void OnPostExecuteRange(CallableCache *range)
This method should be overriden to recieve calls when the given range has completed execution
NOTE : This method will only be called if this
Experimentor is enabled.- Parameters
range -- The CallableCache to execute Experiments on
-
virtual void PushMessage(char const *msg)
Appends a new message to the list of messages.
- Parameters
msg -- The message to save
-
virtual void AddExperimentError(ExperimentError const &experimentError)
Appends a new error during experiment.
Protected Attributes
-
Collection<PipelineExperiment> mGraphicsPipelineExperiments
-
Collection<ResourceExperiment> mResourceExperiments
-
Messages *mMessages = nullptr
-
std::vector<ExperimentError> mExperimentErrors
-
Experimentor()