backend: pin the format/vertex-format/blend/root-args value rules with unit tests #476
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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:57:42Z.
What
crates/victory-backend/src/resources.rsandbackend.rsdecide how a console texture description becomes host values:Format::block()(texel or 4x4 block sizes),is_integer/is_depth,TextureDesc::d2defaults,VertexFormat::byte_size,Blend::second_source, andRootArgsappending root constants little-endian and root views padded to an 8-byte boundary before a 64-bit GPU address. None of it has tests, and every one of those rules is a value the GPU host then trusts.What this pins
TextureDesc::d2defaults andVertexFormat::byte_sizefor the formats the title uses;Blend::second_sourcefor the factor/op pairs that read it;RootArgs: constants appended little-endian, an address padded to 8 bytes then appended as a 64-bit little-endian address, and an address on an empty buffer being just the address.Test-only: no behaviour change, no new dependencies.
How it was tested
cargo test -p victory-backend(new unit tests)cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warningscargo xtask policyImported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-27T21:58:26Z.
/claim
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T21:58:36Z.
Claimed by @AnastasisKon. Open a draft pull request with
Refs #476in its description within 24 hours, or the claim expires.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T12:44:19Z.
/release - done without a PR: on branch
vibe/backend-value-rules-tests-4f9c68, in my fork'smain. The format, vertex-format, blend and root-arg value rules are pinned byformat_block_is_one_texel_or_a_4x4_block,format_integer_and_depth_flags,default_color_state_blends_nothing_and_writes_everythingandblend_second_source_reads_only_the_src1_factors.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-28T12:44:28Z.
Released. This issue is free to claim.