|
Vulkan Schnee 0.0.1
High-performance rendering engine
|
#include <AssetManager.h>
Public Types | |
| using | AudioAssetRef = Assets::AudioAssetRef |
| using | MaterialAssetRef = Assets::MaterialAssetRef |
| using | MeshAssetRef = Assets::MeshAssetRef |
| using | TextureAssetRef = Assets::TextureAssetRef |
Public Member Functions | |
| template<typename AssetClass, typename Key> | |
| auto | getAsset (const Key &asset) |
| AssetManager () | |
| AssetManager (ApplicationContext *context) | |
| ~AssetManager () | |
| void | attachToRenderer (Rendering::Renderer *renderer) |
| Sets what renderer the render process belongs to. | |
| void | setRenderingDataManager (RenderingDataManager *renderingDataManager) |
| Sets the RenderingDataManager on asset pipelines for hook notifications. | |
| Assets::CubemapTexture * | loadEcsCubemap (const std::filesystem::path &path) |
| Loads a six-face cubemap asset from a directory. | |
| uint32_t | getTextureDescriptorIndex (const std::filesystem::path &path) |
| Gets the descriptor index of a loaded texture by path. | |
| uint32_t | getImageCount () const |
| void | cleanup () |
| std::vector< VkDescriptorImageInfo > | getTextureDescriptorInfos () const |
| Ecs::TextureAssetPipeline & | getTextureAssetPipeline () |
| Ecs::ModelAssetPipeline & | getMeshAssetPipeline () |
| Ecs::AudioAssetPipeline & | getAudioAssetPipeline () |
| void | unloadAllData () |
| void | discardSceneLoadingData () |
| Drops any queued or in-flight scene asset loading work. | |
| AudioAssetRef | loadAudioAsset (const std::filesystem::path &path) |
| Submit an audio file for async loading through the pipeline. | |
| Assets::Audio * | getAudioAsset (const std::filesystem::path &path) |
| Get a loaded audio asset by path. | |
| Assets::AudioAssetManager * | getAudioAssetManager () const |
| Gets the audio asset manager for direct access. | |
| Assets::MaterialAssetManager * | getMaterialAssetManager () const |
| Gets the material asset manager for material lookups. | |
| Assets::ModelAssetManager * | getModelAssetManager () const |
| Gets the model asset manager for model/GLTF file loading state lookups. | |
| Assets::MeshAssetManager * | getMeshAssetManager () const |
| Gets the mesh asset manager for mesh asset lookups. | |
| Assets::Textures::TextureHandleRegistry * | getTextureHandleRegistry () |
| Gets the texture handle registry for O(1) descriptor index lookups. | |
| NamedThreadPool * | getCalculationPool () const |
| NamedThreadPool * | getAssetLoaderPool () const |
Private Member Functions | |
| void | loadEcsModel (const std::filesystem::path &path) |
| Submits a gltf model for loading. You provide the path of the model to load. This can include 3D data, materials and textures. | |
| void | loadEcsTexture (const std::filesystem::path &path) |
| Loads a texture (.png / .jpg / .exr) | |
| Assets::Mesh * | getMeshAsset (const Asset::Path &asset) |
| Get a mesh asset by path. If not loaded, requests its model and returns nullptr. | |
| bool | doesTextureAlreadyExist (const std::filesystem::path &path) |
| Checks if a texture has already been loaded. | |
| Assets::RuntimeTexture * | registerTexture (const std::filesystem::path &path, Assets::RuntimeTexture texture) |
| Registers a texture with the texture manager which prevents the same texture from being loaded twice. | |
| Assets::RuntimeTexture * | registerTextureFromPrepared (const std::filesystem::path &path, Assets::RuntimeTexture texture) |
| Register a texture whose Vulkan resources are already created. Skips createResources() — only allocates a descriptor index and queues for GPU upload. Used by the async texture preparation pipeline. | |
| Assets::RuntimeTexture * | replaceTextureFromPrepared (const std::filesystem::path &path, Assets::RuntimeTexture texture) |
| Replace an already registered texture while preserving its descriptor index. | |
| void | unregisterTexture (Assets::RuntimeTexture *texture) |
| void | unloadRuntimeTextures () |
Definition at line 133 of file AssetManager.h.
Definition at line 140 of file AssetManager.h.
Definition at line 141 of file AssetManager.h.
Definition at line 142 of file AssetManager.h.
Definition at line 143 of file AssetManager.h.
| Engine::Core::AssetManager::AssetManager | ( | ) |
| Engine::Core::AssetManager::AssetManager | ( | ApplicationContext * | context | ) |
References ApplicationContext, and context.
| Engine::Core::AssetManager::~AssetManager | ( | ) |
| void Engine::Core::AssetManager::attachToRenderer | ( | Rendering::Renderer * | renderer | ) |
Sets what renderer the render process belongs to.
| renderer | Where the render process belongs to |
References renderer.
| void Engine::Core::AssetManager::cleanup | ( | ) |
| void Engine::Core::AssetManager::discardSceneLoadingData | ( | ) |
Drops any queued or in-flight scene asset loading work.
|
private |
Checks if a texture has already been loaded.
| path | the path of the texture on disk |
|
inlinenodiscard |
Definition at line 146 of file AssetManager.h.
References getMeshAsset(), loadAudioAsset(), loadEcsTexture(), Asset::LOADED, Asset::LOADING, materialAssetManager, meshAssetManager, Asset::REQUESTED_LOAD, and textureAssetManager.
|
inline |
Definition at line 357 of file AssetManager.h.
References threadPool_.
|
nodiscard |
Get a loaded audio asset by path.
| path | The path used when loading |
|
inlinenodiscard |
Gets the audio asset manager for direct access.
Definition at line 283 of file AssetManager.h.
References audioAssetManager_.
| Ecs::AudioAssetPipeline & Engine::Core::AssetManager::getAudioAssetPipeline | ( | ) |
|
inline |
Definition at line 352 of file AssetManager.h.
References threadedCalculation_.
| uint32_t Engine::Core::AssetManager::getImageCount | ( | ) | const |
|
inlinenodiscard |
Gets the material asset manager for material lookups.
Definition at line 299 of file AssetManager.h.
References materialAssetManager.
|
nodiscardprivate |
Get a mesh asset by path. If not loaded, requests its model and returns nullptr.
| asset | Path to the mesh asset |
Referenced by getAsset().
|
inlinenodiscard |
Gets the mesh asset manager for mesh asset lookups.
Definition at line 317 of file AssetManager.h.
References meshAssetManager.
| Ecs::ModelAssetPipeline & Engine::Core::AssetManager::getMeshAssetPipeline | ( | ) |
|
inlinenodiscard |
Gets the model asset manager for model/GLTF file loading state lookups.
Definition at line 308 of file AssetManager.h.
References modelAssetManager.
| Ecs::TextureAssetPipeline & Engine::Core::AssetManager::getTextureAssetPipeline | ( | ) |
|
nodiscard |
Gets the descriptor index of a loaded texture by path.
| path | Path to the texture (relative or absolute) |
| std::vector< VkDescriptorImageInfo > Engine::Core::AssetManager::getTextureDescriptorInfos | ( | ) | const |
|
inlinenodiscard |
Gets the texture handle registry for O(1) descriptor index lookups.
Definition at line 326 of file AssetManager.h.
References textureHandleRegistry_.
| AudioAssetRef Engine::Core::AssetManager::loadAudioAsset | ( | const std::filesystem::path & | path | ) |
Submit an audio file for async loading through the pipeline.
| path | Relative path to the audio file (WAV, FLAC, MP3) |
Referenced by getAsset().
| Assets::CubemapTexture * Engine::Core::AssetManager::loadEcsCubemap | ( | const std::filesystem::path & | path | ) |
Loads a six-face cubemap asset from a directory.
|
private |
Submits a gltf model for loading. You provide the path of the model to load. This can include 3D data, materials and textures.
| path | Where the gltf file is |
|
private |
Loads a texture (.png / .jpg / .exr)
| path | where the texture is |
Referenced by getAsset().
|
private |
Registers a texture with the texture manager which prevents the same texture from being loaded twice.
| path | path to the texture |
| texture | the texture to register |
|
private |
Register a texture whose Vulkan resources are already created. Skips createResources() — only allocates a descriptor index and queues for GPU upload. Used by the async texture preparation pipeline.
| path | Path to the texture (used as key) |
| texture | Texture with VkImage/VkImageView/VkSampler already created |
|
private |
Replace an already registered texture while preserving its descriptor index.
| void Engine::Core::AssetManager::setRenderingDataManager | ( | RenderingDataManager * | renderingDataManager | ) |
Sets the RenderingDataManager on asset pipelines for hook notifications.
| renderingDataManager | Pointer to the RenderingDataManager |
References RenderingDataManager.
| void Engine::Core::AssetManager::unloadAllData | ( | ) |
|
private |
|
private |
|
private |
Definition at line 135 of file AssetManager.h.
Referenced by AssetManager().
|
private |
Definition at line 348 of file AssetManager.h.
Referenced by getAudioAssetManager().
|
private |
Definition at line 349 of file AssetManager.h.
|
private |
Definition at line 365 of file AssetManager.h.
Referenced by AssetManager().
|
private |
Definition at line 369 of file AssetManager.h.
|
private |
Definition at line 363 of file AssetManager.h.
|
private |
Definition at line 338 of file AssetManager.h.
Referenced by getAsset(), and getMaterialAssetManager().
|
private |
Definition at line 337 of file AssetManager.h.
Referenced by getAsset(), and getMeshAssetManager().
|
private |
Definition at line 339 of file AssetManager.h.
Referenced by getModelAssetManager().
|
private |
Definition at line 346 of file AssetManager.h.
|
private |
Definition at line 366 of file AssetManager.h.
Referenced by attachToRenderer().
|
private |
Definition at line 136 of file AssetManager.h.
Referenced by setRenderingDataManager().
|
private |
Definition at line 373 of file AssetManager.h.
|
private |
Definition at line 335 of file AssetManager.h.
Referenced by getAsset().
|
private |
Definition at line 372 of file AssetManager.h.
|
private |
Registry for type-safe texture handles.
Definition at line 344 of file AssetManager.h.
Referenced by getTextureHandleRegistry().
|
private |
Definition at line 370 of file AssetManager.h.
|
private |
Definition at line 414 of file AssetManager.h.
|
private |
Definition at line 336 of file AssetManager.h.
|
private |
Definition at line 368 of file AssetManager.h.
|
private |
Definition at line 417 of file AssetManager.h.
|
private |
Definition at line 416 of file AssetManager.h.
|
private |
Definition at line 333 of file AssetManager.h.
Referenced by getCalculationPool().
|
private |
Definition at line 332 of file AssetManager.h.
Referenced by getAssetLoaderPool().