GPU: reject shader-visible RTV and DSV heap creation #2959

Open
andrewpozdnakov7-jpg wants to merge 1 commit from upstream-pr/2961 into main
andrewpozdnakov7-jpg commented 2026-11-26 01:34:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-26T01:34:29Z.


CreateDescriptorHeap now returns E_INVALIDARG when an RTV or DSV heap is requested with SHADER_VISIBLE and an output object. Only CBV/SRV/UAV and sampler heaps support the flag. D3D12 descriptor heap flags.

On both inbox and app-local D3D12 WARP, the two shader-visible RTV/DSV creations returned E_INVALIDARG with no heap. Six valid combinations of type and flag created an object. The eight null-output calls returned S_FALSE. The test uses one descriptor per heap.

The same fixture through VIctory's device vtable on main at 63bcca43 failed because the shader-visible RTV case returned S_OK and an object. The patch passes the complete 16-call matrix.

Eight descriptor tests and the full WARP GPU diagnostics suite passed (247 passed, one ignored). Strict GPU Clippy with default and diagnostic features and asset policy passed.

AI-assisted. Validation used synthetic calls and software WARP.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5502322498 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2961). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-26T01:34:29Z. --- CreateDescriptorHeap now returns E_INVALIDARG when an RTV or DSV heap is requested with SHADER_VISIBLE and an output object. Only CBV/SRV/UAV and sampler heaps support the flag. [D3D12 descriptor heap flags](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_descriptor_heap_flags). On both inbox and app-local D3D12 WARP, the two shader-visible RTV/DSV creations returned E_INVALIDARG with no heap. Six valid combinations of type and flag created an object. The eight null-output calls returned S_FALSE. The test uses one descriptor per heap. The same fixture through VIctory's device vtable on main at 63bcca43 failed because the shader-visible RTV case returned S_OK and an object. The patch passes the complete 16-call matrix. Eight descriptor tests and the full WARP GPU diagnostics suite passed (247 passed, one ignored). Strict GPU Clippy with default and diagnostic features and asset policy passed. AI-assisted. Validation used synthetic calls and software WARP.
fuzeofficlal commented 2026-11-26 01:55:46 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T01:55:46Z.

Review: COMMENTED


Reviewed and verified against main (63bcca43) on Windows 11 (RTX 5090 + WARP, VICTORY_D3D12_DEBUG=1) — clean fix and ready to merge:

  • crates/victory-gpu/src/descriptor.rs:749-754 rejects SHADER_VISIBLE on non-CBV_SRV_UAV/SAMPLER descriptor heaps (RTV 2 / DSV 3) with E_INVALIDARG while preserving the out.is_null() S_FALSE probe path and normal shader-visible view/sampler heap creation.

Local verification:

  • RTX 5090 (VICTORY_D3D12_DEBUG=1): descriptor::tests 8/8 (including shader_visibility_is_rejected_for_rtv_and_dsv_heaps), descriptor::host::tests 14/14 (excluding pre-existing NVIDIA 1M view-heap baseline test)
  • WARP (--features diagnostics, VICTORY_D3D12_DEBUG=1): descriptor:: 23/23 passed
  • cargo clippy -p victory-gpu --all-targets (default & --features diagnostics) + cargo xtask policy (191 files ok): 0 warnings
<!-- greyfinch-sync:Marvisak/VIctory:review:6067525290 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2961#pullrequestreview-6067525290). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T01:55:46Z. **Review:** COMMENTED --- Reviewed and verified against `main` (`63bcca43`) on Windows 11 (RTX 5090 + WARP, `VICTORY_D3D12_DEBUG=1`) — clean fix and ready to merge: - `crates/victory-gpu/src/descriptor.rs:749-754` rejects `SHADER_VISIBLE` on non-`CBV_SRV_UAV`/`SAMPLER` descriptor heaps (RTV `2` / DSV `3`) with `E_INVALIDARG` while preserving the `out.is_null()` `S_FALSE` probe path and normal shader-visible view/sampler heap creation. **Local verification**: - RTX 5090 (`VICTORY_D3D12_DEBUG=1`): `descriptor::tests` **8/8** (including `shader_visibility_is_rejected_for_rtv_and_dsv_heaps`), `descriptor::host::tests` **14/14** (excluding pre-existing NVIDIA 1M view-heap baseline test) - WARP (`--features diagnostics`, `VICTORY_D3D12_DEBUG=1`): `descriptor::` **23/23 passed** - `cargo clippy -p victory-gpu --all-targets` (default & `--features diagnostics`) + `cargo xtask policy` (`191 files ok`): 0 warnings
kotekompotek commented 2026-11-26 02:22:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T02:22:54Z.

Review: COMMENTED


Verified: D3D12 only allows D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE on CBV_SRV_UAV and SAMPLER heaps — rejecting RTV(2)/DSV(3) before allocation is correct, and keeping the rejection behind !out.is_null() preserves the S_FALSE null-output probe path the title relies on. Test covers the matrix.

<!-- greyfinch-sync:Marvisak/VIctory:review:6067722538 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2961#pullrequestreview-6067722538). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-26T02:22:54Z. **Review:** COMMENTED --- Verified: D3D12 only allows D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE on CBV_SRV_UAV and SAMPLER heaps — rejecting RTV(2)/DSV(3) before allocation is correct, and keeping the rejection behind !out.is_null() preserves the S_FALSE null-output probe path the title relies on. Test covers the matrix.
Marvisak commented 2026-11-26 06:03:44 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T05:36:00Z.


Automated triage for the maintainers.

Needs work. The change in create_heap (victory-gpu/src/descriptor.rs) makes the emulated console device return E_INVALIDARG for a shader-visible RTV/DSV heap. The code itself is small and the test is clear, but the evidence is desktop D3D12 (the Learn page and WARP), while this function stands in for the console's runtime, whose validation can differ. The title only ever sees what the console runtime does, so an E_INVALIDARG here is only right if the console runtime also refuses this call; if it does not, the change could turn an accepted call into a failure. Either way, a call the title never makes gains nothing from this.

What would change the verdict: evidence that the console runtime rejects this flag combination (for example, the title's own code checking for that failure), or a log showing the title makes this call. Without that, this looks like a guard for a case that does not occur.

CI: passing.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7183632858 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2961#issuecomment-7183632858). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-26T05:36:00Z. --- <!-- victory-triage v1 head=70d6b075b23bce058e2e398e84a019267717bb96 verdict=needs-work at=2026-11-26T05:35:49Z --> Automated triage for the maintainers. **Needs work.** The change in `create_heap` (`victory-gpu/src/descriptor.rs`) makes the emulated console device return `E_INVALIDARG` for a shader-visible RTV/DSV heap. The code itself is small and the test is clear, but the evidence is desktop D3D12 (the Learn page and WARP), while this function stands in for the console's runtime, whose validation can differ. The title only ever sees what the console runtime does, so an `E_INVALIDARG` here is only right if the console runtime also refuses this call; if it does not, the change could turn an accepted call into a failure. Either way, a call the title never makes gains nothing from this. What would change the verdict: evidence that the console runtime rejects this flag combination (for example, the title's own code checking for that failure), or a log showing the title makes this call. Without that, this looks like a guard for a case that does not occur. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
cloph-dsp commented 2026-11-27 00:13:58 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-27T00:13:58Z.


Independent Windows verification of PR #2961 (GPU: reject shader-visible RTV and DSV heap creation).

  • Head: 70d6b07, base main, merge-base 63bcca4. OPEN, MERGEABLE/CLEAN, non-draft, no formal approval, no prior comment from me.
  • Toolchain: Windows, Rust 1.100.0/MSVC, cargo test --locked, worktree-local CARGO_TARGET_DIR, CARGO_BUILD_JOBS=2 (repo pins 1.98.1; no clippy/rustup). No game data, synthetic fake D3D12 vtable only, GPU/driver N/A.
  • Command: cargo test --locked -p victory-gpu --lib descriptor::tests::shader_visibility_is_rejected_for_rtv_and_dsv_heaps -- --exact
  • Result: test result: ok. 1 passed; 0 failed; 0 ignored; 232 filtered out.
  • git diff --check against merge-base 63bcca4: clean (exit 0).
  • Negative control: test name absent from origin/main (0 hits).

Caveat: only the targeted synthetic test was run; real D3D12 device behaviour and the full crate suite were not exercised.

AI-assisted (Hy4 flash). No game assets, extracted shaders, keys or DRM content used or uploaded.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7206287287 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2961#issuecomment-7206287287). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-27T00:13:58Z. --- Independent Windows verification of PR #2961 (GPU: reject shader-visible RTV and DSV heap creation). - Head: `70d6b07`, base `main`, merge-base `63bcca4`. OPEN, MERGEABLE/CLEAN, non-draft, no formal approval, no prior comment from me. - Toolchain: Windows, Rust 1.100.0/MSVC, `cargo test --locked`, worktree-local `CARGO_TARGET_DIR`, `CARGO_BUILD_JOBS=2` (repo pins 1.98.1; no clippy/rustup). No game data, synthetic fake D3D12 vtable only, GPU/driver N/A. - Command: `cargo test --locked -p victory-gpu --lib descriptor::tests::shader_visibility_is_rejected_for_rtv_and_dsv_heaps -- --exact` - Result: `test result: ok. 1 passed; 0 failed; 0 ignored; 232 filtered out`. - `git diff --check` against merge-base `63bcca4`: clean (exit 0). - Negative control: test name absent from `origin/main` (0 hits). Caveat: only the targeted synthetic test was run; real D3D12 device behaviour and the full crate suite were not exercised. AI-assisted (Hy4 flash). No game assets, extracted shaders, keys or DRM content used or uploaded.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2961:upstream-pr/2961'
git switch 'upstream-pr/2961'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2961'
git switch 'upstream-pr/2961'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2961'
git switch 'upstream-pr/2961'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2961'
git switch 'main'
git merge --squash 'upstream-pr/2961'
git switch 'main'
git merge --ff-only 'upstream-pr/2961'
git switch 'main'
git merge 'upstream-pr/2961'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!2959
No description provided.