Only put out warnings if the path is rooted.

This commit is contained in:
Ottermandias 2025-01-11 15:55:14 +01:00
parent 7b2e82b27f
commit 2753c786fc
2 changed files with 7 additions and 7 deletions

@ -1 +1 @@
Subproject commit 0647fbc5017ef9ced3f3ce1c2496eefd57c5b7a8 Subproject commit b9003b97da2d1191fa203a4d66956bc54c21db2a

View file

@ -11,6 +11,7 @@ using Penumbra.GameData.Files.MaterialStructs;
using Penumbra.Interop.Hooks.Resources; using Penumbra.Interop.Hooks.Resources;
using Penumbra.Interop.Structs; using Penumbra.Interop.Structs;
using Penumbra.Services; using Penumbra.Services;
using Penumbra.String.Classes;
using CharacterUtility = Penumbra.Interop.Services.CharacterUtility; using CharacterUtility = Penumbra.Interop.Services.CharacterUtility;
using CSModelRenderer = FFXIVClientStructs.FFXIV.Client.Graphics.Render.ModelRenderer; using CSModelRenderer = FFXIVClientStructs.FFXIV.Client.Graphics.Render.ModelRenderer;
using ModelRenderer = Penumbra.Interop.Services.ModelRenderer; using ModelRenderer = Penumbra.Interop.Services.ModelRenderer;
@ -467,7 +468,7 @@ public sealed unsafe class ShaderReplacementFixer : IDisposable, IRequiredServic
private Texture* PrepareColorTableDetour(MaterialResourceHandle* thisPtr, byte stain0Id, byte stain1Id) private Texture* PrepareColorTableDetour(MaterialResourceHandle* thisPtr, byte stain0Id, byte stain1Id)
{ {
if (thisPtr->DataSetSize < GetDataSetExpectedSize(thisPtr->DataFlags)) if (thisPtr->DataSetSize < GetDataSetExpectedSize(thisPtr->DataFlags) && Utf8GamePath.IsRooted(thisPtr->FileName.AsSpan()))
Penumbra.Log.Warning( Penumbra.Log.Warning(
$"Material at {thisPtr->FileName} has data set of size {thisPtr->DataSetSize} bytes, but should have at least {GetDataSetExpectedSize(thisPtr->DataFlags)} bytes. This may cause crashes due to access violations."); $"Material at {thisPtr->FileName} has data set of size {thisPtr->DataSetSize} bytes, but should have at least {GetDataSetExpectedSize(thisPtr->DataFlags)} bytes. This may cause crashes due to access violations.");
@ -507,9 +508,8 @@ public sealed unsafe class ShaderReplacementFixer : IDisposable, IRequiredServic
private readonly ConcurrentSet<nint> _materials = new(); private readonly ConcurrentSet<nint> _materials = new();
// ConcurrentDictionary.Count uses a lock in its current implementation. // ConcurrentDictionary.Count uses a lock in its current implementation.
private uint _materialCount = 0; private uint _materialCount;
private ulong _slowPathCallDelta;
private ulong _slowPathCallDelta = 0;
public uint MaterialCount public uint MaterialCount
{ {