Skip locals init.

This commit is contained in:
Ottermandias 2024-03-16 16:21:23 +01:00
parent 4fc763c9aa
commit 50f81cc889
4 changed files with 14 additions and 10 deletions

View file

@ -62,6 +62,7 @@ public sealed unsafe class LiveColorTablePreviewer : LiveMaterialPreviewerBase
_updatePending = true;
}
[SkipLocalsInit]
private void OnFrameworkUpdate(IFramework _)
{
if (!_updatePending)

View file

@ -89,6 +89,7 @@ internal partial record ResolveContext
};
}
[SkipLocalsInit]
private unsafe Utf8GamePath ResolveEquipmentMaterialPath(Utf8GamePath modelPath, ResourceHandle* imc, byte* mtrlFileName)
{
var variant = ResolveMaterialVariant(imc, Equipment.Variant);
@ -100,6 +101,7 @@ internal partial record ResolveContext
return Utf8GamePath.FromSpan(pathBuffer, out var path) ? path.Clone() : Utf8GamePath.Empty;
}
[SkipLocalsInit]
private unsafe Utf8GamePath ResolveWeaponMaterialPath(Utf8GamePath modelPath, ResourceHandle* imc, byte* mtrlFileName)
{
var setIdHigh = Equipment.Set.Id / 100;
@ -168,7 +170,7 @@ internal partial record ResolveContext
{
var modelPosition = modelPath.IndexOf("/model/"u8);
if (modelPosition < 0)
return Span<byte>.Empty;
return [];
var baseDirectory = modelPath[..modelPosition];

View file

@ -54,6 +54,7 @@ internal unsafe partial record ResolveContext(
return GetOrCreateNode(ResourceType.Shpk, (nint)resourceHandle->ShaderPackage, &resourceHandle->ResourceHandle, path);
}
[SkipLocalsInit]
private ResourceNode? CreateNodeFromTex(TextureResourceHandle* resourceHandle, ByteString gamePath, bool dx11)
{
if (resourceHandle == null)