Added additional config to CompilePass in IShaderCompiler

This commit is contained in:
2025-12-27 15:14:06 +09:00
parent f988c34b3d
commit c9be05fc60
5 changed files with 48 additions and 26 deletions

View File

@@ -36,6 +36,7 @@ public partial struct Shader
private static int s_nextPropertyID = 0;
private static readonly Dictionary<string, int> s_keywordNameToID = new Dictionary<string, int>();
private static readonly Dictionary<int, string> s_keywordIDToName = new Dictionary<int, string>();
private static int s_nextkeywordID = 0;
public static Identifier<ShaderPass> GetPassID(string passName)
@@ -68,9 +69,20 @@ public partial struct Shader
id = s_nextkeywordID++;
}
s_keywordIDToName[id] = keywordName;
return id;
}
public static string? GetKeywordName(int keywordID)
{
if (s_keywordIDToName.TryGetValue(keywordID, out var name))
{
return name;
}
return null;
}
// TODO: Global keywords
}