Repository navigation
d3d12: publish texture writes to plain data pages with a store - #290
Merged
Merged
Conversation
…ges and memory past it alone The texture-publication self-test places a tiled RGBA8 100x60 texture across ordinary and write-watch title memory, learns where each texel lives from a read, closes one page, and has the GPU write the texture four times while a compute queue waits for the last write's label. Whether a published write shows in the write watch depends on the host, so only the watched pages past the texture must stay unrecorded. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Under Wine the native write is a request to the server for every run of texels, even in the provider's own process. Committed read-write pages that are not write-watched now take a copy that reports a fault instead of raising it, since the title can unmap its pages after they were queried. Write-watch, copy-on-write and executable pages keep their existing writes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #215. A throughput improvement for texture publication. It does not resolve #215; see the measurements there.
Problem
Publication writes each run of texels back to guest memory with one
NtWriteVirtualMemorycall. Under Wine each call is a wineserver round trip. In the ProjectScarlett intro stall that was about 98k calls per publication job and 90k wineserver context switches per second. The texture readback thread and wineserver spent most of their time on it.Change
write_mappedcopies with a store when the region is committed, exactlyPAGE_READWRITE, and not write-watched.rep movsbroutine. The provider's existing vectored handler resumes it at its failure return if the store faults (access violation, in-page error or guard page). So a page the title decommits or protects mid-copy gives the sameE_FAILas before, not a crash.PAGE_WRITECOPYand executable regions keep the native write, so what a title's write watch sees is unchanged.Measured (RTX 5090, driver 620.70.10, GE-Proton11-14, ProjectScarlett story intro, same build with and without the change, probe totals over the world phase):
Each job still reads back and copies about 650 MiB, which is why frames stay slow. That cost is the subject of #215.
Tests
texture-publication.MEM_WRITE_WATCHallocation.PAGE_NOACCESStexel page is left unchanged, that all padding keeps its sentinel, and that nothing past the texture in the watched allocation is touched.tests/device/placement_guarded_copy.rsandtests/device/placement_writeback.rs. These are typechecked for the Windows target but not run, since the d3d12 tests have no runner here.Checks (on
ab644f0)python -m unittest discover -s tests -q: OK.python tuxbox.py check --adapter 1002:13c0 --proton … --prefix … --windows-dxc …passed, 128 gates, includinglanes-selftest-texture-publication.Overlap: #258 also edits
write_mapped, in a different hunk. The only conflict is theregionparameter type on the signature line.🤖 Generated with Claude Code