Skip to content

Commit

Permalink
Only put out warnings if the path is rooted.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ottermandias committed Jan 11, 2025
1 parent 7b2e82b commit 2753c78
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Penumbra.String
12 changes: 6 additions & 6 deletions Penumbra/Interop/Hooks/PostProcessing/ShaderReplacementFixer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Penumbra.Interop.Hooks.Resources;
using Penumbra.Interop.Structs;
using Penumbra.Services;
using Penumbra.String.Classes;
using CharacterUtility = Penumbra.Interop.Services.CharacterUtility;
using CSModelRenderer = FFXIVClientStructs.FFXIV.Client.Graphics.Render.ModelRenderer;
using ModelRenderer = Penumbra.Interop.Services.ModelRenderer;
Expand Down Expand Up @@ -109,8 +110,8 @@ public ShaderReplacementFixer(ResourceHandleDestructor resourceHandleDestructor,
CommunicatorService communicator, HookManager hooks, CharacterBaseVTables vTables, HumanSetupScalingHook humanSetupScalingHook)
{
_resourceHandleDestructor = resourceHandleDestructor;
_communicator = communicator;
_humanSetupScalingHook = humanSetupScalingHook;
_communicator = communicator;
_humanSetupScalingHook = humanSetupScalingHook;

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

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(
$"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.");

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

// ConcurrentDictionary.Count uses a lock in its current implementation.
private uint _materialCount = 0;

private ulong _slowPathCallDelta = 0;
private uint _materialCount;
private ulong _slowPathCallDelta;

public uint MaterialCount
{
Expand Down

0 comments on commit 2753c78

Please sign in to comment.