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:
@@ -169,7 +169,7 @@ public class AntlrShaderCompiler
|
||||
semantics.entryPoints ??= new List<ShaderEntryPoint>();
|
||||
semantics.entryPoints.Add(new ShaderEntryPoint
|
||||
{
|
||||
shader = entry.ShaderPath,
|
||||
shaderPath = entry.ShaderPath,
|
||||
entry = entry.EntryPoint
|
||||
});
|
||||
}
|
||||
@@ -355,7 +355,7 @@ public class AntlrShaderCompiler
|
||||
var entryType = entry.EntryType.ToLower();
|
||||
var shaderEntry = new ShaderEntryPoint
|
||||
{
|
||||
shader = entry.ShaderPath,
|
||||
shaderPath = entry.ShaderPath,
|
||||
entry = entry.EntryPoint
|
||||
};
|
||||
|
||||
@@ -368,7 +368,7 @@ public class AntlrShaderCompiler
|
||||
semantic.pixelShader = shaderEntry;
|
||||
break;
|
||||
case "as":
|
||||
semantic.taskShader = shaderEntry;
|
||||
semantic.amplificationShader = shaderEntry;
|
||||
break;
|
||||
default:
|
||||
errors.Add(new DSLShaderError
|
||||
@@ -381,7 +381,7 @@ public class AntlrShaderCompiler
|
||||
}
|
||||
}
|
||||
|
||||
if (semantic.meshShader.shader == null || semantic.pixelShader.shader == null)
|
||||
if (semantic.meshShader.shaderPath == null || semantic.pixelShader.shaderPath == null)
|
||||
{
|
||||
errors.Add(new DSLShaderError
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user