Skip to content

Commit 2753c78

Browse files
committed
Only put out warnings if the path is rooted.
1 parent 7b2e82b commit 2753c78

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Penumbra.String

Penumbra/Interop/Hooks/PostProcessing/ShaderReplacementFixer.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using Penumbra.Interop.Hooks.Resources;
1212
using Penumbra.Interop.Structs;
1313
using Penumbra.Services;
14+
using Penumbra.String.Classes;
1415
using CharacterUtility = Penumbra.Interop.Services.CharacterUtility;
1516
using CSModelRenderer = FFXIVClientStructs.FFXIV.Client.Graphics.Render.ModelRenderer;
1617
using ModelRenderer = Penumbra.Interop.Services.ModelRenderer;
@@ -109,8 +110,8 @@ public ShaderReplacementFixer(ResourceHandleDestructor resourceHandleDestructor,
109110
CommunicatorService communicator, HookManager hooks, CharacterBaseVTables vTables, HumanSetupScalingHook humanSetupScalingHook)
110111
{
111112
_resourceHandleDestructor = resourceHandleDestructor;
112-
_communicator = communicator;
113-
_humanSetupScalingHook = humanSetupScalingHook;
113+
_communicator = communicator;
114+
_humanSetupScalingHook = humanSetupScalingHook;
114115

115116
_skinState = new ModdedShaderPackageState(
116117
() => (ShaderPackageResourceHandle**)&utility.Address->SkinShpkResource,
@@ -467,7 +468,7 @@ private static int GetDataSetExpectedSize(uint dataFlags)
467468

468469
private Texture* PrepareColorTableDetour(MaterialResourceHandle* thisPtr, byte stain0Id, byte stain1Id)
469470
{
470-
if (thisPtr->DataSetSize < GetDataSetExpectedSize(thisPtr->DataFlags))
471+
if (thisPtr->DataSetSize < GetDataSetExpectedSize(thisPtr->DataFlags) && Utf8GamePath.IsRooted(thisPtr->FileName.AsSpan()))
471472
Penumbra.Log.Warning(
472473
$"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.");
473474

@@ -507,9 +508,8 @@ private sealed class ModdedShaderPackageState(ShaderPackageReferenceGetter refer
507508
private readonly ConcurrentSet<nint> _materials = new();
508509

509510
// ConcurrentDictionary.Count uses a lock in its current implementation.
510-
private uint _materialCount = 0;
511-
512-
private ulong _slowPathCallDelta = 0;
511+
private uint _materialCount;
512+
private ulong _slowPathCallDelta;
513513

514514
public uint MaterialCount
515515
{

0 commit comments

Comments
 (0)