mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 10:17:22 +01:00
Fix texture naming in Resource Trees
This commit is contained in:
parent
de408e4d58
commit
5a5a1487a3
1 changed files with 7 additions and 7 deletions
|
|
@ -270,13 +270,13 @@ internal unsafe partial record ResolveContext(
|
|||
if (samplerId.HasValue)
|
||||
{
|
||||
alreadyProcessedSamplerIds.Add(samplerId.Value);
|
||||
var samplerCrc = GetSamplerCrcById(shpk, samplerId.Value);
|
||||
if (samplerCrc.HasValue)
|
||||
var textureCrc = GetTextureCrcById(shpk, samplerId.Value);
|
||||
if (textureCrc.HasValue)
|
||||
{
|
||||
if (shpkNames != null && shpkNames.TryGetValue(samplerCrc.Value, out var samplerName))
|
||||
if (shpkNames != null && shpkNames.TryGetValue(textureCrc.Value, out var samplerName))
|
||||
name = samplerName.Value;
|
||||
else
|
||||
name = $"Texture 0x{samplerCrc.Value:X8}";
|
||||
name = $"Texture 0x{textureCrc.Value:X8}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -292,9 +292,9 @@ internal unsafe partial record ResolveContext(
|
|||
|
||||
return node;
|
||||
|
||||
static uint? GetSamplerCrcById(ShaderPackage* shpk, uint id)
|
||||
=> shpk->SamplersSpan.FindFirst(s => s.Id == id, out var s)
|
||||
? s.CRC
|
||||
static uint? GetTextureCrcById(ShaderPackage* shpk, uint id)
|
||||
=> shpk->TexturesSpan.FindFirst(t => t.Id == id, out var t)
|
||||
? t.CRC
|
||||
: null;
|
||||
|
||||
static uint? GetTextureSamplerId(Material* mtrl, TextureResourceHandle* handle, HashSet<uint> alreadyVisitedSamplerIds)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue