Repository navigation
Conversation
Every title texture got its host texture when the title created it, and every D3D12 resource is charged to the process commit when it is created, resident or not. The title creates far more textures than it draws with. With VIPORT_LAZY_HOST_TEXTURES set, a title texture only records the state and clear value it would be made with, and the host texture is made the first time something asks for it (host_copy, host_resource, host_transition, a placed texture over the same memory). A shader or unordered-access view of a texture not made yet is parked in its heap slot and made, with the texture, when a shader reads the slot, as views of placed textures already are: the title writes a view of every texture it streams in, so making the view at once would make every texture. Off by default: without the variable nothing changes. Measured in the menus: 22.9 GB without the variable, 11.7 GB with it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Owner
|
Merged into main by hand: the original commit by ForsunJay (d7d0e6d, message without the AI co-author line) plus f88b22b, which lets a parked heap view be made once its texture exists and removes the added doc comments. Measured on one base with VIPORT_LAZY_HOST_TEXTURES=1: video memory 13066 MB (over the budget) -> 7203 MB, host textures 8111 -> 5724, textures used by lists unchanged (4875 -> 4993 MB), no errors. Thank you. |
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.
What this changes
Related: T21 (#29).
Every title texture gets its host texture when the title creates it, and every D3D12 resource is charged to the process commit when it is created, resident or not. The title creates far more textures than it draws with.
With
VIPORT_LAZY_HOST_TEXTURESset, a title texture only records the state and clear value it would be made with. The host texture is made the first time something asks for it:host_copy,host_resource,host_transition, or a placed texture over the same memory.A shader or unordered-access view of a texture not made yet is parked in its heap slot and made, with the texture, when a shader reads the slot, as views of placed textures already are. Without this the change does nothing: the title writes a view of every texture it streams in, so making the view at once would make every texture.
Off by default: without the variable nothing changes.
Measured in the menus: 22.9 GB without the variable, 11.7 GB with it.
Only
resource.rsanddescriptor/host.rschange. No diagnostics counters and no README row for the variable are in this pull request.Checked
docs/asset-policy.mdbuild.rs, git hook,.cargoconfig, CI change or script (or an issue explains why)cargo test --workspacepasses (with--test-threads=1; see below for parallel runs)cargo clippy --workspace --all-targets --locked -- -D warningspassesrustfmt; I did not reformat lines I did not changeWhat I ran
On Windows, on this branch (base 15ad9a3):
cargo test --workspace --locked -- --test-threads=1: no failures (viport-gpu: 226 passed).cargo clippy --workspace --all-targets --locked -- -D warnings, with and without--features viport-gpu/diagnostics: clean.Two failures I saw are on
maintoo and are not from this change:frame::tests::waits_end_on_ticks_and_count_framesfails in some parallel runs ofcargo test -p viport-gpu: 4 of 20 runs on this branch, 4 of 20 onmain(15ad9a3). It does not fail with--test-threads=1.copystat::tests::counter_enum_matches_array_lengthfails with--features diagnosticsonmain(15ad9a3) and on this branch alike.No unit test for the change itself: the variable is read once per process and the effect needs a real device and the title. The figure above is from the menus only.
Overlaps
None that I know of among the open pull requests.
🤖 Generated with Claude Code