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.
23 lines
663 B
C#
23 lines
663 B
C#
namespace Ghost.DSL;
|
|
|
|
public struct ShaderPropertyInfo
|
|
{
|
|
public string shaderName;
|
|
public string code;
|
|
public uint size;
|
|
}
|
|
|
|
public static class ShaderPropertiesRegistry
|
|
{
|
|
private static readonly Dictionary<string, ShaderPropertyInfo> s_nameToCode = new Dictionary<string, ShaderPropertyInfo>(StringComparer.Ordinal);
|
|
|
|
public static void Register(string name, string code, uint size)
|
|
{
|
|
s_nameToCode[name] = new ShaderPropertyInfo { shaderName = name, code = code, size = size };
|
|
}
|
|
|
|
public static bool TryGetInfo(string name, out ShaderPropertyInfo info)
|
|
{
|
|
return s_nameToCode.TryGetValue(name, out info);
|
|
}
|
|
} |