[pr-tests][rendering] darner-formats: pin the full mip chain of a mips: 0 description #387
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!387
Loading…
Reference in a new issue
No description provided.
Delete branch "qnjk/Darner:formats-zero-mips-test"
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?
Contributor role (optional)
What it changes
The problem on main: nothing. This is a tests-only change: no production line is edited, so it needs no A/B result and no gameplay run (CONTRIBUTING's rule for tests-only changes).
What it pins:
Texture::newderives the number of mips when the description asks for the whole chain (mips: 0, the D3D12 default):(
crates/darner-formats/src/texture.rs:1618-1621). That count becomes theDesc.mipsof every plane (:1622-1632), and every plane's offsets and the returnedTexture::sizefollow from it. No test in the crate ever passedmips: 0toTexture::new: everyTexture::newtest usesmips: 1throughRGBA8_TEXTURE, and the only literalmips: 0in the file is aDeschanded toLayout::new, which rejects it. The two terms a reader would get wrong were pinned only by the comment beside them: the32 - leading_zerosoff-by-one (which changes the mip count, and so the allocation size, of every texture described withmips: 0) and.max(depth3d)(without it a 40-deep volume gets five mips and loses the top of its chain).The new test
zero_mips_means_the_full_chainasks for 64x16 and 16x64 flat textures (seven mips each, so the height counts as a side) and a 16x16x64 volume (seven, against the five its face alone would give), and checks that a description naming one mip still gets one.How it was tested
2efc784(one commit onf3840d7).cargo test --locked -p darner-formats— 88 passed, 7 ignored, 0 failed.cargo test --locked -p darner-formats --lib zero_mips— 1 passed.cargo clippy --locked -p darner-formats --all-targets -- -D warningspasses.cargo clippy --workspace --all-targets --locked -- -D warnings: passes.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passes.cargo test --workspace --locked: not green on this machine, and not because of this change. Three pre-existing failures, each covered by an open pull request:darner-gpustands still in parallel on the test deadlock #224 describes, and serially it finishes 1772 passed and 1 failed (pipeline::make::tests::a_capped_draw_waits_once_then_drops, which passes on its own) beside the order-dependentwatch::tests::ask_once_by_res_splits_reservations_without_refusalsandtexture::ahead::tests::drain_waits_until_then_callbacks_have_runflakes that #150 is about;darner-shaderfailsemit::waterfall_tests::sampled_marks_restore_early_depth_only_when_safe_in_pixel_shaders, whose fixture #227 fixes. Every other crate passes, anddarner-formatsdoes.mips: 0description whosewidth,heightanddepth_or_arrayare all 0 is not pinned.Checklist
main.docs/asset-policy.md. (cargo xtask policy: 555 files ok.)Checked for overlap
crates/darner-formats/src/texture.rs(neither touchesTexture::new's mip-count branch or the tests beside it). No issue or pull request mentionszero_mips,mips: 0or the full-chain branch.mips: 0description 2efc784b18No test passed `TextureDesc.mips = 0` to `Texture::new`, though that is the D3D12 default ("the whole chain") and the branch that derives the count from the largest side is what every such allocation takes its offsets and its size from: `32 - largest.leading_zeros()` at `texture.rs:1618`. An off-by-one there changes the mip count, and so the size, of every texture described that way, and dropping the `.max(depth3d)` gives a 40-deep volume five mips instead of six. Both terms were pinned only by the comment beside them. The test asks for 64x16 and 16x64 flat textures (seven mips, so the height counts as a side) and a 16x16x64 volume (seven, against the five its face alone would give), and checks that a description naming one mip still gets one. Pure function: no GPU, no title, no fixture.