GPU: cache immutable HostTexture flags/format and descriptor heap start handles #2215
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2215
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2215/head"
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?
@RVZO6 on GitHub · 2026-11-25 08:05 UTC · original
RVZO6:rvzo/cache-texture-meta→main· +323 −79 · 7 files · 1 commits · closed without mergingHot per-draw, barrier, descriptor, and texture-upload paths in
victory-gpucurrently repeat immutable COM queries (ID3D12Resource::GetDesc(),GetCPUDescriptorHandleForHeapStart(),GetGPUDescriptorHandleForHeapStart()), cloneArc<HostTexture>on every barrier/lookup, and computelegal_state()twice per resource barrier:HostTexture::new()already callsGetDesc()once, yetlegal_state,view_format,takes, andtitle_writtenre-issueGetDesc()through D3D12 COM on every barrier, render-target/depth bind, and texture refresh.HostList::transition()andlist.rsbarriers each calllegal_state()separately and cloneArc<HostTexture>just to read immutable fields.Host::rtv(),Host::dsv(),Host::cpu_view(), andHostHeap::gpu()invokeGet{CPU,GPU}DescriptorHandleForHeapStart()on every descriptor allocation/lookup even though a heap's start handle is immutable for its lifetime.Claimed on #1633 (
https://github.com/Marvisak/VIctory/issues/1633#issuecomment-7155911614).The change
crates/victory-gpu/src/resource.rs:flags: D3D12_RESOURCE_FLAGSandformat: DXGI_FORMATonHostTexturefrom its existingGetDesc()inHostTexture::new().host_copy_ref()to borrowHostTexturewithout hot-pathArc::clonewhere callers only inspect metadata/resource handles.flags/formatvia pure helpersview_format_forandtakes_meta, adding testsview_format_for_reports_own_pc_format_only_when_host_differsandtakes_meta_checks_required_uses_and_format_compatibility.crates/victory-gpu/src/host.rs,crates/victory-gpu/src/list.rs,crates/victory-gpu/src/draw.rs,crates/victory-gpu/src/texture.rs,crates/victory-gpu/src/bindless.rs:legal_for(flags, state)once insideHostList::transition()and return the resolved target state to barrier callers, eliminating duplicateGetDesc()calls and extraArcclones.rtv_start,dsv_start, andcpu_view_starthandles onHost(using purering_handlehelper).host::tests::legal_for_strips_only_states_forbidden_by_resource_flags,host::tests::ring_handle_offsets_and_wraps_across_rtv_ring, andtexture::tests::title_written_flags_accepts_only_non_writable_textures.crates/victory-gpu/src/descriptor/host.rs:gpu: u64start handle onHostHeapand compute slot handles via puregpu_handlearithmetic.descriptor::host::tests::gpu_handle_offsets_by_index_and_step.Not a duplicate of
No open PR or
CLAIMS.mdentry caches immutableHostTextureflags/format, removes duplicate barrierGetDesc()/legal_state()calls, or cachesHost/HostHeapdescriptor-heap start handles. (#2187addresses readable-texture sharing policy for shader-denied textures and is orthogonal.)Tested
windows-latestMSVC + Windows WARP SM 6.6 CI run45572159221(Clippyclean,Clippy, diagnostics buildclean,Tests:715 passed; 0 failed; 10 ignored,victory-gpu:157 passed; 0 failed; 2 ignored+1 passed,xtask:6 passed; 0 failed):descriptor::host::tests::gpu_handle_offsets_by_index_and_step ... okhost::tests::legal_for_strips_only_states_forbidden_by_resource_flags ... okhost::tests::ring_handle_offsets_and_wraps_across_rtv_ring ... okresource::tests::view_format_for_reports_own_pc_format_only_when_host_differs ... okresource::tests::takes_meta_checks_required_uses_and_format_compatibility ... oktexture::tests::title_written_flags_accepts_only_non_writable_textures ... okNot run: the title; any hardware GPU. The title was not used in these tests.
AI-assisted: T3 Code (Antigravity, gemini-4-neon)
@Marvisak on GitHub · 2026-11-25 13:30 UTC · original · edited 2026-11-25 16:04 UTC
Automated triage for the maintainers.
This pull request no longer merges cleanly into
main(conflicts incrates/victory-gpu/src/bindless.rs,crates/victory-gpu/src/descriptor/host.rs,crates/victory-gpu/src/draw.rs,crates/victory-gpu/src/host.rs,crates/victory-gpu/src/list.rs,crates/victory-gpu/src/resource.rs,crates/victory-gpu/src/texture.rs). It will be reviewed once it is rebased onto the currentmain. The earlier verdict (needs-work) was for an older state ofmain.Generated by Claude Code
@RVZO6 on GitHub · 2026-11-25 17:13 UTC · original
Closing to keep the queue clean:
texture.rs/resource.rs/draw.rswere heavily updated on13f91caand I do not have a title run to profile this path.Pull request closed