acdream/src/AcDream.App/Rendering/Wb/WbTextureResolutionPolicy.cs
Erik 749e8ceeb1 fix(rendering): bound portal resource lifetime
Separate logical ownership, render publication, and GPU retirement across live entities, landblocks, particles, textures, mesh arenas, portal/UI teardown, and per-frame scratch storage. Add bounded DAT/texture caches, upload budgets, three-frame fence retirement, exact-incarnation appearance reconciliation, frame pacing, and extensive lifetime conformance coverage.\n\nThe seven-destination connected route now cuts peak working/private memory roughly in half, returns Caul to 125-153 FPS locally, and produces no WER or AMD reset.\n\nCo-authored-by: OpenAI Codex <codex@openai.com>
2026-07-18 21:35:16 +02:00

29 lines
904 B
C#

namespace AcDream.App.Rendering.Wb;
internal enum WbTextureResolutionKind : byte
{
SharedAtlas,
OriginalTextureOverride,
PaletteComposite,
}
/// <summary>
/// Selects the retail texture ownership path for one rendered surface.
/// Retail creates a palette-combined <c>ImgTex</c> only for indexed source
/// images; ordinary surfaces continue to reference their shared image.
/// </summary>
internal static class WbTextureResolutionPolicy
{
public static WbTextureResolutionKind Select(
bool hasOriginalTextureOverride,
bool hasPaletteOverride,
bool sourceIsPaletteIndexed)
{
if (hasPaletteOverride && sourceIsPaletteIndexed)
return WbTextureResolutionKind.PaletteComposite;
return hasOriginalTextureOverride
? WbTextureResolutionKind.OriginalTextureOverride
: WbTextureResolutionKind.SharedAtlas;
}
}