|
Vulkan Schnee 0.0.1
High-performance rendering engine
|
#include <AssetManager.h>
Public Types | |
| using | AudioAssetRef = Assets::AudioAssetRef |
| using | AnimationAssetRef = Assets::AnimationAssetRef |
| using | MaterialAssetRef = Assets::MaterialAssetRef |
| using | MeshAssetRef = Assets::MeshAssetRef |
| using | SkinAssetRef = Assets::SkinAssetRef |
| 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 Asset::Path &path) |
| Submit an audio file for async loading through the pipeline. | |
| Assets::Audio * | getAudioAsset (const Asset::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::SkinAssetManager * | getSkinAssetManager () const |
| Assets::AnimationAssetManager * | getAnimationAssetManager () const |
| Assets::Textures::TextureHandleRegistry * | getTextureHandleRegistry () |
| Gets the texture handle registry for O(1) descriptor index lookups. | |
| uint32_t | reserveRuntimeTextureDescriptorIndex () |
| void | releaseRuntimeTextureDescriptorIndex (uint32_t descriptorIndex) |
| 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::MeshPath &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 153 of file AssetManager.h.
Definition at line 161 of file AssetManager.h.
Definition at line 160 of file AssetManager.h.
Definition at line 162 of file AssetManager.h.
Definition at line 163 of file AssetManager.h.
Definition at line 164 of file AssetManager.h.
Definition at line 165 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 379 of file AssetManager.h.
References animationAssetManager_.
|
inlinenodiscard |
Definition at line 168 of file AssetManager.h.
References animationAssetManager_, Asset::Path::getFilePath(), getMeshAsset(), loadAudioAsset(), loadEcsModel(), loadEcsTexture(), Asset::LOADED, Asset::LOADING, materialAssetManager, meshAssetManager, Asset::REQUESTED_LOAD, skinAssetManager_, textureAssetManager, and Asset::UNLOADED.
|
inline |
Definition at line 433 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 333 of file AssetManager.h.
References audioAssetManager_.
| Ecs::AudioAssetPipeline & Engine::Core::AssetManager::getAudioAssetPipeline | ( | ) |
|
inline |
Definition at line 428 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 351 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 369 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 360 of file AssetManager.h.
References modelAssetManager.
|
inlinenodiscard |
Definition at line 374 of file AssetManager.h.
References skinAssetManager_.
| 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 388 of file AssetManager.h.
References textureHandleRegistry_.
| AudioAssetRef Engine::Core::AssetManager::loadAudioAsset | ( | const Asset::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 |
Referenced by getAsset().
|
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 |
| void Engine::Core::AssetManager::releaseRuntimeTextureDescriptorIndex | ( | uint32_t | descriptorIndex | ) |
Release a descriptor index previously reserved with reserveRuntimeTextureDescriptorIndex().
|
private |
Replace an already registered texture while preserving its descriptor index.
|
nodiscard |
Reserve a stable texture-array descriptor index for a runtime-generated sampled image. The caller owns descriptor writes and must release the index when the runtime image is destroyed.
| 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 414 of file AssetManager.h.
Referenced by getAnimationAssetManager(), and getAsset().
|
private |
Definition at line 155 of file AssetManager.h.
Referenced by AssetManager().
|
private |
Definition at line 424 of file AssetManager.h.
Referenced by getAudioAssetManager().
|
private |
Definition at line 425 of file AssetManager.h.
|
private |
Definition at line 441 of file AssetManager.h.
Referenced by AssetManager().
|
private |
Definition at line 446 of file AssetManager.h.
|
private |
Definition at line 439 of file AssetManager.h.
|
private |
Definition at line 411 of file AssetManager.h.
Referenced by getAsset(), and getMaterialAssetManager().
|
private |
Definition at line 410 of file AssetManager.h.
Referenced by getAsset(), and getMeshAssetManager().
|
private |
Definition at line 412 of file AssetManager.h.
Referenced by getModelAssetManager().
|
private |
Definition at line 422 of file AssetManager.h.
|
private |
Definition at line 442 of file AssetManager.h.
Referenced by attachToRenderer().
|
private |
Definition at line 156 of file AssetManager.h.
Referenced by setRenderingDataManager().
|
private |
Definition at line 451 of file AssetManager.h.
|
private |
Definition at line 413 of file AssetManager.h.
Referenced by getAsset(), and getSkinAssetManager().
|
private |
Definition at line 450 of file AssetManager.h.
|
private |
Definition at line 408 of file AssetManager.h.
Referenced by getAsset().
|
private |
Definition at line 449 of file AssetManager.h.
|
private |
Registry for type-safe texture handles.
Definition at line 420 of file AssetManager.h.
Referenced by getTextureHandleRegistry().
|
private |
Definition at line 447 of file AssetManager.h.
|
private |
Definition at line 495 of file AssetManager.h.
|
private |
Definition at line 409 of file AssetManager.h.
|
private |
Definition at line 444 of file AssetManager.h.
|
private |
Definition at line 498 of file AssetManager.h.
|
private |
Definition at line 497 of file AssetManager.h.
|
private |
Definition at line 406 of file AssetManager.h.
Referenced by getCalculationPool().
|
private |
Definition at line 405 of file AssetManager.h.
Referenced by getAssetLoaderPool().