Class ResourceExperiment
Defined in File experiment.h
Nested Relationships
Nested Types
Inheritance Relationships
Base Type
public gpa::playback::BaseExperiment
(Class BaseExperiment)
Class Documentation
-
class ResourceExperiment : public gpa::playback::BaseExperiment
Provides functionality to perform resource modifications to a stream, such as replacing textures for bindings.
Public Types
-
typedef uint64_t UserResourceID
Public Functions
-
ResourceExperiment()
Creates an instance of ResourceExperiment.
-
ResourceExperiment(ResourceExperiment const &other)
Creates an instance of ResourceExperiment from a given ResourceExperiment.
- Parameters
other -- The ResourceExperiment to copy from
-
ResourceExperiment &operator=(ResourceExperiment const &other)
Creates an instance of ResourceExperiment from a given ResourceExperiment.
- Parameters
other -- The ResourceExperiment to copy from
- Returns
This ResourceExperiment after copying from the given ResourceExperiment
-
ResourceExperiment(ResourceExperiment &&other)
Moves an instance of ResourceExperiment from a given ResourceExperiment.
- Parameters
other -- The ResourceExperiment to move from
-
ResourceExperiment &operator=(ResourceExperiment &&other)
Moves an instance of ResourceExperiment from a given ResourceExperiment.
- Parameters
other -- The ResourceExperiment to move from
- Returns
This ResourceExperiment after moving from the given ResourceExperiment
-
bool operator!=(ResourceExperiment const &other) const
Gets a value indicating whether or not a given ResourceExperiment is inequal to this ResourceExperiment.
- Parameters
other -- The ResourceExperiment to compare for inequlaity
- Returns
Whether or not the given ResourceExperiment is inequal to this ResourceExperiment
-
void SetImageData(UserResourceID id, void const *pixels, ImageMetadata const &metadata)
Hands over user resource data to the ResourceExperiment that the user would like to use when making a binding modification later.
This call must be made before requesting to set an image on a binding.
- Parameters
The -- unique ID that will be associated with this user data. This is primarily used to prevent duplicating data and make resource data retrieval more efficient.
pixels -- The binary image data to save and associate with id
metadata -- Metadata about pixels, which is used to interpret the data when applying this experiment.
-
void SetImageAtBinding(UserResourceID id, uint64_t set, uint64_t binding, uint64_t arrayIndex = 0)
Requests that the resource associated with the given ID is set at the given binding.
This essentially requests a modification to the current resource bindings in the stream being analyzed.
- Parameters
id -- The ID associated with the resource that should be set.
set -- The index of the descriptor set, if applicable.
binding -- The index of the binding slot (within a descriptor set, if applicable).
arrayIndex -- The array index within a descriptor binding, if applicable.
-
void SetSamplerSettings(SamplerSettings *settings, uint64_t count, bool overrideAllSamplers)
Requests that certain sampler settings are applied.
Users should provide either one SamplerSettings per sampler, or provide one sampler and set the overrideAllSamplers option to true, this will use the single provided SamplerSetting for all samplers
- Parameters
settings -- A pointer to an array of SamplerSetting objects.
count -- The number of settings in the array.
overrideAllSamplers -- A flag that signals if settings[0] should be applied to all current samplers.
-
void RemoveImageData(UserResourceID id)
Disassociates the image associated with the given ID and removes its data on this ResourceExperiment.
-
void RemoveImageBinding(uint64_t set, uint64_t binding, uint64_t arrayIndex = 0)
Undos any currently set modification made to the given resource binding.
- Parameters
set -- The index of the descriptor set, if applicable.
binding -- The index of binding slot (within a descriptor set, if applicable).
arrayIndex -- The array index within a descriptor binding, if applicable.
-
void ClearAllImageBindings()
Removes all resource binding modifications set by SetImageAtBinding().
-
void GetImageList(UserResourceID *ids, size_t *count) const
Retrieves the full list of image IDs given set on this ResourceExperiment.
Call the method once first with null ids to retrieve the count.
-
void GetImageBindings(ImageBinding *bindings, size_t *count) const
Returns the list of binding modifications currently requested on this experiment.
Call the method once first with null bindings to retrieve the count.
-
void GetSamplerSettings(SamplerSettings *settings, size_t *count) const
Returns the list of SamplerSettings requested on this experiment.
Call the method once first with null bindings to retrieve the count.
-
bool GetSamplerOverride() const
returns the flag indicating if one SamplerSetting should override all current samplers.
-
ImageData const *GetImageData(UserResourceID id) const
Returns the image data associated with the given UserResourceID.
Protected Attributes
-
std::vector<ImageBinding> mImageBindings
-
std::vector<SamplerSettings> mSamplerSettings
-
bool mOverrideAllSamplers = false
-
struct ImageBinding
Represents a location for a user resource to be bound during execution.
Public Members
-
UserResourceID handle
The ID associated with the user image data.
-
uint64_t binding
The index of binding slot (within a descriptor set, if applicable).
-
uint64_t set
The index of the descriptor set, if applicable.
-
uint64_t arrayIndex
The array index within a descriptor binding, if applicable.
-
UserResourceID handle
-
struct ImageData
Data associated with an image given by the user.
Public Members
-
UserResourceID handle
The ID associated with the user image data.
-
std::vector<uint8_t> data
The binary data of the user image.
-
ImageMetadata metadata
Metadata about the user image so it can be interpreted.
See also
-
UserResourceID handle
-
struct ImageMetadata
Information about an user image so that an image data blob can be interpreted.
Public Members
-
uint32_t totalSize
-
uint32_t width
-
uint32_t height
-
uint32_t depth
Depth value of the 3d texture. Default value: 0.
-
uint32_t slices
One slice describes one texture and all its subresources. Default number of slices: 1.
-
uint32_t mips
The number of MIP levels. Default value: 1 (no additional MIP levels).
-
uint64_t format
-
uint32_t totalSize
-
class Prefab : public gpa::playback::BaseExperiment::Prefab
Provides a common base and interface for ResourceExperiment prefabs.
Subclassed by gpa::playback::TwoByTwoTextureReplacementExperiment
-
struct SamplerSettings
-
typedef uint64_t UserResourceID