GPU: query view-heap limit upfront and clamp host scissors to targets (#726) #847
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!847
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-847"
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?
@Starchaser1024 on GitHub · 2026-11-28 07:41 UTC · original
Starchaser1024:fix/d3d12-heap-and-scissor-726→main· +649 −24 · 2 files · 1 commits · closed without mergingSummary
Resolves the remaining two D3D12 debug-layer findings reported in #726 (
id=645andid=1378), complementing #753 (WM_CLOSE) and #787 (id=538andid=646, which leaves645and1378untouched so the two PRs have no overlap).id=645ERROR (CREATE_DESCRIPTOR_HEAP_INVALID_DESC)2 -> 0probe_view_limitunconditionally callsCreateDescriptorHeapwith4,194,304and2,097,152shader-visible view descriptors before falling back toPORTABLE_VIEWS(1,000,000). NVIDIA GPUs reportD3D12_RESOURCE_BINDING_TIER_3while capping shader-visible view heaps at1,000,000.D3D12_FEATURE_D3D12_OPTIONS19::MaxViewDescriptorHeapSizeupfront (falling back toD3D12_FEATURE_D3D12_OPTIONS::ResourceBindingTier < Tier 3 => 1,000,000on older runtimes). Skip probes above the device's reported ceiling while keeping4,194,304raw-twin heaps on Tier 3 adapters whoseMaxViewDescriptorHeapSize >= 4,194,304.id=1378WARNING (DRAW_POTENTIALLY_OUTSIDE_OF_VALID_RENDER_AREA)~670 -> 01706x960scene targets,2560x1440output), passes bind a2560x1440viewport and[0, 0, 2560, 1440]scissor while the bound RTV/DSV is1706x960, somin(viewport_end, scissor_end) > min_target_dim.(width, height)across bound live RTVs and DSV indraw::State(target_bounds) and clamp only the host scissor rectangles (host_scissors) acrossset_scissors,set_targets,replay, andmesh_scissor. Raw title viewports and rawState::scissorsstay untouched so NDC-to-pixel rasterization math (includingnative_frontend_viewport) is preserved and widens back automatically when a larger target is bound.Verification
Tested on NVIDIA GeForce RTX 5060 Ti (16 GB), Windows 11:
descriptor::host::view_limit_tests::shader_visible_view_heap_stays_within_device_limit: verifiesD3D12_FEATURE_D3D12_OPTIONS19::MaxViewDescriptorHeapSize(1,000,000on RTX 5060 Ti), confirmsprobe_view_limitandHostHeap::newstay within the limit without triggeringid=645.draw::scissor_clamp_tests::scissors_clamp_to_smallest_target_and_preserve_unbounded_drawsandoversized_2560x1440_viewport_and_scissor_on_1706x960_target_runs_cleanly: tests both bind orders (set_scissorsbefore/afterset_targets), multi-RTV minimum bounds, mip-sliced RTV bounds,State::replay, and executes a2560x1440viewport draw onto a1706x960RTV on the GPU verifyingID3D12InfoQueuecleanliness and pixel readback.cargo test -p victory-gpu --locked: 456 passed, 0 failed.cargo clippy --workspace --all-targets --all-features --locked: 0 warnings in changed files.cargo xtask policy: 294 files ok.@Aniseto on GitHub · 2026-11-28 07:50 UTC · original
Ran the view-heap and scissor tests at
c15d75don an NVIDIA Blackwell desktop part:Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, Rust 1.98.1 (pinned by
rust-toolchain.toml), MSVC 14.44.35207, DXC 1.9.2609.5 (shared env), debug build;VICTORY_D3D12_ADAPTER=NVIDIA.The view-heap limit test and
scissors_clamp_to_smallest_target_and_preserve_unbounded_drawspass. The GPU testoversized_2560x1440_viewport_and_scissor_on_1706x960_target_runs_cleanlyfails with an unexpected D3D12 debug-layer message:id=820 sev=2: ID3D12CommandList::ClearRenderTargetView: The application did not pass any clear value to resource creation.... I am reporting that exact output; I did not determine whether the warning comes from this change, from the test fixture or from this driver. The author's run was on an RTX 5060 Ti, so this adds the first RTX 5070 Ti datapoint in the thread.Not tested: a real DLSS Quality frame, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
@Starchaser1024 on GitHub · 2026-11-28 13:07 UTC · original
Thanks @Aniseto for testing on RTX 5070 Ti with the D3D12 SDK layers enabled — great to see both id=645 (iew_limit_tests) and id=1378 (DRAW_POTENTIALLY_OUTSIDE_OF_VALID_RENDER_AREA) stay at 0!
Good catch on id=820: the synthetic 1706x960 test texture in oversized_2560x1440_viewport_and_scissor_on_1706x960_target_runs_cleanly was created with pOptimizedClearValue: None before ClearRenderTargetView(&[0.0; 4]), which emits D3D12 performance warning id=820 (CLEARRENDERTARGETVIEW_MISMATCHINGCLEARVALUE). Fixed in
4ce867fby passing the matching D3D12_CLEAR_VALUE at resource creation and filtering for errors + id=1378.GPU: query view-heap limit upfront and clamp host scissors to targets (#726)to [pr-fix][rendering][dlss][NVIDIA] GPU: query view-heap limit upfront and clamp host scissors to targets (#726)4ce867f01etoe4657aad8f[pr-fix][rendering][dlss][NVIDIA] GPU: query view-heap limit upfront and clamp host scissors to targets (#726)to GPU: query view-heap limit upfront and clamp host scissors to targets (#726)Pull request closed