forked from Misaki/GhostEngine
Refactor and enhance resource management and rendering
Updated multiple components to improve encapsulation, maintainability, and performance. Key changes include: - Upgraded package dependencies in project files. - Refactored `Mesh` and `RenderingContext` to use properties and added support for per-object constant buffers. - Improved resource management in `D3D12CommandBuffer`, `D3D12CommandQueue`, and `D3D12ResourceAllocator` with better encapsulation and disposal handling. - Added validation for constant buffer sizes in `D3D12PipelineLibrary`. - Simplified `MeshBuilder` methods to accept allocators and removed hardcoded values. - Enhanced debugging with `GPUResourceLeakException` and resource tracking updates. - Updated shaders and rendering logic for testing, including hardcoded triangle rendering. - Removed redundant base classes and interfaces for cleaner code structure.
This commit is contained in:
@@ -19,10 +19,11 @@ public class ShaderPass : IResourceReleasable
|
||||
{
|
||||
_cbufferInfo = info;
|
||||
|
||||
_propertyLookup = new Dictionary<string, int>(info.Properties.Count);
|
||||
for (var i = 0; i < info.Properties.Count; i++)
|
||||
var capacity = info.Properties?.Count ?? 0;
|
||||
_propertyLookup = new Dictionary<string, int>(capacity);
|
||||
for (var i = 0; i < capacity; i++)
|
||||
{
|
||||
_propertyLookup[info.Properties[i].Name] = i;
|
||||
_propertyLookup[info.Properties![i].Name] = i;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user