#include <ImageMipChainAssetCreator.h>
Inherits AZ::RPI::AssetCreator< ImageMipChainAsset >.
Public Member Functions | |
void | Begin (const Data::AssetId &assetId, uint16_t mipLevels, uint16_t arraySize) |
void | BeginMip (const RHI::ImageSubresourceLayout &layout) |
void | AddSubImage (const void *data, size_t dataSize) |
void | EndMip () |
Ends construction of the current mip level. This must be called after adding all sub images. | |
bool | End (Data::Asset< ImageMipChainAsset > &result) |
Public Member Functions inherited from AZ::RPI::AssetCreator< ImageMipChainAsset > | |
void | SetElevateWarnings (bool elevated) |
When true, treat all subsequent warnings as errors. Any warnings already reported will not be elevated. | |
bool | GetElevateWarnings () const |
int | GetErrorCount () const |
int | GetWarningCount () const |
bool | IsFailed () const |
void | ReportError (const char *format, Args... args) |
void | ReportWarning (const char *format, Args... args) |
Additional Inherited Members | |
Protected Member Functions inherited from AZ::RPI::AssetCreator< ImageMipChainAsset > | |
AZ_DISABLE_COPY_MOVE (AssetCreator) | |
void | BeginCommon (const Data::AssetId &assetId) |
bool | EndCommon (Data::Asset< ImageMipChainAsset > &result) |
bool | ValidateIsReady () |
bool | ValidateNotNull (void *pointer, const char *name) |
Reports errors when a pointer is null. | |
bool | ValidateNotNull (const AZ::Data::Asset< AZ::Data::AssetData > &pointer, const char *name) |
bool | ValidateNotNull (const AZStd::intrusive_ptr< T > &pointer, const char *name) |
Protected Attributes inherited from AZ::RPI::AssetCreator< ImageMipChainAsset > | |
Data::Asset< ImageMipChainAsset > | m_asset |
This is the asset that subclass creators will build. | |
This class constructs an instance of an ImageMipChainAsset. It is designed to be easy-to-use in order to abstract away details of how data is packed. The API exists separately from the asset in order to promote immutability at runtime. The builder also does extensive validation to ensure that data is packed properly. (Note this class generally follows the builder design pattern, but is called a "creator" rather than a "builder" to avoid confusion with the AssetBuilderSDK).
void AZ::RPI::ImageMipChainAssetCreator::AddSubImage | ( | const void * | data, |
size_t | dataSize | ||
) |
Inserts a sub-image into the current mip level. You must call this method for each array element in the mip. Every mip level must have the same number of array elements matching arraySize passed in Begin().
void AZ::RPI::ImageMipChainAssetCreator::Begin | ( | const Data::AssetId & | assetId, |
uint16_t | mipLevels, | ||
uint16_t | arraySize | ||
) |
Begins the build process for a ImageMipChainAsset instance. Resets the builder to a fresh state.
mipLevels | The number of mip levels in the mip chain. |
arraySize | the number of sub-images within a mip level. |
void AZ::RPI::ImageMipChainAssetCreator::BeginMip | ( | const RHI::ImageSubresourceLayout & | layout | ) |
Begins construction of a new mip level in the group. The number of mips in the chain must exactly match mipLevels passed to Begin().
bool AZ::RPI::ImageMipChainAssetCreator::End | ( | Data::Asset< ImageMipChainAsset > & | result | ) |
Finalizes and assigns ownership of the asset to result, if successful. Otherwise false is returned and result is left untouched.