Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
Engine::Ecs::TextureAssetPipeline Class Reference

Infrastructure to load images into the ecs. More...

#include <TextureAssetPipeline.h>

Collaboration diagram for Engine::Ecs::TextureAssetPipeline:

Public Member Functions

 TextureAssetPipeline (Assets::TextureAssetManager *textureAssetManager, NamedThreadPool *assetLoaderPool)
 Create a texture asset loading pipeline.
void submitAsset (const std::filesystem::path &asset)
 submit the path to an asset relative from the executable to load
void tick (bool async=true)
 Advances the state machine for the entire pipeline.
void setRenderingDataManager (Engine::Core::RenderingDataManager *renderingDataManager)
 Sets the RenderingDataManager to notify when textures are loaded.
void setMaxTexturesPerFrame (size_t max)
 Sets the maximum number of textures to process per frame.
size_t getPendingCount () const
 Returns the number of textures still pending in the pipeline.
void discardPendingWork ()
 Clears all queued and in-flight texture loading work.

Private Member Functions

void requestExrHeaders (bool async=true)
void loadImageData (bool async=true)
void retrieveImageData (bool async=true)
void processKtx2Textures (bool async=true)

Private Attributes

Assets::TextureAssetManager * textureAssetManager_ = nullptr
Core::RenderingDataManager * renderingDataManager_ = nullptr
NamedThreadPool * assetLoaderPool_ = nullptr
std::vector< std::filesystem::path > assetQueue_
std::vector< std::filesystem::path > ktx2Queue_
std::vector< ExrHeaderFuture > exrHeaderFutures_
std::vector< AssetLoadingImage > imageFutures_
std::vector< Ktx2LoadFuture > ktx2LoadFutures_
size_t maxTexturesPerFrame_ = 16
 Rate limit for texture processing per frame.

Detailed Description

Infrastructure to load images into the ecs.

Definition at line 31 of file TextureAssetPipeline.h.

Constructor & Destructor Documentation

◆ TextureAssetPipeline()

Engine::Ecs::TextureAssetPipeline::TextureAssetPipeline ( Assets::TextureAssetManager * textureAssetManager,
NamedThreadPool * assetLoaderPool )

Create a texture asset loading pipeline.

Parameters
textureAssetManagerManager that owns texture asset records
assetLoaderPoolThread pool used for texture loading work

Member Function Documentation

◆ discardPendingWork()

void Engine::Ecs::TextureAssetPipeline::discardPendingWork ( )

Clears all queued and in-flight texture loading work.

◆ getPendingCount()

size_t Engine::Ecs::TextureAssetPipeline::getPendingCount ( ) const
inline

Returns the number of textures still pending in the pipeline.

Returns
Count of textures in queue + headers loading + images loading

Definition at line 72 of file TextureAssetPipeline.h.

References assetQueue_, exrHeaderFutures_, imageFutures_, and ktx2LoadFutures_.

◆ loadImageData()

void Engine::Ecs::TextureAssetPipeline::loadImageData ( bool async = true)
private

◆ processKtx2Textures()

void Engine::Ecs::TextureAssetPipeline::processKtx2Textures ( bool async = true)
private

◆ requestExrHeaders()

void Engine::Ecs::TextureAssetPipeline::requestExrHeaders ( bool async = true)
private

◆ retrieveImageData()

void Engine::Ecs::TextureAssetPipeline::retrieveImageData ( bool async = true)
private

◆ setMaxTexturesPerFrame()

void Engine::Ecs::TextureAssetPipeline::setMaxTexturesPerFrame ( size_t max)
inline

Sets the maximum number of textures to process per frame.

Parameters
maxMaximum textures to process in retrieveImageData per tick

Definition at line 66 of file TextureAssetPipeline.h.

References maxTexturesPerFrame_.

◆ setRenderingDataManager()

void Engine::Ecs::TextureAssetPipeline::setRenderingDataManager ( Engine::Core::RenderingDataManager * renderingDataManager)
inline

Sets the RenderingDataManager to notify when textures are loaded.

Parameters
renderingDataManagerPointer to the RenderingDataManager

Definition at line 60 of file TextureAssetPipeline.h.

References renderingDataManager_.

◆ submitAsset()

void Engine::Ecs::TextureAssetPipeline::submitAsset ( const std::filesystem::path & asset)

submit the path to an asset relative from the executable to load

Parameters
assetrelative path to the texture

◆ tick()

void Engine::Ecs::TextureAssetPipeline::tick ( bool async = true)

Advances the state machine for the entire pipeline.

Parameters
asyncWhether to run steps asynchronously

Member Data Documentation

◆ assetLoaderPool_

NamedThreadPool* Engine::Ecs::TextureAssetPipeline::assetLoaderPool_ = nullptr
private

Definition at line 89 of file TextureAssetPipeline.h.

◆ assetQueue_

std::vector<std::filesystem::path> Engine::Ecs::TextureAssetPipeline::assetQueue_
private

Definition at line 91 of file TextureAssetPipeline.h.

Referenced by getPendingCount().

◆ exrHeaderFutures_

std::vector<ExrHeaderFuture> Engine::Ecs::TextureAssetPipeline::exrHeaderFutures_
private

Definition at line 93 of file TextureAssetPipeline.h.

Referenced by getPendingCount().

◆ imageFutures_

std::vector<AssetLoadingImage> Engine::Ecs::TextureAssetPipeline::imageFutures_
private

Definition at line 94 of file TextureAssetPipeline.h.

Referenced by getPendingCount().

◆ ktx2LoadFutures_

std::vector<Ktx2LoadFuture> Engine::Ecs::TextureAssetPipeline::ktx2LoadFutures_
private

Definition at line 95 of file TextureAssetPipeline.h.

Referenced by getPendingCount().

◆ ktx2Queue_

std::vector<std::filesystem::path> Engine::Ecs::TextureAssetPipeline::ktx2Queue_
private

Definition at line 92 of file TextureAssetPipeline.h.

◆ maxTexturesPerFrame_

size_t Engine::Ecs::TextureAssetPipeline::maxTexturesPerFrame_ = 16
private

Rate limit for texture processing per frame.

Definition at line 97 of file TextureAssetPipeline.h.

Referenced by setMaxTexturesPerFrame().

◆ renderingDataManager_

Core::RenderingDataManager* Engine::Ecs::TextureAssetPipeline::renderingDataManager_ = nullptr
private

Definition at line 88 of file TextureAssetPipeline.h.

Referenced by setRenderingDataManager().

◆ textureAssetManager_

Assets::TextureAssetManager* Engine::Ecs::TextureAssetPipeline::textureAssetManager_ = nullptr
private

Definition at line 87 of file TextureAssetPipeline.h.


The documentation for this class was generated from the following file: