Read a host texture's flags once instead of on every use #31
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!31
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-31"
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?
@romainhedouin on GitHub · 2026-11-25 12:32 UTC · original
romainhedouin:perf/transition-flags→main· +30 −15 · 6 files · 1 commits · closed without mergingFor each texture a draw uses, the code asked D3D12 for the texture's description (
GetDesc, a COM call) just to read its flags: once to pick a legal state and once more to know whether the title fills it. It also copied a reference-counted pointer each time. The flags never change after creation, so they are now read once when the host texture is made and kept with it.GetDesccalls, sampled textureGetDesccalls, render target or depthArcclone + drop (texture already in the list)Counts from the code, not timings. Type-checked for Windows (
cargo clippy --target x86_64-pc-windows-msvc, with and without--all-features, no new warnings); not run.🤖 Generated with Claude Code
@romainhedouin on GitHub · 2026-11-26 22:24 UTC · original
Closing:
a-publieralready reads a host texture's flags once, at creation (HostTexture.flags, resource.rs:1193 and :2377), and uses the cache intransitionand the per-draw check (host.rs:6653, draw.rs:4420).Pull request closed