refactor(shader): rewrite editor shader compilation bridge with keyword resolution
- Add AssetCatalog.EnumerateByTypes for filtered SQL queries - Thread LocalKeywordSet through IShaderCompilationBridge API so the bridge can resolve keyword bitmask to string defines at compile time - Eager/lazy popluation of shader-id-to-asset-id map eliminating full catalog scan per compilation miss - Build keyword mapping from PassDescriptor groups to reconstruct localIndex -> keywordName in the bridge - Use CompileShaderPass extension for multi-stage AS/MS/PS compilation with correct ShaderModel from descriptor - Remove double-load of shader asset in compilation flow - Update test mock to match new interface signature
This commit is contained in:
@@ -30,12 +30,12 @@ public class ShaderLibraryTest
|
||||
|
||||
private class MockShaderCompilationBridge : IShaderCompilationBridge
|
||||
{
|
||||
public List<(ulong id, int passIndex, Key64<ShaderVariant> variantKey)> Requests { get; } = new();
|
||||
public List<(ulong id, int passIndex, Key64<ShaderVariant> variantKey, LocalKeywordSet keywordMask)> Requests { get; } = new();
|
||||
public event Action<Key64<ShaderVariant>, ulong>? OnShaderVariantCompiled;
|
||||
|
||||
public void RequestCompilation(ulong shaderId, int passIndex, Key64<ShaderVariant> variantKey)
|
||||
public void RequestCompilation(ulong shaderId, int passIndex, Key64<ShaderVariant> variantKey, LocalKeywordSet keywordMask)
|
||||
{
|
||||
Requests.Add((shaderId, passIndex, variantKey));
|
||||
Requests.Add((shaderId, passIndex, variantKey, keywordMask));
|
||||
}
|
||||
|
||||
public void TriggerCompiled(Key64<ShaderVariant> variantKey, ulong newHash)
|
||||
|
||||
Reference in New Issue
Block a user