Refactor and enhance codebase for maintainability
Refactored and reorganized the codebase to improve readability, performance, and maintainability. Introduced new interfaces and structs for better resource management, updated project configuration files, and refactored shader and graphics pipeline management. Improved error handling, code formatting, and removed unused code and namespaces. Updated DLL references and method signatures for consistency and maintainability.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
namespace Ghost.Core.Graphics;
|
||||
|
||||
public enum KeywordType
|
||||
{
|
||||
Static,
|
||||
@@ -20,6 +21,8 @@ public struct ShaderEntryPoint
|
||||
{
|
||||
public string entry;
|
||||
public string shader;
|
||||
|
||||
public readonly bool IsCreated => !string.IsNullOrEmpty(entry) && !string.IsNullOrEmpty(shader);
|
||||
}
|
||||
|
||||
public struct KeywordsGroup
|
||||
@@ -52,27 +55,11 @@ public interface IPassDescriptor
|
||||
{
|
||||
get;
|
||||
}
|
||||
}
|
||||
|
||||
public class FullPassDescriptor : IPassDescriptor
|
||||
{
|
||||
public string uniqueIdentifier = string.Empty;
|
||||
public ShaderEntryPoint vertexShader;
|
||||
public ShaderEntryPoint pixelShader;
|
||||
public List<string>? defines;
|
||||
public List<string>? includes;
|
||||
public List<KeywordsGroup>? keywords;
|
||||
public List<PropertyDescriptor>? properties;
|
||||
public PipelineDescriptor localPipeline;
|
||||
|
||||
public string Identifier => uniqueIdentifier;
|
||||
}
|
||||
|
||||
public class FallbackPassDescriptor : IPassDescriptor
|
||||
{
|
||||
public string fallbackPassIdentifier = string.Empty;
|
||||
|
||||
public string Identifier => fallbackPassIdentifier;
|
||||
public string Name
|
||||
{
|
||||
get;
|
||||
}
|
||||
}
|
||||
|
||||
public struct PropertyDescriptor
|
||||
@@ -82,6 +69,33 @@ public struct PropertyDescriptor
|
||||
public object? defaultValue;
|
||||
}
|
||||
|
||||
public class FullPassDescriptor : IPassDescriptor
|
||||
{
|
||||
public string uniqueIdentifier = string.Empty;
|
||||
public string name = string.Empty;
|
||||
|
||||
public ShaderEntryPoint taskShader;
|
||||
public ShaderEntryPoint meshShader;
|
||||
public ShaderEntryPoint pixelShader;
|
||||
public List<string>? defines;
|
||||
public List<string>? includes;
|
||||
public List<KeywordsGroup>? keywords;
|
||||
public List<PropertyDescriptor>? properties;
|
||||
public PipelineDescriptor localPipeline;
|
||||
|
||||
public string Identifier => uniqueIdentifier;
|
||||
public string Name => name;
|
||||
}
|
||||
|
||||
public class FallbackPassDescriptor : IPassDescriptor
|
||||
{
|
||||
public string fallbackPassIdentifier = string.Empty;
|
||||
public string name = string.Empty;
|
||||
|
||||
public string Identifier => fallbackPassIdentifier;
|
||||
public string Name => name;
|
||||
}
|
||||
|
||||
public class ShaderDescriptor
|
||||
{
|
||||
public string name = string.Empty;
|
||||
|
||||
Reference in New Issue
Block a user