mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-15 12:27:46 +01:00
Optimize I/O of ShPk for ResourceTree generation
This commit is contained in:
parent
5323add662
commit
c01aa000fb
2 changed files with 17 additions and 8 deletions
|
|
@ -230,8 +230,8 @@ internal unsafe partial record ResolveContext(
|
|||
node.Children.Add(shpkNode);
|
||||
}
|
||||
|
||||
var shpkFile = Global.WithUiData && shpkNode != null ? Global.TreeBuildCache.ReadShaderPackage(shpkNode.FullPath) : null;
|
||||
var shpk = Global.WithUiData && shpkNode != null ? (ShaderPackage*)shpkNode.ObjectAddress : null;
|
||||
var shpkNames = Global.WithUiData && shpkNode != null ? Global.TreeBuildCache.ReadShaderPackageNames(shpkNode.FullPath) : null;
|
||||
var shpk = Global.WithUiData && shpkNode != null ? (ShaderPackage*)shpkNode.ObjectAddress : null;
|
||||
|
||||
var alreadyProcessedSamplerIds = new HashSet<uint>();
|
||||
for (var i = 0; i < resource->TextureCount; i++)
|
||||
|
|
@ -255,7 +255,12 @@ internal unsafe partial record ResolveContext(
|
|||
alreadyProcessedSamplerIds.Add(samplerId.Value);
|
||||
var samplerCrc = GetSamplerCrcById(shpk, samplerId.Value);
|
||||
if (samplerCrc.HasValue)
|
||||
name = shpkFile?.GetSamplerById(samplerCrc.Value)?.Name ?? $"Texture 0x{samplerCrc.Value:X8}";
|
||||
{
|
||||
if (shpkNames != null && shpkNames.TryGetValue(samplerCrc.Value, out var samplerName))
|
||||
name = samplerName.Value;
|
||||
else
|
||||
name = $"Texture 0x{samplerCrc.Value:X8}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue