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

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

#include <FrameProcessing.h>

Collaboration diagram for Engine::Ecs::TextureAssetPipeline:

Public Member Functions

 TextureAssetPipeline (Assets::TextureAssetManager *textureAssetManager, NamedThreadPool *assetLoaderPool)
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 ()

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::TextureAssetManagertextureAssetManager_ = nullptr
Core::RenderingDataManager * renderingDataManager_ = nullptr
NamedThreadPoolassetLoaderPool_ = nullptr
std::vector< std::filesystem::path > assetQueue_
std::vector< std::filesystem::path > ktx2Queue_
std::vector< ExrHeaderFutureexrHeaderFutures_
std::vector< AssetLoadingImageimageFutures_
std::vector< Ktx2LoadFuturektx2LoadFutures_
size_t maxTexturesPerFrame_ = 16
 Rate limit for texture processing per frame.

Detailed Description

Infrastructure to load images into the ecs.

Definition at line 41 of file FrameProcessing.h.

Constructor & Destructor Documentation

◆ TextureAssetPipeline()

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

Member Function Documentation

◆ discardPendingWork()

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

◆ 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 77 of file FrameProcessing.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 71 of file FrameProcessing.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 65 of file FrameProcessing.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 91 of file FrameProcessing.h.

◆ assetQueue_

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

Definition at line 93 of file FrameProcessing.h.

Referenced by getPendingCount().

◆ exrHeaderFutures_

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

Definition at line 95 of file FrameProcessing.h.

Referenced by getPendingCount().

◆ imageFutures_

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

Definition at line 96 of file FrameProcessing.h.

Referenced by getPendingCount().

◆ ktx2LoadFutures_

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

Definition at line 97 of file FrameProcessing.h.

Referenced by getPendingCount().

◆ ktx2Queue_

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

Definition at line 94 of file FrameProcessing.h.

◆ maxTexturesPerFrame_

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

Rate limit for texture processing per frame.

Definition at line 99 of file FrameProcessing.h.

Referenced by setMaxTexturesPerFrame().

◆ renderingDataManager_

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

Definition at line 90 of file FrameProcessing.h.

Referenced by setRenderingDataManager().

◆ textureAssetManager_

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

Definition at line 89 of file FrameProcessing.h.


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