fix: upload guest texture writes on every submit until the first present #35

Open
github-bot wants to merge 1 commit from github-bot/gh-35 into main AGit
Owner

@⁠itsdpraven on GitHub · 2026-11-21 16:30 UTC · original
itsdpraven:fix/guest-texture-flush-before-first-present → main · +1 −1 · 1 files · 1 commits · open

What

test_d3d12_guest_texture fails on every run at tests/test_d3d12_guest_texture.cpp:136. The README lists it as a known failure.

Since bda18b4 the queue proxy flushes write-watched guest texture memory once per presented frame (g_flushed_epoch != g_frame_epoch). A client that never calls PresentX stays in frame epoch 0, so only its first ExecuteCommandLists uploads anything. Every later write to guest texture memory is dropped.

The test writes the texture through its guest address twice without presenting. The first pass reads back correctly. The second pass reads back the first pass's data: mip 0, row 0, byte 0 is 0x03 where 0xab was written.

Change

One line in QueueProxyExecuteCommandLists: flush on every submit while the frame epoch is still 0. After the first PresentX the once-per-frame behaviour is unchanged, so a title that presents keeps the saving from bda18b4.

Not covered

A title that writes guest texture memory after its first submit of a frame still gets that upload one frame late. That trade-off is unchanged here.

Tested

Windows 11 Pro 10.0.26200, WinLibs GCC 15.2.0 (UCRT, POSIX threads), Release, WARP.

test_d3d12_guest_texture full suite
main bda18b4 fails 4/4 22/23
this PR passes 3/3 23/23, three runs

Not tested with Concept Destruction or any other real title. I do not have one, so the frame-rate claim rests on the changed condition being true only before the first present.

No open PR touches this line or this test (#5 to #34 checked).

AI-assisted: yes (Claude Code).

🤖 Generated with Claude Code

**@⁠itsdpraven** on GitHub · 2026-11-21 16:30 UTC · [original](https://github.com/Freminet/ScarlettX/pull/35) `itsdpraven:fix/guest-texture-flush-before-first-present` → `main` · +1 −1 · 1 files · 1 commits · open ### What `test_d3d12_guest_texture` fails on every run at `tests/test_d3d12_guest_texture.cpp:136`. The README lists it as a known failure. Since bda18b4 the queue proxy flushes write-watched guest texture memory once per presented frame (`g_flushed_epoch != g_frame_epoch`). A client that never calls `PresentX` stays in frame epoch 0, so only its first `ExecuteCommandLists` uploads anything. Every later write to guest texture memory is dropped. The test writes the texture through its guest address twice without presenting. The first pass reads back correctly. The second pass reads back the first pass's data: mip 0, row 0, byte 0 is `0x03` where `0xab` was written. ### Change One line in `QueueProxyExecuteCommandLists`: flush on every submit while the frame epoch is still 0. After the first `PresentX` the once-per-frame behaviour is unchanged, so a title that presents keeps the saving from bda18b4. ### Not covered A title that writes guest texture memory after its first submit of a frame still gets that upload one frame late. That trade-off is unchanged here. ### Tested Windows 11 Pro 10.0.26200, WinLibs GCC 15.2.0 (UCRT, POSIX threads), Release, WARP. | | `test_d3d12_guest_texture` | full suite | |---|---|---| | `main` bda18b4 | fails 4/4 | 22/23 | | this PR | passes 3/3 | 23/23, three runs | Not tested with Concept Destruction or any other real title. I do not have one, so the frame-rate claim rests on the changed condition being true only before the first present. No open PR touches this line or this test (#5 to #34 checked). AI-assisted: yes (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Since bda18b4 the queue proxy flushes write-watched guest texture memory once per presented frame. A client that never calls PresentX stays in frame epoch 0, so only its first ExecuteCommandLists uploads anything and every later write to guest texture memory is dropped. test_d3d12_guest_texture writes the texture twice without presenting and read back the first pass's data. Flush on every submit while the frame epoch is still 0; after the first PresentX the once-per-frame behaviour is unchanged.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 19:56:38 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
The changes on this branch are already on the target branch. This will be an empty commit.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/35/head:github-bot/gh-35'
git switch 'github-bot/gh-35'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-35'
git switch 'github-bot/gh-35'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-35'
git switch 'github-bot/gh-35'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-35'
git switch 'main'
git merge --squash 'github-bot/gh-35'
git switch 'main'
git merge --ff-only 'github-bot/gh-35'
git switch 'main'
git merge 'github-bot/gh-35'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.