forked from Misaki/GhostEngine
Refactor and enhance graphics and audio systems
Updated target frameworks to .NET 10.0 across multiple projects for compatibility with the latest features. Refactored namespaces and introduced new classes for shader descriptors, FMOD integration, and DirectX 12 utilities using TerraFX. Replaced `Win32` bindings with TerraFX equivalents for DirectX 12. Added a C# wrapper for FMOD Studio API, including DSP and error handling. Enhanced entity queries, component storage, and query filters for better performance and type safety. Introduced new test projects and updated the solution structure. Added `meshoptimizer` bindings and integrated `meshoptimizer_native.dll`. Improved code readability, maintainability, and performance.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Ghost.Core;
|
||||
using Ghost.Core.Graphics;
|
||||
using Misaki.HighPerformance.LowLevel.Buffer;
|
||||
using Misaki.HighPerformance.LowLevel.Collections;
|
||||
|
||||
@@ -59,19 +60,26 @@ internal struct ShaderPass
|
||||
// TODO: Multi pass and keyword support
|
||||
public struct Shader : IIdentifierType
|
||||
{
|
||||
private UnsafeList<CBufferInfo> _constantBuffers;
|
||||
private readonly ShaderDescriptor _descriptor;
|
||||
|
||||
private CBufferInfo _perMaterialBufferInfo;
|
||||
private UnsafeList<PropertyInfo> _properties;
|
||||
// TODO: Possible to move this to unmanaged heap?
|
||||
private Dictionary<string, int> _propertyNameToIdMap;
|
||||
|
||||
private bool _disposed;
|
||||
|
||||
internal readonly UnsafeList<CBufferInfo> ConstantBuffers => _constantBuffers;
|
||||
internal CBufferInfo PerMaterialBufferInfo
|
||||
{
|
||||
readonly get => _perMaterialBufferInfo;
|
||||
set => _perMaterialBufferInfo = value;
|
||||
}
|
||||
|
||||
internal readonly UnsafeList<PropertyInfo> Properties => _properties;
|
||||
internal readonly Dictionary<string, int> PropertyNameToIdMap => _propertyNameToIdMap;
|
||||
public Shader()
|
||||
public Shader(ShaderDescriptor descriptor)
|
||||
{
|
||||
_constantBuffers = new(8, Allocator.Persistent);
|
||||
_descriptor = descriptor;
|
||||
|
||||
_properties = new(8, Allocator.Persistent);
|
||||
_propertyNameToIdMap = new(8);
|
||||
|
||||
@@ -95,7 +103,6 @@ public struct Shader : IIdentifierType
|
||||
return;
|
||||
}
|
||||
|
||||
_constantBuffers.Dispose();
|
||||
_properties.Dispose();
|
||||
|
||||
_propertyNameToIdMap.Clear();
|
||||
|
||||
Reference in New Issue
Block a user