feat(shader): refactor and enhance shader compilation

Refactored shader compilation and resource management systems:
- Introduced `DXCShaderCompiler` for HLSL compilation and reflection.
- Added `BuildFinalShaderCode` method for robust shader code generation.
- Replaced raw strings with `ShaderEntryPoint` struct for shader paths.
- Updated `RenderContext` and `RenderGraphContext` for new pipeline methods.
- Added thread-safe resource management methods in `ResourceManager`.
- Introduced `DXCShaderReflectionData` for shader reflection handling.
- Removed redundant code and simplified `ShaderPropertiesRegistry`.

BREAKING CHANGE: Updated shader and resource APIs to use new structures and methods.
This commit is contained in:
2026-04-11 00:45:46 +09:00
parent 4ed5572ce7
commit f9a6e9cbbe
131 changed files with 13135 additions and 1002 deletions

View File

@@ -0,0 +1,28 @@
using System.Reflection;
using System.Runtime.InteropServices;
namespace Ghost.DXC;
public partial class Api
{
static Api()
{
NativeLibrary.SetDllImportResolver(typeof(Api).Assembly, DxcDllImportResolver);
}
private static nint DxcDllImportResolver(string libraryName, Assembly assembly, DllImportSearchPath? searchPath)
{
// NOTE: Currently only support Windows.
if (libraryName == "dxcompiler")
{
NativeLibrary.TryLoad("runtimes/win-x64/native/dxil.dll", out _);
if (NativeLibrary.TryLoad("runtimes/win-x64/native/dxcompiler.dll", out var dxcHandle))
{
return dxcHandle;
}
}
return IntPtr.Zero;
}
}