feat(D.2b): Step-0 chrome sprites confirmed + direct-RenderSurface upload path

Step-0 prove-out result: retail UI chrome sprites are RenderSurface objects
(0x06xxxxxx) that must be decoded DIRECTLY, not via the Surface->SurfaceTexture
chain GetOrUpload uses for world materials (which produced 1x1 magenta/garbage).
Added TextureCache.GetOrUploadRenderSurface(id, out w, out h) — Portal/HighRes
TryGet<RenderSurface> -> DecodeRenderSurface(palette:null) -> upload, separately
cached. This is the path UI chrome + (later) dat fonts use.

Confirmed the universal floating-window bevel is an 8-piece border + center fill:
  center  0x06004CC2 (48x48)
  edges   0x060074BF/C1 (10x5 horiz)  0x060074C0/C2 (5x10 vert)
  corners 0x060074C3..C6 (5x5)
Recorded in RetailChromeSprites.cs (edge/corner->position mapping is a best
guess pending the LayoutDesc 0x21000040 parse; visually confirmed at panel
render). The memory-note ids were right; only the decode path was wrong.

Temporary prove-out harness (added to GameWindow.OnRender) removed. proveout*.log
gitignored.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-06-14 16:32:27 +02:00
parent 66888d2c8e
commit 8e91805206
3 changed files with 92 additions and 0 deletions

View file

@ -0,0 +1,48 @@
namespace AcDream.App.UI;
/// <summary>
/// Retail window-chrome RenderSurface DataIds, CONFIRMED via the D.2b Step-0
/// prove-out (2026-06-14). These are RenderSurface objects (0x06xxxxxx) decoded
/// DIRECTLY (<see cref="Rendering.TextureCache.GetOrUploadRenderSurface"/>), NOT
/// through the Surface→SurfaceTexture chain.
///
/// <para>
/// The universal floating-window bevel is an <b>8-piece border</b> (4 corners
/// 5×5 + 4 edges) drawn around a tiled center fill — it is NOT a single
/// 9-slice texture. Decoded sizes are in the comments (from the prove-out).
/// </para>
///
/// <para>
/// The edge/corner → position mapping below is a reasonable guess pending the
/// LayoutDesc 0x21000040 parse (sub-project 3) and is confirmed visually in the
/// first vitals-panel render. If a corner's bevel highlight looks wrong, swap
/// the four corner constants; if top/bottom or left/right look inverted, swap
/// those edge pairs.
/// </para>
/// </summary>
public static class RetailChromeSprites
{
/// <summary>Tiled interior fill — the shared panel background (48×48).</summary>
public const uint CenterFill = 0x06004CC2;
/// <summary>Horizontal top edge (10×5, tiled across the top span).</summary>
public const uint TopEdge = 0x060074BF;
/// <summary>Horizontal bottom edge (10×5).</summary>
public const uint BottomEdge = 0x060074C1;
/// <summary>Vertical left edge (5×10).</summary>
public const uint LeftEdge = 0x060074C0;
/// <summary>Vertical right edge (5×10).</summary>
public const uint RightEdge = 0x060074C2;
/// <summary>Top-left corner (5×5).</summary>
public const uint CornerTL = 0x060074C3;
/// <summary>Top-right corner (5×5).</summary>
public const uint CornerTR = 0x060074C4;
/// <summary>Bottom-left corner (5×5).</summary>
public const uint CornerBL = 0x060074C5;
/// <summary>Bottom-right corner (5×5).</summary>
public const uint CornerBR = 0x060074C6;
/// <summary>Border thickness in pixels = the corner/edge sprite size (5px).</summary>
public const int Border = 5;
}