backend: pin the format/vertex-format/blend/root-args value rules with unit tests #479
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/479"
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?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-27T21:59:13Z.
What this changes
Refs #476.
crates/victory-backend/src/resources.rsdecides how a console texture description becomes host values, andbackend.rsdecides the argument-buffer layout ofRootArgs. Neither had a single test, and every one of those rules is a value the GPU host then trusts — a block size or a root-view padding that drifts silently changes what the host allocates or appends.Two new test-only modules, declared under
cfg(test)so the build hash is unchanged:backend_tests.rs: root constants appended little-endian; an address padded to the next 8 bytes then appended as a 64-bit little-endian GPU address; an address on an empty buffer being just the address.resources_tests.rs:Format::block()for the single-texel formats and every BC1/2/4/6H/7 variant (signed and sRGB); which formats are integer and which are depth;TextureDesc::d2's defaults;VertexFormat::byte_size;Blend::second_source.No behaviour change, no new dependencies, no game data.
How it was tested
cargo test -p victory-backend: 10 passed, 0 failed (the new modules included).cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings: no warnings on this tree, withvictory-backendre-checked after touching the new files.cargo xtask policy: 398 files ok.Checklist
VICTORY_*variable and documented: none addedImported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-28T01:35:28Z.
Review: APPROVED
Check report (helping the maintainer clear the queue):
checkandmacos-scriptsgreen on the current head.226645f9) merged with this PR and the other test/docs/tools PRs we're landing in this batch (#397 #399 #422 #467 #471 #475 #479 #481 #486 #489 #494 #498 #505 #511). On it, thevictory-gpu(arm64),victory-shader,victory-backend,victory-metalandvictorytests pass, as do the macOS script tests (rustup-path.sh,run-summary-compare.sh,run-summary.sh --self-test), Windows clippy (-D warnings) andcargo xtask policy. Onevictory-gpurun in four failed main's ownmulti_mip_array_and_placed_depth_twins_preserve_all_subresources_and_remirror_immediately. That test also flakes on main alone, so it isn't from this batch.Thanks @AnastasisKon!