|
Vulkan Schnee 0.0.1
High-performance rendering engine
|
The rendering data manager is supposed to hold all methods to update the contents of the buffers which are uploaded to the gpu. This could be culling data for example. More...
#include <RenderingDataManager.h>
Classes | |
| struct | GeometryCacheKey |
| Key for geometry cache - uniquely identifies a primitive within a mesh. Uses MeshAsset pointer and primitive index since the same MeshAsset can have multiple primitives. More... | |
| struct | GeometryCacheKeyHash |
Public Types | |
| enum class | DefaultTextureType { Normal , White , Black } |
| Get a valid texture index, substituting defaults for missing textures. More... | |
Public Member Functions | |
| RenderingDataManager (const Engine *engine, ApplicationContext *context) | |
| ~RenderingDataManager () | |
| Destructor - cleans up all GPU buffers. | |
| RenderingDataManager (const RenderingDataManager &)=delete | |
| RenderingDataManager & | operator= (const RenderingDataManager &)=delete |
| RenderingDataManager (ApplicationContext *context) | |
| Constructor for decoupled usage (e.g., testing) where Engine is not available. Dependencies must be set via setters before calling updateIfDirty(). | |
| void | setSceneManager (SceneManager *sceneManager) |
| Set the scene manager for retrieving actors. Required when Engine is null. | |
| void | setAssetManager (AssetManager *assetManager) |
| Set the asset manager for material lookups. Required when Engine is null. | |
| void | setRenderer (Renderer *renderer) |
| Set the renderer for pipeline index lookups. Required when Engine is null. | |
| void | onRenderableSpawned (MeshComponent *component) |
| Event hook which is executed when a renderable component gets added to an actor and can thus be rendered. | |
| void | onRenderableDestroyed (MeshComponent *component) |
| Event hook which is executed when a renderable component gets removed from an actor and thus has to be removed from the rendering pool. | |
| void | onMeshLoaded (MeshAsset *asset) |
| Event hook which executes when an Mesh is loaded. | |
| void | onMeshUnloaded (MeshAsset *asset) |
| Event hook which executes when a Mesh is unloaded. | |
| void | onTextureLoaded (TextureAsset *textureAsset, const std::filesystem::path &texturePath) |
| Event hook for when a texture has been loaded by the asset pipeline. Creates a Vulkan Texture from the ECS image data and registers it with AssetManager. | |
| void | onTextureUnloaded (TextureAsset *textureAsset) |
| Event hook for when a texture has been unloaded. | |
| void | onMaterialLoaded (MaterialAsset *materialAsset) |
| Event hook for when a material has been loaded. | |
| void | onMaterialUnloaded (MaterialAsset *materialAsset) |
| Event hook for when a material has been unloaded. | |
| bool | needsUpdate () const |
| Check if the rendering data needs to be rebuilt. | |
| uint64_t | getDataVersion () const |
| Get the current data version Incremented each time buffers are updated. RenderProcesses use this to know when they need to refresh their descriptor sets. | |
| void | clearDirty () |
| Clears the dirty flag after update is complete. | |
| void | processPendingMeshLoads () |
| Process pending mesh loads at a safe point in the frame. This should be called BEFORE updateIfDirty() to ensure meshes that finished loading are acknowledged before the render update begins. Meshes that load after this point will be deferred to the next frame. | |
| void | processCompletedMeshletGenerations (std::vector< Ecs::CompletedMeshletGeneration > &&completions) |
| Process completed meshlet generations and write them to the registry. This should be called at a safe point before rendering begins. | |
| bool | updateIfDirty () |
| Triggers an update of all GPU buffers if dirty. | |
| bool | updateTransforms () |
| Updates only transform-related buffers (world matrices, bounding spheres) | |
| std::vector< VulkanStagedBufferSyncObjects > & | getPendingTransformSyncObjects () |
| Get pending transform sync objects for the transfer phase. | |
| void | clearPendingTransformSyncObjects () |
| Clear pending transform sync objects after they've been recorded. | |
| const VulkanBuffer & | getPrimitiveCullingBuffer () const |
| const VulkanBuffer & | getPrimitiveMeshletBuffer () const |
| const VulkanBuffer & | getPerObjectDataBuffer () const |
| const VulkanBuffer & | getPrimitiveRenderDataBuffer () const |
| const VulkanBuffer & | getLocalBoundsBuffer () const |
| const VulkanBuffer & | getMeshletBuffer () const |
| const VulkanBuffer & | getMeshletBoundsBuffer () const |
| const VulkanBuffer & | getVertexBuffer () const |
| const VulkanBuffer & | getTriangleBuffer () const |
| const VulkanBuffer & | getMeshGeometryDataBuffer () const |
| const VulkanBuffer & | getInstanceDataBuffer () const |
| const VulkanBuffer & | getInstanceCullingDataBuffer () const |
| const VulkanBuffer & | getVSIndexBuffer () const |
| const VulkanBuffer & | getSingleMeshletGeometryBuffer () const |
| uint32_t | getSingleMeshletGeometryCount () const |
| uint32_t | getMultiMeshletGeometryCount () const |
| bool | hasVertexShaderPath () const |
| const VulkanBuffer & | getClusterLodDataBuffer () const |
| const VulkanBuffer & | getClusterGroupDataBuffer () const |
| uint32_t | getClusterCount () const |
| uint32_t | getClusterGroupCount () const |
| bool | hasLodData () const |
| uint32_t | getUniqueGeometryCount () const |
| Gets the current count of unique geometries in the buffers. | |
| uint32_t | getInstanceCount () const |
| Gets the current count of instances in the buffers. | |
| bool | isInstancingEnabled () const |
| Check if instancing mode is enabled. | |
| void | setInstancingEnabled (bool enabled) |
| Enable or disable instancing mode. | |
| std::vector< VulkanStagedBufferSyncObjects > & | getPendingSyncObjects () |
| Get pending buffer sync objects for the transfer phase These need to be recorded in the transfer command buffer. | |
| void | clearPendingSyncObjects () |
| Clear pending sync objects after they've been recorded. | |
| void | processPendingDeletions () |
| Process deferred buffer deletions Call this after all frames have completed and descriptor sets are updated. | |
| uint32_t | getPrimitiveCount () const |
| Gets the current count of primitives in the buffers. | |
| uint32_t | getMeshletCount () const |
| Gets the current count of meshlets in the buffers. | |
| void | collectMaterialsFromScene () |
| Collects all materials from loaded meshes and creates per-pipeline data This builds material-to-pipeline mappings for the rendering pipeline. | |
| PipelineNames | getPipelineForPrimitive (uint32_t primitiveId) const |
| Gets the pipeline ID (PipelineNames enum) for a given primitive. | |
| void | queueTextureForUpload (Texture *texture) |
| Queue a texture for GPU upload Called by AssetManager when a new texture is created and needs uploading. | |
| bool | hasTexturesToUpload () const |
| Check if there are textures waiting to be uploaded to GPU. | |
| std::vector< Texture * > | getTexturesToUpload () const |
| Get the list of textures waiting for GPU upload. | |
| void | clearTexturesToUpload () |
| Clear the texture upload queue after upload is complete. | |
| std::vector< VkDescriptorImageInfo > | generateTextureDescriptorInfos () const |
| Generate descriptor infos for all GPU-uploaded textures. | |
| uint32_t | getTextureCount () const |
| Get the count of textures currently on the GPU. | |
| const VulkanBuffer & | getMaterialBufferForPipeline (PipelineNames pipelineName) const |
| Get the material buffer for a specific pipeline type. | |
| void | uploadMaterialBuffers () |
| Upload material data from MaterialAssets to GPU buffers. | |
| bool | needsMaterialUpdate () const |
| Check if material buffers need updating. | |
| void | markMaterialsDirty () |
| Mark materials as dirty, requiring buffer re-upload. | |
| const VulkanBuffer & | getSHProbeBuffer () const |
| Get the SH probe buffer for spherical harmonic lighting. | |
| void | initializeSHProbeBuffer () |
| Initialize default SH probe data Sets up a single default probe with hardcoded coefficients. | |
| void | initializeDefaultTextures () |
| Queue default textures for loading via the texture pipeline. | |
| uint32_t | getValidTextureIndex (uint32_t textureIndex, DefaultTextureType defaultType) |
Private Member Functions | |
| bool | updatePrimitiveData () |
| Regenerates all buffers and the rendering ids of all objects, primitives and meshlets. | |
| bool | updatePrimitiveDataInstanced () |
| Instanced version of updatePrimitiveData using geometry deduplication. Separates geometry upload (once per unique mesh) from instance data (once per visible instance). | |
| void | invalidateGeometryCache () |
| Clears the geometry cache and marks for full rebuild. Called when meshes are unloaded. | |
| void | markDirty () |
| Flags the Rendering Data Manager as dirty so that all buffers managed by this manager are in need of being rebuilt. | |
| void | initializeMaterialBuffers () |
| Initialize material buffers for all pipeline types. | |
| void | snapshotRenderableMeshes () |
| Take a snapshot of currently render-ready meshes. Called at the start of update cycle to ensure consistent iteration. | |
| bool | isMeshInSnapshot (MeshAsset *asset) const |
| Check if a mesh asset is in the current render cycle snapshot. | |
Private Attributes | |
| const Engine * | engine = nullptr |
| ApplicationContext * | context = nullptr |
| SceneManager * | injectedSceneManager = nullptr |
| AssetManager * | injectedAssetManager = nullptr |
| Renderer * | injectedRenderer = nullptr |
| std::optional< VulkanStagedBuffer > | primitiveCullingData |
| ObjectCullingData per primitive (unused after GPU transform optimization) | |
| std::optional< VulkanStagedBuffer > | primitiveMeshletData |
| PrimitiveMeshletData per primitive. | |
| std::optional< VulkanStagedBuffer > | perObjectDataBuffer |
| mat4 world transform per primitive (matches shader PerObjectData) | |
| std::optional< VulkanStagedBuffer > | primitiveRenderData |
| MeshPrimitiveRenderData per primitive (texture/material IDs) | |
| std::optional< VulkanStagedBuffer > | localBoundsBuffer |
| LocalBoundsData per primitive (static, uploaded once) | |
| std::optional< VulkanStagedBuffer > | meshletBuffer |
| UnifiedMeshlet data. | |
| std::optional< VulkanStagedBuffer > | meshletBoundsData |
| MeshletBounds for meshlet culling. | |
| std::optional< VulkanStagedBuffer > | vertexBuffer |
| Optimized vertex data (Vertex structs) | |
| std::optional< VulkanStagedBuffer > | triangleBuffer |
| Triangle indices for meshlets. | |
| std::optional< VulkanStagedBuffer > | meshGeometryDataBuffer |
| MeshGeometryData per unique geometry. | |
| std::optional< VulkanStagedBuffer > | instanceDataBuffer |
| InstanceData per visible instance. | |
| std::optional< VulkanStagedBuffer > | instanceCullingDataBuffer |
| InstanceCullingData per instance. | |
| std::optional< VulkanStagedBuffer > | vsIndexBuffer_ |
| Contiguous uint32_t indices for vertex shader. | |
| std::optional< VulkanStagedBuffer > | singleMeshletGeometryBuffer_ |
| SingleMeshletGeometryData per single-meshlet geometry. | |
| std::optional< VulkanStagedBuffer > | clusterLodDataBuffer_ |
| ClusterLodData per cluster. | |
| std::optional< VulkanStagedBuffer > | clusterGroupDataBuffer_ |
| ClusterGroupData per LOD group. | |
| std::vector< VulkanStagedBufferSyncObjects > | pendingSyncObjects_ |
| std::vector< VulkanStagedBufferSyncObjects > | pendingTransformSyncObjects_ |
| uint32_t | primitiveCount = 0 |
| uint32_t | meshletCount = 0 |
| bool | isDirty = false |
| a flag which defers the update of the buffer updates to the end of the frame. | |
| uint64_t | dataVersion_ = 0 |
| bool | instancingEnabled_ = true |
| Feature flag for instanced rendering. | |
| bool | geometryDirty_ = false |
| Unique meshes changed (requires geometry buffer update) | |
| bool | instancesDirty_ = false |
| Instance list changed (requires instance buffer update) | |
| uint32_t | uniqueGeometryCount_ = 0 |
| Number of unique geometries in buffers. | |
| uint32_t | instanceCount_ = 0 |
| Number of instances in buffers. | |
| uint32_t | nextGeometryId_ = 0 |
| Next geometry ID to assign. | |
| uint32_t | nextMeshletId_ = 0 |
| Next meshlet ID to assign. | |
| size_t | committedVertexCount_ = 0 |
| Vertices already on GPU. | |
| size_t | committedTriangleCount_ = 0 |
| Triangles already on GPU. | |
| size_t | committedMeshletCount_ = 0 |
| Meshlets already on GPU. | |
| size_t | committedGeometryCount_ = 0 |
| Geometries already on GPU. | |
| size_t | committedVsIndexCount_ = 0 |
| VS indices already on GPU. | |
| size_t | committedSingleMeshletGeoCount_ = 0 |
| Single-meshlet geometries already on GPU. | |
| bool | geometryNeedsFullRebuild_ = true |
| True on startup or after mesh unload. | |
| uint32_t | singleMeshletGeometryCount_ = 0 |
| Geometries with meshletCount == 1 (vertex shader path) | |
| uint32_t | multiMeshletGeometryCount_ = 0 |
| Geometries with meshletCount > 1 (mesh shader path) | |
| uint32_t | clusterCount_ = 0 |
| Total clusters across all LOD levels. | |
| uint32_t | clusterGroupCount_ = 0 |
| Total cluster groups. | |
| std::unordered_map< GeometryCacheKey, MeshGeometryMapping, GeometryCacheKeyHash > | geometryCache_ |
| std::unordered_map< uint32_t, PipelineNames > | primitiveToPipeline |
| Maps primitive IDs to their pipeline. | |
| std::unordered_map< PipelineNames, uint32_t > | pipelinePrimitiveCounts |
| Count of primitives per pipeline. | |
| std::unordered_map< entt::entity, std::vector< uint32_t > > | entityToPrimitiveIds_ |
| std::unordered_map< uint32_t, MeshComponent * > | primitiveIdToComponent_ |
| std::vector< glm::mat4 > | cachedTransforms_ |
| bool | transformCacheValid_ = false |
| std::vector< Texture * > | texturesToUpload |
| Textures waiting for GPU upload. | |
| std::vector< Texture * > | gpuTextures |
| Textures currently on GPU. | |
| std::unordered_map< PipelineNames, std::optional< VulkanBuffer > > | materialBuffersByPipeline |
| bool | materialsDirty_ = true |
| std::unordered_map< std::string, uint32_t > | materialPathToFlatColorIndex_ |
| std::unordered_map< std::string, uint32_t > | materialPathToDiffuseIndex_ |
| std::unordered_map< std::string, uint32_t > | materialPathToPbrIndex_ |
| std::unordered_map< std::string, uint32_t > | materialPathToNormalsIndex_ |
| std::optional< VulkanBuffer > | shProbeBuffer_ |
| SHProbeData buffer at binding 18. | |
| std::vector< SHProbeData > | shProbeData_ |
| CPU-side SH probe data. | |
| std::vector< MeshAsset * > | pendingMeshLoads_ |
| std::unordered_set< MeshAsset * > | renderCycleMeshSnapshot_ |
| std::vector< MeshGeometryData > | workingGeometryDataBuffer_ |
| std::vector< UnifiedMeshlet > | workingMeshletDataBuffer_ |
| std::vector< MeshletBounds > | workingMeshletBoundsBuffer_ |
| std::vector< Vertex > | workingVertexBuffer_ |
| std::vector< Ecs::PackedTriangle > | workingTriangleBuffer_ |
| std::vector< uint32_t > | workingVsIndexBuffer_ |
| std::vector< SingleMeshletGeometryData > | workingSingleMeshletGeoData_ |
| std::vector< ClusterLodData > | workingClusterLodData_ |
| std::vector< ClusterGroupData > | workingClusterGroupData_ |
| std::vector< InstanceData > | workingInstanceData_ |
| std::vector< InstanceCullingData > | workingInstanceCullingData_ |
| std::vector< ObjectCullingData > | workingPrimitiveCullingBuffer_ |
| std::vector< LocalBoundsData > | workingLocalBoundsDataBuffer_ |
| std::vector< PrimitiveMeshletData > | workingPrimitiveMeshletBuffer_ |
| std::vector< glm::mat4 > | workingPerObjectData_ |
| std::vector< MeshPrimitiveRenderData > | workingPrimitiveRenderData_ |
| std::vector< GpuDiffuseFlatColorMaterial > | workingFlatColorMaterials_ |
| std::vector< GpuDiffuseShaderMaterial > | workingDiffuseMaterials_ |
| std::vector< GpuPbrMaterial > | workingPbrMaterials_ |
| std::vector< GpuNormalsMaterial > | workingNormalsMaterials_ |
| bool | defaultTexturesLoading_ = false |
| True if loadEcsTexture has been called. | |
Static Private Attributes | |
| static constexpr const char * | DEFAULT_NORMAL_TEXTURE_PATH = "Engine/textures/DefaultNormal.png" |
| static constexpr const char * | DEFAULT_WHITE_TEXTURE_PATH = "Engine/textures/DefaultWhite.png" |
| static constexpr const char * | DEFAULT_BLACK_TEXTURE_PATH = "Engine/textures/DefaultBlack.png" |
Friends | |
| class | Engine |
The rendering data manager is supposed to hold all methods to update the contents of the buffers which are uploaded to the gpu. This could be culling data for example.
Definition at line 34 of file RenderingDataManager.h.
|
strong |
Get a valid texture index, substituting defaults for missing textures.
Queries AssetManager for the texture descriptor index. If the requested texture is TEXTURE_NOT_PRESENT (0xFFFFFFFF), returns the appropriate default texture index (or 0xFFFFFFFF if defaults aren't loaded yet).
| textureIndex | The texture index (may be TEXTURE_NOT_PRESENT) |
| textureType | Type of texture for selecting appropriate default |
| Enumerator | |
|---|---|
| Normal | |
| White | |
| Black | |
Definition at line 381 of file RenderingDataManager.h.
|
explicit |
Definition at line 27 of file RenderingDataManager.cpp.
References clusterGroupDataBuffer_, clusterLodDataBuffer_, context, Engine, engine, initializeMaterialBuffers(), initializeSHProbeBuffer(), instanceCullingDataBuffer, instanceDataBuffer, localBoundsBuffer, markDirty(), meshGeometryDataBuffer, meshletBoundsData, meshletBuffer, EngineCore::MIN_BUFFER_SIZE, perObjectDataBuffer, primitiveCullingData, primitiveMeshletData, primitiveRenderData, singleMeshletGeometryBuffer_, triangleBuffer, vertexBuffer, and vsIndexBuffer_.
Referenced by operator=(), and RenderingDataManager().
| EngineCore::RenderingDataManager::~RenderingDataManager | ( | ) |
Destructor - cleans up all GPU buffers.
Definition at line 215 of file RenderingDataManager.cpp.
References clusterGroupDataBuffer_, clusterLodDataBuffer_, instanceCullingDataBuffer, instanceDataBuffer, materialBuffersByPipeline, meshGeometryDataBuffer, meshletBoundsData, meshletBuffer, perObjectDataBuffer, primitiveCullingData, primitiveMeshletData, primitiveRenderData, shProbeBuffer_, singleMeshletGeometryBuffer_, triangleBuffer, vertexBuffer, and vsIndexBuffer_.
|
delete |
|
explicit |
Constructor for decoupled usage (e.g., testing) where Engine is not available. Dependencies must be set via setters before calling updateIfDirty().
| context | The Vulkan application context |
Definition at line 121 of file RenderingDataManager.cpp.
References clusterGroupDataBuffer_, clusterLodDataBuffer_, context, engine, initializeMaterialBuffers(), initializeSHProbeBuffer(), instanceCullingDataBuffer, instanceDataBuffer, localBoundsBuffer, markDirty(), meshGeometryDataBuffer, meshletBoundsData, meshletBuffer, EngineCore::MIN_BUFFER_SIZE, perObjectDataBuffer, primitiveCullingData, primitiveMeshletData, primitiveRenderData, singleMeshletGeometryBuffer_, triangleBuffer, vertexBuffer, and vsIndexBuffer_.
|
inline |
Clears the dirty flag after update is complete.
Definition at line 139 of file RenderingDataManager.h.
References isDirty.
|
inline |
Clear pending sync objects after they've been recorded.
Definition at line 249 of file RenderingDataManager.h.
References pendingSyncObjects_.
|
inline |
Clear pending transform sync objects after they've been recorded.
Definition at line 186 of file RenderingDataManager.h.
References pendingTransformSyncObjects_.
| void EngineCore::RenderingDataManager::clearTexturesToUpload | ( | ) |
Clear the texture upload queue after upload is complete.
Definition at line 1955 of file RenderingDataManager.cpp.
References gpuTextures, and texturesToUpload.
| void EngineCore::RenderingDataManager::collectMaterialsFromScene | ( | ) |
Collects all materials from loaded meshes and creates per-pipeline data This builds material-to-pipeline mappings for the rendering pipeline.
Definition at line 1733 of file RenderingDataManager.cpp.
References engine, EngineCore::SceneManager::getAllActors(), Asset::AssetManager< Key, AssetClass >::getAsset(), EngineCore::AssetManager::getMaterialAssetManager(), EngineCore::MeshAsset::getMeshPrimitiveData(), injectedAssetManager, injectedSceneManager, EngineCore::NORMALS_SHADER, pipelinePrimitiveCounts, primitive_rendering_id, and primitiveToPipeline.
|
nodiscard |
Generate descriptor infos for all GPU-uploaded textures.
Definition at line 1962 of file RenderingDataManager.cpp.
References gpuTextures.
|
inlinenodiscard |
Definition at line 214 of file RenderingDataManager.h.
References clusterCount_.
|
inlinenodiscard |
Definition at line 215 of file RenderingDataManager.h.
References clusterGroupCount_.
|
inlinenodiscard |
Definition at line 213 of file RenderingDataManager.h.
References clusterGroupDataBuffer_.
|
inlinenodiscard |
Definition at line 212 of file RenderingDataManager.h.
References clusterLodDataBuffer_.
|
inlinenodiscard |
Get the current data version Incremented each time buffers are updated. RenderProcesses use this to know when they need to refresh their descriptor sets.
Definition at line 134 of file RenderingDataManager.h.
References dataVersion_.
Referenced by EngineCore::RenderProcess::syncWithRenderingDataManager().
|
inlinenodiscard |
Gets the current count of instances in the buffers.
Definition at line 226 of file RenderingDataManager.h.
References instanceCount_.
|
inlinenodiscard |
Definition at line 202 of file RenderingDataManager.h.
References instanceCullingDataBuffer.
|
inlinenodiscard |
Definition at line 201 of file RenderingDataManager.h.
References instanceDataBuffer.
|
inlinenodiscard |
Definition at line 193 of file RenderingDataManager.h.
References localBoundsBuffer.
|
nodiscard |
Get the material buffer for a specific pipeline type.
| pipelineName | The pipeline type enum |
Definition at line 1986 of file RenderingDataManager.cpp.
References materialBuffersByPipeline.
|
inlinenodiscard |
Definition at line 200 of file RenderingDataManager.h.
References meshGeometryDataBuffer.
|
inlinenodiscard |
Definition at line 195 of file RenderingDataManager.h.
References meshletBoundsData.
|
inlinenodiscard |
Definition at line 194 of file RenderingDataManager.h.
References meshletBuffer.
|
inlinenodiscard |
Gets the current count of meshlets in the buffers.
Definition at line 265 of file RenderingDataManager.h.
References meshletCount.
|
inlinenodiscard |
Definition at line 208 of file RenderingDataManager.h.
References multiMeshletGeometryCount_.
|
inlinenodiscard |
Get pending buffer sync objects for the transfer phase These need to be recorded in the transfer command buffer.
Definition at line 244 of file RenderingDataManager.h.
References pendingSyncObjects_.
|
inlinenodiscard |
Get pending transform sync objects for the transfer phase.
Definition at line 181 of file RenderingDataManager.h.
References pendingTransformSyncObjects_.
|
inlinenodiscard |
Definition at line 191 of file RenderingDataManager.h.
References perObjectDataBuffer.
|
nodiscard |
Gets the pipeline ID (PipelineNames enum) for a given primitive.
| primitiveId | The rendering ID of the primitive |
Definition at line 1800 of file RenderingDataManager.cpp.
References EngineCore::NORMALS_SHADER, primitive_rendering_id, and primitiveToPipeline.
|
inlinenodiscard |
Gets the current count of primitives in the buffers.
Definition at line 260 of file RenderingDataManager.h.
References primitiveCount.
|
inlinenodiscard |
Definition at line 189 of file RenderingDataManager.h.
References primitiveCullingData.
|
inlinenodiscard |
Definition at line 190 of file RenderingDataManager.h.
References primitiveMeshletData.
|
inlinenodiscard |
Definition at line 192 of file RenderingDataManager.h.
References primitiveRenderData.
|
nodiscard |
Get the SH probe buffer for spherical harmonic lighting.
Definition at line 2555 of file RenderingDataManager.cpp.
References shProbeBuffer_.
|
inlinenodiscard |
Definition at line 206 of file RenderingDataManager.h.
References singleMeshletGeometryBuffer_.
|
inlinenodiscard |
Definition at line 207 of file RenderingDataManager.h.
References singleMeshletGeometryCount_.
|
nodiscard |
Get the count of textures currently on the GPU.
Definition at line 1981 of file RenderingDataManager.cpp.
References gpuTextures.
|
nodiscard |
Get the list of textures waiting for GPU upload.
Definition at line 1950 of file RenderingDataManager.cpp.
References texturesToUpload.
|
inlinenodiscard |
Definition at line 197 of file RenderingDataManager.h.
References triangleBuffer.
|
inlinenodiscard |
Gets the current count of unique geometries in the buffers.
Definition at line 221 of file RenderingDataManager.h.
References uniqueGeometryCount_.
|
nodiscard |
Definition at line 2607 of file RenderingDataManager.cpp.
References Black, DEFAULT_BLACK_TEXTURE_PATH, DEFAULT_NORMAL_TEXTURE_PATH, DEFAULT_WHITE_TEXTURE_PATH, engine, EngineCore::AssetManager::getTextureDescriptorIndex(), injectedAssetManager, Normal, and White.
|
inlinenodiscard |
Definition at line 196 of file RenderingDataManager.h.
References vertexBuffer.
|
inlinenodiscard |
Definition at line 205 of file RenderingDataManager.h.
References vsIndexBuffer_.
|
inlinenodiscard |
Definition at line 216 of file RenderingDataManager.h.
References clusterCount_.
|
nodiscard |
Check if there are textures waiting to be uploaded to GPU.
Definition at line 1945 of file RenderingDataManager.cpp.
References texturesToUpload.
|
inlinenodiscard |
Definition at line 209 of file RenderingDataManager.h.
References singleMeshletGeometryCount_.
| void EngineCore::RenderingDataManager::initializeDefaultTextures | ( | ) |
Queue default textures for loading via the texture pipeline.
Submits default PBR fallback textures to AssetManager::loadEcsTexture():
The textures are loaded asynchronously through the normal texture pipeline. Call this after asset manager is available but before loading models.
Definition at line 2563 of file RenderingDataManager.cpp.
References EngineCore::BaseColor, DEFAULT_BLACK_TEXTURE_PATH, DEFAULT_NORMAL_TEXTURE_PATH, DEFAULT_WHITE_TEXTURE_PATH, defaultTexturesLoading_, engine, EngineCore::TextureHandleRegistry::getOrCreateHandle(), EngineCore::AssetManager::getTextureHandleRegistry(), injectedAssetManager, EngineCore::AssetManager::loadEcsTexture(), and EngineCore::Normal.
|
private |
Initialize material buffers for all pipeline types.
Definition at line 1997 of file RenderingDataManager.cpp.
References context, EngineCore::DIFFUSE_FLAT_COLOR, EngineCore::DIFFUSE_SHADER, EngineCore::DYNAMIC_TEXTURES, EngineCore::L0_SHADER, EngineCore::L1_SHADER, EngineCore::L2_SHADER, materialBuffersByPipeline, EngineCore::MOVABLE_DIFFUSE_SHADER, EngineCore::NORMALS_SHADER, and EngineCore::STATIC_LIGHTMAP.
Referenced by RenderingDataManager(), and RenderingDataManager().
| void EngineCore::RenderingDataManager::initializeSHProbeBuffer | ( | ) |
Initialize default SH probe data Sets up a single default probe with hardcoded coefficients.
Definition at line 2503 of file RenderingDataManager.cpp.
References EngineCore::SHProbeData::ambientTerm, EngineCore::SHProbeData::coefficients, context, EngineCore::SHProbeData::scale, shProbeBuffer_, and shProbeData_.
Referenced by RenderingDataManager(), and RenderingDataManager().
|
private |
Clears the geometry cache and marks for full rebuild. Called when meshes are unloaded.
Definition at line 1464 of file RenderingDataManager.cpp.
References geometryCache_, geometryDirty_, geometryNeedsFullRebuild_, and markDirty().
Referenced by onMeshUnloaded().
|
inlinenodiscard |
Check if instancing mode is enabled.
Definition at line 231 of file RenderingDataManager.h.
References instancingEnabled_.
|
nodiscardprivate |
Check if a mesh asset is in the current render cycle snapshot.
| asset | The mesh asset to check |
Definition at line 1933 of file RenderingDataManager.cpp.
References renderCycleMeshSnapshot_.
Referenced by updatePrimitiveData().
|
private |
Flags the Rendering Data Manager as dirty so that all buffers managed by this manager are in need of being rebuilt.
Definition at line 1809 of file RenderingDataManager.cpp.
References isDirty, and transformCacheValid_.
Referenced by invalidateGeometryCache(), onMaterialLoaded(), onMaterialUnloaded(), onRenderableDestroyed(), onRenderableSpawned(), onTextureLoaded(), onTextureUnloaded(), processPendingMeshLoads(), RenderingDataManager(), RenderingDataManager(), setInstancingEnabled(), and updateTransforms().
|
inline |
Mark materials as dirty, requiring buffer re-upload.
Definition at line 343 of file RenderingDataManager.h.
References materialsDirty_.
|
inlinenodiscard |
Check if material buffers need updating.
Definition at line 338 of file RenderingDataManager.h.
References materialsDirty_.
|
inlinenodiscard |
Check if the rendering data needs to be rebuilt.
Definition at line 126 of file RenderingDataManager.h.
References isDirty.
| void EngineCore::RenderingDataManager::onMaterialLoaded | ( | MaterialAsset * | materialAsset | ) |
Event hook for when a material has been loaded.
| materialAsset | Which material pointer has been loaded |
Definition at line 1721 of file RenderingDataManager.cpp.
References markDirty().
| void EngineCore::RenderingDataManager::onMaterialUnloaded | ( | MaterialAsset * | materialAsset | ) |
Event hook for when a material has been unloaded.
| materialAsset | Material pointer for which object has been unloaded |
Definition at line 1727 of file RenderingDataManager.cpp.
References markDirty().
| void EngineCore::RenderingDataManager::onMeshLoaded | ( | MeshAsset * | asset | ) |
Event hook which executes when an Mesh is loaded.
| asset | which asset pointer is loaded |
Definition at line 1623 of file RenderingDataManager.cpp.
References pendingMeshLoads_.
Referenced by processCompletedMeshletGenerations().
| void EngineCore::RenderingDataManager::onMeshUnloaded | ( | MeshAsset * | asset | ) |
Event hook which executes when a Mesh is unloaded.
| asset | which asset pointer has been unloaded |
Definition at line 1631 of file RenderingDataManager.cpp.
References invalidateGeometryCache().
| void EngineCore::RenderingDataManager::onRenderableDestroyed | ( | MeshComponent * | component | ) |
Event hook which is executed when a renderable component gets removed from an actor and thus has to be removed from the rendering pool.
| component | Which component pointer is being removed |
Definition at line 1618 of file RenderingDataManager.cpp.
References markDirty().
| void EngineCore::RenderingDataManager::onRenderableSpawned | ( | MeshComponent * | component | ) |
Event hook which is executed when a renderable component gets added to an actor and can thus be rendered.
| component | renderable component which has been spawned |
Definition at line 1613 of file RenderingDataManager.cpp.
References markDirty().
| void EngineCore::RenderingDataManager::onTextureLoaded | ( | TextureAsset * | textureAsset, |
| const std::filesystem::path & | texturePath ) |
Event hook for when a texture has been loaded by the asset pipeline. Creates a Vulkan Texture from the ECS image data and registers it with AssetManager.
| textureAsset | Which texture pointer has been loaded |
| texturePath | The filesystem path of the texture (used as key for descriptor lookup) |
Definition at line 1638 of file RenderingDataManager.cpp.
References EngineCore::BaseColor, context, engine, Ecs::RegistryManager::get(), EngineCore::Texture::getDescriptorIndex(), Asset::AssetBase::getEntity(), EngineCore::AssetManager::getTextureDescriptorIndex(), EngineCore::AssetManager::getTextureHandleRegistry(), EngineCore::TextureHandleRegistry::getTextureTypeForPath(), Ecs::ImageData::image, injectedAssetManager, markDirty(), EngineCore::TextureHandleRegistry::onTextureLoaded(), EngineCore::AssetManager::registerTexture(), and EngineCore::Unknown.
| void EngineCore::RenderingDataManager::onTextureUnloaded | ( | TextureAsset * | textureAsset | ) |
Event hook for when a texture has been unloaded.
| textureAsset | Texture pointer for which object has been unloaded |
Definition at line 1716 of file RenderingDataManager.cpp.
References markDirty().
|
delete |
| void EngineCore::RenderingDataManager::processCompletedMeshletGenerations | ( | std::vector< Ecs::CompletedMeshletGeneration > && | completions | ) |
Process completed meshlet generations and write them to the registry. This should be called at a safe point before rendering begins.
| completions | Vector of completed meshlet generations to process |
Definition at line 1832 of file RenderingDataManager.cpp.
References Ecs::MeshPrimitiveData::boundingSphere, engine, Ecs::RegistryManager::get(), Asset::AssetManager< Key, AssetClass >::getAsset(), EngineCore::AssetManager::getMeshAssetManager(), injectedAssetManager, onMeshLoaded(), and Ecs::MeshPrimitiveData::primitives.
| void EngineCore::RenderingDataManager::processPendingDeletions | ( | ) |
Process deferred buffer deletions Call this after all frames have completed and descriptor sets are updated.
Definition at line 2480 of file RenderingDataManager.cpp.
References instanceCullingDataBuffer, instanceDataBuffer, meshGeometryDataBuffer, meshletBoundsData, meshletBuffer, perObjectDataBuffer, primitiveCullingData, primitiveMeshletData, primitiveRenderData, singleMeshletGeometryBuffer_, triangleBuffer, vertexBuffer, and vsIndexBuffer_.
| void EngineCore::RenderingDataManager::processPendingMeshLoads | ( | ) |
Process pending mesh loads at a safe point in the frame. This should be called BEFORE updateIfDirty() to ensure meshes that finished loading are acknowledged before the render update begins. Meshes that load after this point will be deferred to the next frame.
Definition at line 1816 of file RenderingDataManager.cpp.
References markDirty(), and pendingMeshLoads_.
| void EngineCore::RenderingDataManager::queueTextureForUpload | ( | Texture * | texture | ) |
Queue a texture for GPU upload Called by AssetManager when a new texture is created and needs uploading.
| texture | The texture to queue for upload |
Definition at line 1938 of file RenderingDataManager.cpp.
References texturesToUpload.
| void EngineCore::RenderingDataManager::setAssetManager | ( | AssetManager * | assetManager | ) |
Set the asset manager for material lookups. Required when Engine is null.
Definition at line 258 of file RenderingDataManager.cpp.
References injectedAssetManager.
|
inline |
Enable or disable instancing mode.
| enabled | Whether to use instanced rendering |
Definition at line 237 of file RenderingDataManager.h.
References instancingEnabled_, and markDirty().
| void EngineCore::RenderingDataManager::setRenderer | ( | Renderer * | renderer | ) |
Set the renderer for pipeline index lookups. Required when Engine is null.
Definition at line 263 of file RenderingDataManager.cpp.
References injectedRenderer.
| void EngineCore::RenderingDataManager::setSceneManager | ( | SceneManager * | sceneManager | ) |
Set the scene manager for retrieving actors. Required when Engine is null.
Definition at line 253 of file RenderingDataManager.cpp.
References injectedSceneManager.
|
private |
Take a snapshot of currently render-ready meshes. Called at the start of update cycle to ensure consistent iteration.
Definition at line 1906 of file RenderingDataManager.cpp.
References Ecs::RegistryManager::get(), EngineCore::MeshComponent::getMeshAsset(), EngineCore::MeshAsset::getMeshPrimitiveData(), EngineCore::MeshComponent::isVisible(), renderCycleMeshSnapshot_, and TRACY_ZONE_SCOPED_NAMED.
Referenced by updateIfDirty().
| bool EngineCore::RenderingDataManager::updateIfDirty | ( | ) |
Triggers an update of all GPU buffers if dirty.
Definition at line 268 of file RenderingDataManager.cpp.
References instancingEnabled_, isDirty, snapshotRenderableMeshes(), TRACY_ZONE_SCOPED_NAMED, updatePrimitiveData(), updatePrimitiveDataInstanced(), and uploadMaterialBuffers().
|
private |
Regenerates all buffers and the rendering ids of all objects, primitives and meshlets.
Definition at line 296 of file RenderingDataManager.cpp.
References Ecs::MeshPrimitive::boundingSphere, Ecs::BoundingSphere::center, EngineCore::MeshPrimitiveRenderData::colorTextureId, context, dataVersion_, DEFAULT_MATERIAL_PIPELINE, EngineCore::DIFFUSE_FLAT_COLOR, EngineCore::DIFFUSE_SHADER, EngineCore::DYNAMIC_TEXTURES, Asset::Path::empty(), engine, EngineCore::Renderer::ensureOutputBufferSizes(), entityToPrimitiveIds_, Ecs::RegistryManager::get(), Asset::AssetManager< Key, AssetClass >::getAsset(), Asset::Path::getAssetHandle(), EngineCore::AssetManager::getMaterialAssetManager(), EngineCore::MeshComponent::getMeshAsset(), EngineCore::MeshAsset::getMeshPrimitiveData(), EngineCore::Renderer::getPipelineIndex(), EngineCore::MeshComponent::getWorldTransform(), injectedAssetManager, injectedRenderer, injectedSceneManager, isMeshInSnapshot(), EngineCore::MeshComponent::isVisible(), EngineCore::L0_SHADER, EngineCore::L1_SHADER, EngineCore::L2_SHADER, localBoundsBuffer, EngineCore::LocalBoundsData::localCenterAndRadius, EngineCore::MeshPrimitiveRenderData::materialId, Ecs::MeshPrimitive::materialPath, materialPathToDiffuseIndex_, materialPathToFlatColorIndex_, materialPathToNormalsIndex_, materialPathToPbrIndex_, meshlet_rendering_id, meshletBoundsData, meshletBuffer, EngineCore::PrimitiveMeshletData::meshletCount, meshletCount, Ecs::MeshPrimitive::meshletData, EngineCore::MeshletBounds::meshletIndex, EngineCore::PrimitiveMeshletData::meshletStartIndex, EngineCore::MOVABLE_DIFFUSE_SHADER, EngineCore::NORMALS_SHADER, pendingSyncObjects_, perObjectDataBuffer, EngineCore::PrimitiveMeshletData::pipelineID, EngineCore::MeshletBounds::pipelineIndex, EngineCore::UnifiedMeshlet::pipelineIndex, primitive_rendering_id, primitiveCount, primitiveCullingData, primitiveIdToComponent_, EngineCore::UnifiedMeshlet::primitiveIndex, primitiveMeshletData, primitiveRenderData, Ecs::MeshPrimitiveData::primitives, Ecs::BoundingSphere::radius, EngineCore::STATIC_LIGHTMAP, TRACY_ZONE_SCOPED_NAMED, triangleBuffer, EngineCore::UnifiedMeshlet::triangleCount, EngineCore::UnifiedMeshlet::triangleDataOffset, Ecs::MeshPrimitive::unpackedData, vertexBuffer, EngineCore::UnifiedMeshlet::vertexCount, EngineCore::UnifiedMeshlet::vertexDataOffset, EngineCore::MeshletBounds::worldPositionAndRadius, and EngineCore::ObjectCullingData::worldPositionAndRadius.
Referenced by updateIfDirty().
|
private |
Instanced version of updatePrimitiveData using geometry deduplication. Separates geometry upload (once per unique mesh) from instance data (once per visible instance).
Definition at line 709 of file RenderingDataManager.cpp.
References Ecs::MeshPrimitive::boundingSphere, Ecs::BoundingSphere::center, EngineCore::MeshGeometryData::clusterCount, clusterCount_, clusterGroupCount_, clusterGroupDataBuffer_, clusterLodDataBuffer_, EngineCore::MeshGeometryData::clusterStartIndex, EngineCore::InstanceData::colorTextureId, EngineCore::MeshPrimitiveRenderData::colorTextureId, committedGeometryCount_, committedMeshletCount_, committedSingleMeshletGeoCount_, committedTriangleCount_, committedVertexCount_, committedVsIndexCount_, context, dataVersion_, EngineCore::Debug, DEFAULT_MATERIAL_PIPELINE, EngineCore::DIFFUSE_FLAT_COLOR, EngineCore::DIFFUSE_SHADER, EngineCore::DYNAMIC_TEXTURES, Asset::Path::empty(), engine, EngineCore::Renderer::ensureOutputBufferSizes(), entityToPrimitiveIds_, EngineCore::SingleMeshletGeometryData::firstIndex, geometryCache_, geometryNeedsFullRebuild_, Ecs::RegistryManager::get(), Asset::AssetManager< Key, AssetClass >::getAsset(), Asset::Path::getAssetHandle(), EngineCore::AssetManager::getMaterialAssetManager(), EngineCore::MeshComponent::getMeshAsset(), EngineCore::MeshAsset::getMeshPrimitiveData(), EngineCore::Renderer::getPipelineIndex(), EngineCore::MeshComponent::getWorldTransform(), EngineCore::MeshGeometryData::groupCount, EngineCore::MeshGeometryData::groupStartIndex, EngineCore::SingleMeshletGeometryData::indexCount, EngineCore::Info, injectedAssetManager, injectedRenderer, injectedSceneManager, instanceCount_, instanceCullingDataBuffer, instanceDataBuffer, EngineCore::InstanceCullingData::instanceId, EngineCore::MeshGeometryMapping::isSingleMeshlet, EngineCore::MeshComponent::isVisible(), EngineCore::L0_SHADER, EngineCore::L1_SHADER, EngineCore::L2_SHADER, localBoundsBuffer, EngineCore::MeshGeometryMapping::localBoundsCenter, EngineCore::MeshGeometryMapping::localBoundsRadius, EngineCore::LocalBoundsData::localCenterAndRadius, Ecs::MeshPrimitive::lodHierarchy, LogLOD, EngineCore::InstanceData::materialId, EngineCore::MeshPrimitiveRenderData::materialId, Ecs::MeshPrimitive::materialPath, materialPathToDiffuseIndex_, materialPathToFlatColorIndex_, materialPathToNormalsIndex_, materialPathToPbrIndex_, meshGeometryDataBuffer, EngineCore::InstanceCullingData::meshGeometryId, EngineCore::InstanceData::meshGeometryId, EngineCore::MeshGeometryMapping::meshGeometryId, meshlet_rendering_id, meshletBoundsData, meshletBuffer, EngineCore::MeshGeometryData::meshletCount, EngineCore::MeshGeometryMapping::meshletCount, EngineCore::PrimitiveMeshletData::meshletCount, meshletCount, Ecs::MeshPrimitive::meshletData, EngineCore::ClusterLodData::meshletIndex, EngineCore::MeshletBounds::meshletIndex, EngineCore::MeshGeometryData::meshletStartIndex, EngineCore::MeshGeometryMapping::meshletStartIndex, EngineCore::PrimitiveMeshletData::meshletStartIndex, EngineCore::MOVABLE_DIFFUSE_SHADER, multiMeshletGeometryCount_, nextGeometryId_, nextMeshletId_, EngineCore::NORMALS_SHADER, EngineCore::ObjectCullingData::objectIndex, pendingSyncObjects_, perObjectDataBuffer, EngineCore::PrimitiveMeshletData::pipelineID, EngineCore::MeshGeometryData::pipelineIndex, EngineCore::MeshGeometryMapping::pipelineIndex, EngineCore::MeshletBounds::pipelineIndex, EngineCore::SingleMeshletGeometryData::pipelineIndex, EngineCore::UnifiedMeshlet::pipelineIndex, primitive_rendering_id, primitiveCount, primitiveCullingData, primitiveIdToComponent_, EngineCore::UnifiedMeshlet::primitiveIndex, primitiveMeshletData, primitiveRenderData, Ecs::BoundingSphere::radius, EngineCore::MeshGeometryData::singleMeshletGeoIndex, singleMeshletGeometryBuffer_, singleMeshletGeometryCount_, EngineCore::STATIC_LIGHTMAP, TRACY_ZONE_SCOPED_NAMED, EngineCore::MeshGeometryMapping::triangleBaseOffset, triangleBuffer, EngineCore::UnifiedMeshlet::triangleCount, EngineCore::UnifiedMeshlet::triangleDataOffset, uniqueGeometryCount_, Ecs::MeshPrimitive::unpackedData, EngineCore::MeshGeometryMapping::vertexBaseOffset, vertexBuffer, EngineCore::UnifiedMeshlet::vertexCount, EngineCore::UnifiedMeshlet::vertexDataOffset, EngineCore::SingleMeshletGeometryData::vertexOffset, VS_LOG, vsIndexBuffer_, EngineCore::MeshGeometryMapping::vsIndexCount, EngineCore::MeshGeometryMapping::vsIndexOffset, EngineCore::Warning, workingClusterGroupData_, workingClusterLodData_, workingGeometryDataBuffer_, workingInstanceCullingData_, workingInstanceData_, workingLocalBoundsDataBuffer_, workingMeshletBoundsBuffer_, workingMeshletDataBuffer_, workingPerObjectData_, workingPrimitiveCullingBuffer_, workingPrimitiveMeshletBuffer_, workingPrimitiveRenderData_, workingSingleMeshletGeoData_, workingTriangleBuffer_, workingVertexBuffer_, workingVsIndexBuffer_, EngineCore::InstanceData::worldMatrix, EngineCore::InstanceCullingData::worldPositionAndRadius, EngineCore::MeshletBounds::worldPositionAndRadius, and EngineCore::ObjectCullingData::worldPositionAndRadius.
Referenced by updateIfDirty().
| bool EngineCore::RenderingDataManager::updateTransforms | ( | ) |
Updates only transform-related buffers (world matrices, bounding spheres)
This is called every frame and only performs work if any entity has the Ecs::TransformDirty tag. Much cheaper than full rebuild since it doesn't touch mesh geometry, meshlets, or materials.
Updates:
Definition at line 1473 of file RenderingDataManager.cpp.
References cachedTransforms_, context, entityToPrimitiveIds_, Ecs::RegistryManager::get(), EngineCore::MeshComponent::getMeshAsset(), EngineCore::MeshAsset::getMeshPrimitiveData(), EngineCore::MeshComponent::getWorldTransform(), EngineCore::MeshComponent::isVisible(), markDirty(), Ecs::MeshPrimitive::meshletData, pendingTransformSyncObjects_, perObjectDataBuffer, primitive_rendering_id, primitiveCount, primitiveIdToComponent_, TRACY_ZONE_SCOPED_NAMED, transformCacheValid_, and Ecs::MeshPrimitive::unpackedData.
| void EngineCore::RenderingDataManager::uploadMaterialBuffers | ( | ) |
Upload material data from MaterialAssets to GPU buffers.
This method collects material data for each pipeline type, converts it to GPU-compatible structures, and uploads to the corresponding material buffers. Should be called after collectMaterialsFromScene() when materials change.
Definition at line 2028 of file RenderingDataManager.cpp.
References EngineCore::GpuDiffuseFlatColorMaterial::_padding, EngineCore::GpuPbrMaterial::ambient_term, EngineCore::GpuDiffuseShaderMaterial::baseColorFactor, EngineCore::GpuPbrMaterial::baseColorFactor, EngineCore::GpuDiffuseShaderMaterial::baseColorTextureIndex, EngineCore::GpuPbrMaterial::baseColorTextureIndex, EngineCore::GpuDiffuseFlatColorMaterial::color, EngineCore::VulkanBuffer::create(), EngineCore::GpuNormalsMaterial::debug, EngineCore::GpuPbrMaterial::debug_mode, EngineCore::VulkanBuffer::destroy(), EngineCore::DIFFUSE_FLAT_COLOR, EngineCore::DIFFUSE_SHADER, EngineCore::DYNAMIC_TEXTURES, EngineCore::GpuPbrMaterial::emissiveFactor, EngineCore::GpuPbrMaterial::emissiveTextureIndex, engine, Asset::AssetManager< Key, AssetClass >::forEachAsset(), Asset::Path::getAssetHandle(), EngineCore::MaterialAsset::getBaseColorTextureHandle(), EngineCore::MaterialAsset::getBaseColorTexturePath(), EngineCore::VulkanBuffer::getBufferSize(), EngineCore::MaterialAsset::getData(), EngineCore::MaterialAsset::getEmissiveTextureHandle(), EngineCore::MaterialAsset::getEmissiveTexturePath(), EngineCore::TypedTextureHandle< Type >::getId(), EngineCore::MaterialAsset::getLightmapTextureHandle(), EngineCore::MaterialAsset::getLightmapTexturePath(), Asset::AssetBase::getLoadingState(), EngineCore::AssetManager::getMaterialAssetManager(), EngineCore::MaterialAsset::getMetallicRoughnessTextureHandle(), EngineCore::MaterialAsset::getMetallicRoughnessTexturePath(), EngineCore::MaterialAsset::getNormalTextureHandle(), EngineCore::MaterialAsset::getNormalTexturePath(), EngineCore::TextureHandleRegistry::getPathForHandle(), EngineCore::AssetManager::getTextureDescriptorIndex(), EngineCore::AssetManager::getTextureHandleRegistry(), EngineCore::MaterialAsset::getType(), EngineCore::GpuPbrMaterial::hasLightmap, injectedAssetManager, EngineCore::TypedTextureHandle< Type >::isValid(), EngineCore::L0_SHADER, EngineCore::L1_SHADER, EngineCore::L2_SHADER, EngineCore::GpuPbrMaterial::lightmapTextureIndex, Asset::LOADED, EngineCore::VulkanBuffer::map(), materialBuffersByPipeline, materialPathToDiffuseIndex_, materialPathToFlatColorIndex_, materialPathToNormalsIndex_, materialPathToPbrIndex_, materialsDirty_, EngineCore::GpuPbrMaterial::metallicFactor, EngineCore::MIN_BUFFER_SIZE, EngineCore::MOVABLE_DIFFUSE_SHADER, EngineCore::NORMALS_SHADER, EngineCore::GpuPbrMaterial::normalScale, EngineCore::GpuPbrMaterial::normalTextureIndex, EngineCore::TextureHandleRegistry::resolveDescriptorIndex(), EngineCore::GpuPbrMaterial::roughnessFactor, EngineCore::GpuPbrMaterial::roughnessMetallicTextureIndex, EngineCore::VulkanBuffer::setDebugName(), EngineCore::GpuPbrMaterial::sh_scale, EngineCore::STATIC_LIGHTMAP, EngineCore::GpuPbrMaterial::tone_mapping, EngineCore::VulkanBuffer::unmap(), workingDiffuseMaterials_, workingFlatColorMaterials_, workingNormalsMaterials_, and workingPbrMaterials_.
Referenced by updateIfDirty().
|
friend |
Definition at line 36 of file RenderingDataManager.h.
References context, Engine, and engine.
Referenced by Engine, and RenderingDataManager().
|
private |
Definition at line 526 of file RenderingDataManager.h.
Referenced by updateTransforms().
|
private |
Total clusters across all LOD levels.
Definition at line 484 of file RenderingDataManager.h.
Referenced by getClusterCount(), hasLodData(), and updatePrimitiveDataInstanced().
|
private |
Total cluster groups.
Definition at line 485 of file RenderingDataManager.h.
Referenced by getClusterGroupCount(), and updatePrimitiveDataInstanced().
|
private |
ClusterGroupData per LOD group.
Definition at line 439 of file RenderingDataManager.h.
Referenced by getClusterGroupDataBuffer(), RenderingDataManager(), RenderingDataManager(), updatePrimitiveDataInstanced(), and ~RenderingDataManager().
|
private |
ClusterLodData per cluster.
Definition at line 438 of file RenderingDataManager.h.
Referenced by getClusterLodDataBuffer(), RenderingDataManager(), RenderingDataManager(), updatePrimitiveDataInstanced(), and ~RenderingDataManager().
|
private |
Geometries already on GPU.
Definition at line 474 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
Meshlets already on GPU.
Definition at line 473 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
Single-meshlet geometries already on GPU.
Definition at line 476 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
Triangles already on GPU.
Definition at line 472 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
Vertices already on GPU.
Definition at line 471 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
VS indices already on GPU.
Definition at line 475 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
Definition at line 406 of file RenderingDataManager.h.
Referenced by Engine, initializeMaterialBuffers(), initializeSHProbeBuffer(), onTextureLoaded(), operator=(), RenderingDataManager(), RenderingDataManager(), updatePrimitiveData(), updatePrimitiveDataInstanced(), and updateTransforms().
|
private |
Version counter incremented on each buffer update RenderProcesses compare against this to know when to refresh descriptors
Definition at line 456 of file RenderingDataManager.h.
Referenced by getDataVersion(), updatePrimitiveData(), and updatePrimitiveDataInstanced().
|
staticconstexprprivate |
Definition at line 623 of file RenderingDataManager.h.
Referenced by getValidTextureIndex(), and initializeDefaultTextures().
|
staticconstexprprivate |
Definition at line 621 of file RenderingDataManager.h.
Referenced by getValidTextureIndex(), and initializeDefaultTextures().
|
staticconstexprprivate |
Definition at line 622 of file RenderingDataManager.h.
Referenced by getValidTextureIndex(), and initializeDefaultTextures().
|
private |
True if loadEcsTexture has been called.
Definition at line 624 of file RenderingDataManager.h.
Referenced by initializeDefaultTextures().
|
private |
Definition at line 405 of file RenderingDataManager.h.
Referenced by collectMaterialsFromScene(), Engine, getValidTextureIndex(), initializeDefaultTextures(), onTextureLoaded(), processCompletedMeshletGenerations(), RenderingDataManager(), RenderingDataManager(), updatePrimitiveData(), updatePrimitiveDataInstanced(), and uploadMaterialBuffers().
|
private |
Definition at line 520 of file RenderingDataManager.h.
Referenced by updatePrimitiveData(), updatePrimitiveDataInstanced(), and updateTransforms().
|
private |
Geometry cache - maps unique primitives to their shared geometry data This survives instance changes, only updated when meshes are loaded/unloaded
Definition at line 512 of file RenderingDataManager.h.
Referenced by invalidateGeometryCache(), and updatePrimitiveDataInstanced().
|
private |
Unique meshes changed (requires geometry buffer update)
Definition at line 460 of file RenderingDataManager.h.
Referenced by invalidateGeometryCache().
|
private |
True on startup or after mesh unload.
Definition at line 477 of file RenderingDataManager.h.
Referenced by invalidateGeometryCache(), and updatePrimitiveDataInstanced().
|
private |
Textures currently on GPU.
Definition at line 532 of file RenderingDataManager.h.
Referenced by clearTexturesToUpload(), generateTextureDescriptorInfos(), and getTextureCount().
|
private |
Definition at line 410 of file RenderingDataManager.h.
Referenced by collectMaterialsFromScene(), getValidTextureIndex(), initializeDefaultTextures(), onTextureLoaded(), processCompletedMeshletGenerations(), setAssetManager(), updatePrimitiveData(), updatePrimitiveDataInstanced(), and uploadMaterialBuffers().
|
private |
Definition at line 411 of file RenderingDataManager.h.
Referenced by setRenderer(), updatePrimitiveData(), and updatePrimitiveDataInstanced().
|
private |
Definition at line 409 of file RenderingDataManager.h.
Referenced by collectMaterialsFromScene(), setSceneManager(), updatePrimitiveData(), and updatePrimitiveDataInstanced().
|
private |
Number of instances in buffers.
Definition at line 465 of file RenderingDataManager.h.
Referenced by getInstanceCount(), and updatePrimitiveDataInstanced().
|
private |
InstanceCullingData per instance.
Definition at line 431 of file RenderingDataManager.h.
Referenced by getInstanceCullingDataBuffer(), processPendingDeletions(), RenderingDataManager(), RenderingDataManager(), updatePrimitiveDataInstanced(), and ~RenderingDataManager().
|
private |
InstanceData per visible instance.
Definition at line 430 of file RenderingDataManager.h.
Referenced by getInstanceDataBuffer(), processPendingDeletions(), RenderingDataManager(), RenderingDataManager(), updatePrimitiveDataInstanced(), and ~RenderingDataManager().
|
private |
Instance list changed (requires instance buffer update)
Definition at line 461 of file RenderingDataManager.h.
|
private |
Feature flag for instanced rendering.
Definition at line 459 of file RenderingDataManager.h.
Referenced by isInstancingEnabled(), setInstancingEnabled(), and updateIfDirty().
|
private |
a flag which defers the update of the buffer updates to the end of the frame.
Definition at line 452 of file RenderingDataManager.h.
Referenced by clearDirty(), markDirty(), needsUpdate(), and updateIfDirty().
|
private |
LocalBoundsData per primitive (static, uploaded once)
Definition at line 418 of file RenderingDataManager.h.
Referenced by getLocalBoundsBuffer(), RenderingDataManager(), RenderingDataManager(), updatePrimitiveData(), and updatePrimitiveDataInstanced().
|
private |
Definition at line 535 of file RenderingDataManager.h.
Referenced by getMaterialBufferForPipeline(), initializeMaterialBuffers(), uploadMaterialBuffers(), and ~RenderingDataManager().
|
private |
Definition at line 543 of file RenderingDataManager.h.
Referenced by updatePrimitiveData(), updatePrimitiveDataInstanced(), and uploadMaterialBuffers().
|
private |
Maps material path -> buffer index for each pipeline buffer type Key: material asset handle string, Value: index in the corresponding GPU buffer Materials are collected from MaterialAssetManager directly, decoupled from MeshPrimitiveData
Definition at line 542 of file RenderingDataManager.h.
Referenced by updatePrimitiveData(), updatePrimitiveDataInstanced(), and uploadMaterialBuffers().
|
private |
Definition at line 545 of file RenderingDataManager.h.
Referenced by updatePrimitiveData(), updatePrimitiveDataInstanced(), and uploadMaterialBuffers().
|
private |
Definition at line 544 of file RenderingDataManager.h.
Referenced by updatePrimitiveData(), updatePrimitiveDataInstanced(), and uploadMaterialBuffers().
|
private |
True if material buffers need re-upload
Definition at line 538 of file RenderingDataManager.h.
Referenced by markMaterialsDirty(), needsMaterialUpdate(), and uploadMaterialBuffers().
|
private |
MeshGeometryData per unique geometry.
Definition at line 429 of file RenderingDataManager.h.
Referenced by getMeshGeometryDataBuffer(), processPendingDeletions(), RenderingDataManager(), RenderingDataManager(), updatePrimitiveDataInstanced(), and ~RenderingDataManager().
|
private |
MeshletBounds for meshlet culling.
Definition at line 422 of file RenderingDataManager.h.
Referenced by getMeshletBoundsBuffer(), processPendingDeletions(), RenderingDataManager(), RenderingDataManager(), updatePrimitiveData(), updatePrimitiveDataInstanced(), and ~RenderingDataManager().
|
private |
UnifiedMeshlet data.
Definition at line 421 of file RenderingDataManager.h.
Referenced by getMeshletBuffer(), processPendingDeletions(), RenderingDataManager(), RenderingDataManager(), updatePrimitiveData(), updatePrimitiveDataInstanced(), and ~RenderingDataManager().
|
private |
Definition at line 449 of file RenderingDataManager.h.
Referenced by getMeshletCount(), updatePrimitiveData(), and updatePrimitiveDataInstanced().
|
private |
Geometries with meshletCount > 1 (mesh shader path)
Definition at line 481 of file RenderingDataManager.h.
Referenced by getMultiMeshletGeometryCount(), and updatePrimitiveDataInstanced().
|
private |
Next geometry ID to assign.
Definition at line 469 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
Next meshlet ID to assign.
Definition at line 470 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
Definition at line 577 of file RenderingDataManager.h.
Referenced by onMeshLoaded(), and processPendingMeshLoads().
|
private |
Definition at line 442 of file RenderingDataManager.h.
Referenced by clearPendingSyncObjects(), getPendingSyncObjects(), updatePrimitiveData(), and updatePrimitiveDataInstanced().
|
private |
Definition at line 445 of file RenderingDataManager.h.
Referenced by clearPendingTransformSyncObjects(), getPendingTransformSyncObjects(), and updateTransforms().
|
private |
mat4 world transform per primitive (matches shader PerObjectData)
Definition at line 416 of file RenderingDataManager.h.
Referenced by getPerObjectDataBuffer(), processPendingDeletions(), RenderingDataManager(), RenderingDataManager(), updatePrimitiveData(), updatePrimitiveDataInstanced(), updateTransforms(), and ~RenderingDataManager().
|
private |
Count of primitives per pipeline.
Definition at line 516 of file RenderingDataManager.h.
Referenced by collectMaterialsFromScene().
|
private |
Definition at line 448 of file RenderingDataManager.h.
Referenced by getPrimitiveCount(), updatePrimitiveData(), updatePrimitiveDataInstanced(), and updateTransforms().
|
private |
ObjectCullingData per primitive (unused after GPU transform optimization)
Definition at line 414 of file RenderingDataManager.h.
Referenced by getPrimitiveCullingBuffer(), processPendingDeletions(), RenderingDataManager(), RenderingDataManager(), updatePrimitiveData(), updatePrimitiveDataInstanced(), and ~RenderingDataManager().
|
private |
Definition at line 522 of file RenderingDataManager.h.
Referenced by updatePrimitiveData(), updatePrimitiveDataInstanced(), and updateTransforms().
|
private |
PrimitiveMeshletData per primitive.
Definition at line 415 of file RenderingDataManager.h.
Referenced by getPrimitiveMeshletBuffer(), processPendingDeletions(), RenderingDataManager(), RenderingDataManager(), updatePrimitiveData(), updatePrimitiveDataInstanced(), and ~RenderingDataManager().
|
private |
MeshPrimitiveRenderData per primitive (texture/material IDs)
Definition at line 417 of file RenderingDataManager.h.
Referenced by getPrimitiveRenderDataBuffer(), processPendingDeletions(), RenderingDataManager(), RenderingDataManager(), updatePrimitiveData(), updatePrimitiveDataInstanced(), and ~RenderingDataManager().
|
private |
Maps primitive IDs to their pipeline.
Definition at line 515 of file RenderingDataManager.h.
Referenced by collectMaterialsFromScene(), and getPipelineForPrimitive().
|
private |
Definition at line 581 of file RenderingDataManager.h.
Referenced by isMeshInSnapshot(), and snapshotRenderableMeshes().
|
private |
SHProbeData buffer at binding 18.
Definition at line 548 of file RenderingDataManager.h.
Referenced by getSHProbeBuffer(), initializeSHProbeBuffer(), and ~RenderingDataManager().
|
private |
CPU-side SH probe data.
Definition at line 549 of file RenderingDataManager.h.
Referenced by initializeSHProbeBuffer().
|
private |
SingleMeshletGeometryData per single-meshlet geometry.
Definition at line 435 of file RenderingDataManager.h.
Referenced by getSingleMeshletGeometryBuffer(), processPendingDeletions(), RenderingDataManager(), RenderingDataManager(), updatePrimitiveDataInstanced(), and ~RenderingDataManager().
|
private |
Geometries with meshletCount == 1 (vertex shader path)
Definition at line 480 of file RenderingDataManager.h.
Referenced by getSingleMeshletGeometryCount(), hasVertexShaderPath(), and updatePrimitiveDataInstanced().
|
private |
Textures waiting for GPU upload.
Definition at line 531 of file RenderingDataManager.h.
Referenced by clearTexturesToUpload(), getTexturesToUpload(), hasTexturesToUpload(), and queueTextureForUpload().
|
private |
Definition at line 528 of file RenderingDataManager.h.
Referenced by markDirty(), and updateTransforms().
|
private |
Triangle indices for meshlets.
Definition at line 426 of file RenderingDataManager.h.
Referenced by getTriangleBuffer(), processPendingDeletions(), RenderingDataManager(), RenderingDataManager(), updatePrimitiveData(), updatePrimitiveDataInstanced(), and ~RenderingDataManager().
|
private |
Number of unique geometries in buffers.
Definition at line 464 of file RenderingDataManager.h.
Referenced by getUniqueGeometryCount(), and updatePrimitiveDataInstanced().
|
private |
Optimized vertex data (Vertex structs)
Definition at line 425 of file RenderingDataManager.h.
Referenced by getVertexBuffer(), processPendingDeletions(), RenderingDataManager(), RenderingDataManager(), updatePrimitiveData(), updatePrimitiveDataInstanced(), and ~RenderingDataManager().
|
private |
Contiguous uint32_t indices for vertex shader.
Definition at line 434 of file RenderingDataManager.h.
Referenced by getVSIndexBuffer(), processPendingDeletions(), RenderingDataManager(), RenderingDataManager(), updatePrimitiveDataInstanced(), and ~RenderingDataManager().
|
private |
Definition at line 601 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
Definition at line 600 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
Definition at line 616 of file RenderingDataManager.h.
Referenced by uploadMaterialBuffers().
|
private |
Definition at line 615 of file RenderingDataManager.h.
Referenced by uploadMaterialBuffers().
|
private |
Definition at line 589 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
Definition at line 605 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
Definition at line 604 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
Definition at line 609 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
Definition at line 591 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
Definition at line 590 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
Definition at line 618 of file RenderingDataManager.h.
Referenced by uploadMaterialBuffers().
|
private |
Definition at line 617 of file RenderingDataManager.h.
Referenced by uploadMaterialBuffers().
|
private |
Definition at line 611 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
Definition at line 608 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
Definition at line 610 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
Definition at line 612 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
Definition at line 597 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
Definition at line 593 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
Definition at line 592 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().
|
private |
Definition at line 596 of file RenderingDataManager.h.
Referenced by updatePrimitiveDataInstanced().