Update RenderingContext and D3D12Renderer to use new API.

This commit is contained in:
2025-11-06 04:13:20 +00:00
parent b3eeb8d366
commit 15aca9aefb
17 changed files with 184 additions and 195 deletions

View File

@@ -22,11 +22,11 @@ internal static class SDLCompiler
private const string _GLOBAL_PROPERTY_FILE_NAME = "GlobalData.g.hlsl";
private const string _GENERATED_FILE_HEADER = "// Auto-generated shader file. Please do not edit this file directly.";
private struct ShaderInheritance
{
public SDLSemantics? parent;
public List<ShaderInheritance>? children;
}
// private struct ShaderInheritance
// {
// public SDLSemantics? parent;
// public List<ShaderInheritance>? children;
// }
public static List<SDLSyntax> ParseShaders(TokenStream stream)
{
@@ -289,11 +289,11 @@ internal static class SDLCompiler
ShaderPropertyType.Bool3 => "bool3",
ShaderPropertyType.Bool4 => "bool4",
// NOTE: Textures here are bindless, represented as uint (descriptor index).
ShaderPropertyType.Texture2D => "TEXTURE2D_BINDLESS",
ShaderPropertyType.Texture3D => "TEXTURE3D_BINDLESS",
ShaderPropertyType.TextureCube => "TEXTURECUBE_BINDLESS",
ShaderPropertyType.Texture2DArray => "TEXTURE2D_ARRAY_BINDLESS",
ShaderPropertyType.TextureCubeArray => "TEXTURECUBE_ARRAY_BINDLESS",
ShaderPropertyType.Texture2DBindless => "TEXTURE2D_BINDLESS",
ShaderPropertyType.Texture3DBindless => "TEXTURE3D_BINDLESS",
ShaderPropertyType.TextureCubeBindless => "TEXTURECUBE_BINDLESS",
ShaderPropertyType.Texture2DArrayBindless => "TEXTURE2D_ARRAY_BINDLESS",
ShaderPropertyType.TextureCubeArrayBindless => "TEXTURECUBE_ARRAY_BINDLESS",
_ => throw new ArgumentOutOfRangeException(nameof(type), $"Unsupported shader property type: {type}")
};
}
@@ -396,4 +396,4 @@ struct GlobalData
GeneratePass(pass, targetDirectory);
}
}
}
}