Formats: map console texture formats 189-191 #735

Open
davutsimsekk wants to merge 1 commit from upstream-pr/735 into main
davutsimsekk commented 2026-11-25 05:53:20 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by davutsimsekk on 2026-11-25T05:53:20Z.


texture::format returned None for the console-only DXGI formats 189 (signed 10-bit colour), 190 (two 4-bit channels) and 191 (24/8 colour). Their byte sizes are already known in victory-gpu's element table (189/191 = 4 bytes, 190 = 1 byte), but the texture layout rejected them, so xg::texture failed with E_INVALIDARG and the GPU fell back to a packed footprint.

This maps 189 and 191 to 4-byte elements and 190 to a 1-byte element, as the rest of the code already describes them.

Test

console_formats_have_layouts checks all three formats return the expected Format.

  • cargo test -p victory-formats --lib: 25 passed, 0 failed, 4 ignored
  • cargo clippy -p victory-formats --all-targets --locked -- -D warnings: clean
  • The changed hunk is rustfmt-clean; the file has unrelated pre-existing formatting.
  • No game data or GPU was used.
<!-- greyfinch-sync:fxceless/victory-fork:issue:6598193028 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/735). Originally posted by [davutsimsekk](https://github.com/davutsimsekk) on 2026-11-25T05:53:20Z. --- `texture::format` returned `None` for the console-only DXGI formats 189 (signed 10-bit colour), 190 (two 4-bit channels) and 191 (24/8 colour). Their byte sizes are already known in `victory-gpu`'s element table (189/191 = 4 bytes, 190 = 1 byte), but the texture layout rejected them, so `xg::texture` failed with `E_INVALIDARG` and the GPU fell back to a packed footprint. This maps 189 and 191 to 4-byte elements and 190 to a 1-byte element, as the rest of the code already describes them. ## Test `console_formats_have_layouts` checks all three formats return the expected `Format`. - `cargo test -p victory-formats --lib`: 25 passed, 0 failed, 4 ignored - `cargo clippy -p victory-formats --all-targets --locked -- -D warnings`: clean - The changed hunk is rustfmt-clean; the file has unrelated pre-existing formatting. - No game data or GPU was used.
avt0m4t48 commented 2026-11-25 07:06:18 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by avt0m4t48 on 2026-11-25T06:47:03Z.


Independently checked this on the exact PR head (f3d3d7bb9643b3044ff58437afaec0a5671e4782) and with the single-commit patch applied cleanly to the listed base/current main (8dd30ab472697c47b141c273c2a00f8ce1c00520).

An original CPU-only fixture calls Texture::new with formats 189/190/191, full mip chains, 1×1/13×9/37×19 textures (1/3/2 slices), and linear, 256B standard, 4KB display, and 64KB standard swizzles. The PR parent (310c6eb) and unpatched main rejected all 36 descriptors. The PR head and patched main accepted all 36 as single-plane 4/1/4-byte formats and matched all 300 subresource copies byte for byte, including padding guards and comparison with the element offsets. All snapshots passed the 24 layout / 200 copy controls for formats 28 and 61, and rejected the three unknown control IDs.

The Linux victory-formats library suite passed on the PR head (25 passed, 4 ignored) and patched main (26 passed, 4 ignored). Strict all-target Linux Clippy and Windows MSVC cross-target cargo check --tests for victory-formats passed on both. Coverage was limited to CPU layout and copying plus cross-target compilation. The test used synthetic bytes, with native Windows and D3D12 execution still unverified.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7155153160 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/735#issuecomment-7155153160). Originally posted by [avt0m4t48](https://github.com/avt0m4t48) on 2026-11-25T06:47:03Z. --- Independently checked this on the exact PR head (`f3d3d7bb9643b3044ff58437afaec0a5671e4782`) and with the single-commit patch applied cleanly to the listed base/current `main` (`8dd30ab472697c47b141c273c2a00f8ce1c00520`). An original CPU-only fixture calls `Texture::new` with formats 189/190/191, full mip chains, 1×1/13×9/37×19 textures (1/3/2 slices), and linear, 256B standard, 4KB display, and 64KB standard swizzles. The PR parent (`310c6eb`) and unpatched `main` rejected all 36 descriptors. The PR head and patched `main` accepted all 36 as single-plane 4/1/4-byte formats and matched all 300 subresource copies byte for byte, including padding guards and comparison with the element offsets. All snapshots passed the 24 layout / 200 copy controls for formats 28 and 61, and rejected the three unknown control IDs. The Linux `victory-formats` library suite passed on the PR head (25 passed, 4 ignored) and patched `main` (26 passed, 4 ignored). Strict all-target Linux Clippy and Windows MSVC cross-target `cargo check --tests` for `victory-formats` passed on both. Coverage was limited to CPU layout and copying plus cross-target compilation. The test used synthetic bytes, with native Windows and D3D12 execution still unverified.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/735:upstream-pr/735'
git switch 'upstream-pr/735'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/735'
git switch 'upstream-pr/735'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/735'
git switch 'upstream-pr/735'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/735'
git switch 'main'
git merge --squash 'upstream-pr/735'
git switch 'main'
git merge --ff-only 'upstream-pr/735'
git switch 'main'
git merge 'upstream-pr/735'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!735
No description provided.