gpu: skip self-CopyResource when src and dst share host texture #51

Open
github-bot wants to merge 2 commits from github-bot/gh-51 into main AGit
Owner

@⁠jmal423 on GitHub · 2026-11-25 13:01 UTC · original
jmal423:pr/skip-self-copy-resource → main · +81 −2 · 2 files · 2 commits · open

Skips redundant/undefined CopyResource calls when to == from (source and destination resolve to the same host texture).

Tested on Windows 11 / AMD Radeon RX 9070 XT:

  • cargo test -p victory-gpu: 109 passed, 0 failed, 4 ignored
  • Live GTA 6 Series X session (24m35s up to the heist): 0 DEVICE_HUNG, 0 crashes.
**@⁠jmal423** on GitHub · 2026-11-25 13:01 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/51) `jmal423:pr/skip-self-copy-resource` → `main` · +81 −2 · 2 files · 2 commits · open Skips redundant/undefined `CopyResource` calls when `to == from` (source and destination resolve to the same host texture). Tested on Windows 11 / AMD Radeon RX 9070 XT: - `cargo test -p victory-gpu`: 109 passed, 0 failed, 4 ignored - Live GTA 6 Series X session (24m35s up to the heist): 0 `DEVICE_HUNG`, 0 crashes.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:34:34 +00:00
@ -657,3 +657,2 @@
) {
// shortcut: not between textures without their largest mips.
if crate::resource::skipped_mips(dst) + crate::resource::skipped_mips(src) > 0 {
// shortcut: not between textures without their largest mips, or self-copy.
Author
Owner

@⁠gut0to on GitHub · 2026-11-25 14:57 UTC · original

Could you add a focused self-copy regression for this branch? The PR's GPU/game run is useful, but there is no test showing that a CopyResource whose source and destination resolve to the same host resource is skipped without recording a command. AI-assisted review.

**@⁠gut0to** on GitHub · 2026-11-25 14:57 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/51#discussion_r4696740989) Could you add a focused self-copy regression for this branch? The PR's GPU/game run is useful, but there is no test showing that a CopyResource whose source and destination resolve to the same host resource is skipped without recording a command. AI-assisted review.
@ -657,3 +657,2 @@
) {
// shortcut: not between textures without their largest mips.
if crate::resource::skipped_mips(dst) + crate::resource::skipped_mips(src) > 0 {
// shortcut: not between textures without their largest mips, or self-copy.
Author
Owner

@⁠jmal423 on GitHub · 2026-11-25 15:40 UTC · original

Added in 8773257: \list::tests::copy_resource_skips_same_host_texture\ verifies that \copy_resource\ and \copy_resource_x\ with identical source and destination host textures return early without recording state transitions or a copy command (contrasted against a copy between two distinct host textures on the same list). Verified with \cargo test -p victory-gpu --lib list::tests\ (6 passed).

**@⁠jmal423** on GitHub · 2026-11-25 15:40 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/51#discussion_r4697309064) Added in 8773257: \list::tests::copy_resource_skips_same_host_texture\ verifies that \copy_resource\ and \copy_resource_x\ with identical source and destination host textures return early without recording state transitions or a copy command (contrasted against a copy between two distinct host textures on the same list). Verified with \cargo test -p victory-gpu --lib list::tests\ (6 passed).
Author
Owner

@⁠copilot-pull-request-reviewer[bot] on GitHub · 2026-11-25 13:01 UTC · original · reviewed

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

**@⁠copilot-pull-request-reviewer[bot]** on GitHub · 2026-11-25 13:01 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/51#pullrequestreview-6058087084) · **reviewed** Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Author
Owner

@⁠gut0to on GitHub · 2026-11-25 14:57 UTC · original · reviewed

AI-assisted review: I checked the new early return and the verification described in the PR.

**@⁠gut0to** on GitHub · 2026-11-25 14:57 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/51#pullrequestreview-6059988777) · **reviewed** AI-assisted review: I checked the new early return and the verification described in the PR.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/51/head:github-bot/gh-51'
git switch 'github-bot/gh-51'

Merge

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