Skip to content

Preserve mesh triangles with edge flags in primitive exports - #1

Closed
timorjay wants to merge 1 commit into
realblastex:mainfrom
timorjay:compat/mesh-primitive-edge-flags
Closed

timorjay wants to merge 1 commit into
realblastex:mainfrom
timorjay:compat/mesh-primitive-edge-flags

Conversation

@timorjay

Copy link
Copy Markdown

This backports the mesh primitive index fix from Marvisak/VIctory#1718 by tjthebigbearcat-hub to Flamingo at f6554b6. Each corner has a nine-bit vertex index followed by an edge flag. Flamingo's ten-bit mask includes that flag in the index, so the existing vertex bounds check culls a valid triangle. This change preserves the fork's bounds checks and imports the upstream synthetic regression tests.

Reproduction and verification

With the upstream tests added to the unchanged Flamingo renderer, the edge-flagged triangle drew 0 of 256 pixels on the default hardware device. With the mask fixed, all 256 pixels matched the expected color on hardware and on the Windows software renderer (WARP). The explicitly culled control drew zero pixels.

  • cargo test --locked --offline --profile diag -p victory-shader edge_flag -- --test-threads=1 --nocapture passed both targeted tests.
  • cargo build --locked --offline --profile diag -p victory succeeded. The asset policy check passed for 188 files.

In-game comparison

RTX 5090 D v2 (617.42), Ryzen 7 9800X3D, Windows 11 build 26300. Each trial used the same checkpoint, a fresh offline Windows Sandbox with 16 GiB guest memory, the Series S profile, and the optimized build without the diagnostics feature. The game's watchdog remained enabled. For each warmed trial, the shader and driver pipeline caches came from that build's preceding cold run. The learned list of pipelines to start early was omitted for both warmed trials, as in the first-use scheduling comparison.

Build and cache Visible prison view and movement HUD Median FPS facing the window 10th–90th percentile
Original, empty cache 360.3 s 9.17 7.24–10.21
Backport, empty cache 364.3 s 10.42 7.15–10.87
Original, own cache restored 253.0 s 12.11 11.58–12.50
Backport, own cache restored 238.3 s 10.89 10.14–11.45

FPS is from 90 seconds of window-reported frame times, sampled about every 1.2 seconds after the scene and movement prompt both appeared. Load times include restoring the cache and exclude sandbox boot. One run per configuration. The synthetic test isolates the edge-flag regression. In the warmed, first-use comparison, the backported build showed the floor, the door, and the player's red uniform together after turning away from the window. The unmodified build showed much darker surfaces and clothing in that view. The warmed backport gave up about 1.2 FPS in the stationary window sample. Some facial material and lighting issues remain.

AI-assisted port and testing with Codex. The original fix and tests retain their upstream author credit.

Bring the vertex index mask and the synthetic raster tests from
Marvisak/VIctory#1718 (c0228d939ec1c206313f7e8cb44c922081b6f538)
to Flamingo. Keep the fork's lane bounds and unwritten vertex guards.
The edge flag occupies the tenth bit of each packed corner.

Co-authored-by: timorjay <203254134+timorjay@users.noreply.github.com>
realblastex pushed a commit that referenced this pull request Nov 25, 2026
…ins; Clippy clean

- victory-fork main (f85101b): a submit thread, a copy queue for fetches,
  safer indirect windows, the first room's descriptors mirrored, and the
  shader cache keyed on the translator instead of the executable.
- The mesh primitive edge-flag fix: a corner's index is 9 bits, the 10th is
  its edge flag (pull request #1, a port of upstream VIctory #1718).
- victory-amd: smaller mips detile from the texture's start; DirectStorage
  page arrays read when a request runs.
- Opt-in, from Belobug's fork (GPL-3.0): VICTORY_AMBIENT, FLAMINGO_QUAD_HELPERS.
- Clippy clean on both CI runs; progress log through run 85.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@realblastex

Copy link
Copy Markdown
Owner

Thank you for this! The edge-flag mask fix and its tests are in main as part of dc0c736 (a port of upstream VIctory #1718), credited in the README's Credits section. Closing since the change has landed.

realblastex pushed a commit that referenced this pull request Nov 25, 2026
…ins; Clippy clean

- victory-fork main (f85101b): a submit thread, a copy queue for fetches,
  safer indirect windows, the first room's descriptors mirrored, and the
  shader cache keyed on the translator instead of the executable.
- The mesh primitive edge-flag fix: a corner's index is 9 bits, the 10th is
  its edge flag (pull request #1, a port of upstream VIctory #1718).
- victory-amd: smaller mips detile from the texture's start; DirectStorage
  page arrays read when a request runs.
- Opt-in, from Belobug's fork (GPL-3.0): VICTORY_AMBIENT, FLAMINGO_QUAD_HELPERS.
- Clippy clean on both CI runs; progress log through run 85.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants