mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:45:53 +01:00
[PR #2032] d3d12: copy shader writes in a title window back to the title's pages (TITLE-GPU-WRITE-BACK) #2036
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2036
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2032
Author: @BubsMcgee
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/title-gpu-write-back📝 Commits (2)
9f9486ed3d12: copy shader writes in a title window back to the title's pagesf3c6c18d3d12: copy title-window writes back after the submission that made them📊 Changes
4 files changed (+386 additions, -0 deletions)
View changed files
📝
runtime/CMakeLists.txt(+4 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+91 -0)➕
runtime/src/title_write_back.h(+170 -0)➕
runtime/test/title_write_back_test.cpp(+121 -0)📄 Description
Ports the first gap from DexNom/VIctory (GPL-3.0-or-later), commits
cd94d35and940d32f, reworked for this layer.The gap
Our title-memory copies are one way:
ShadowPagescopies the title's pages into the GPU copies before everysubmission, and nothing copies a shader's writes back. A UAV/raw-address store into a title window landed in the copy
and was invisible to the title (and could be overwritten by the next refresh).
What this does
runtime/src/title_write_back.h: a registry of title windows (their title range and host copy) and the ranges ashader wrote, split at window edges, merged when adjacent, taken once for copy-back.
make_title_windowregisters the window;write_buffer_uavmarks the buffer's range when a view that names thetitle's pages is made.
set_before_execute,flush_title_write_backscopies each marked range back. The refreshhas just put every page the title wrote into the same copies, so a page copied back cannot lose a title write; the
copy-back waits for the device first, and skips pages the title has no readable mapping for.
Limits and gating
LEONIDA_TITLE_WRITE_BACK=1enables it; default off until a retail A/B.fast one. Shader-side page marks (VIctory's
view_marks) are the optimization once this is proven.Tests
title_write_back_test(9 checks): marks split at window edges, merge when adjacent, respect the window end,are taken once, and ignore addresses outside every window.
title_write_back: OK.Renamed to this repository's conventions (no VIctory file names). Attribution is in the header comment. AI-assisted.
Claimed as
TITLE-GPU-WRITE-BACKin the coordination issue.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.