gpu: build again after 5668b8b (Layout::bytes_from from myokex/victory-amd) #64

Open
github-bot wants to merge 1 commit from github-bot/gh-64 into main AGit
Owner

@⁠lcg007xd-c on GitHub · 2026-11-25 21:30 UTC · original
lcg007xd-c:fix/texture-bytes-from → main · +56 −2 · 2 files · 1 commits · open

What this fixes

main has failed the Windows check job since 5668b8b ("port VICTORY_TEXTURE_HEAPS and VICTORY_STAGING_BLOCKS from myokex/victory-amd"):

error[E0599]: no method named `bytes_from` found for struct `victory_formats::texture::Layout`
error: could not compile `victory-gpu` (lib) due to 3 previous errors

The ported callers, in gpu/texture.rs:1766/1771 and gpu/resource.rs:3012 (placed_bytes_from), use Layout::bytes_from. That method lives in victory-formats in myokex's commit and was not brought along.

The change (from the same commit, myokex/victory-amd c3723f3, GPL-3.0)

  • Layout::bytes_from(first): the bytes mip first and the smaller mips take from the start of the texture, since smaller mips lie nearer the start. It returns the whole layout from mip 0, and whenever the chain repeats per slice: array slices, 3D, thick layouts, MSAA.
  • detile/tile: now accept a tiled buffer of bytes_from(mip) bytes instead of the whole layout. The new callers pass exactly that much, so without this their uploads of the smaller mips would get TooSmall. Every other case is unchanged, because bytes_from returns the full size there.
  • myokex's test smaller_mips_need_only_the_start_of_the_texture: for every mip of a 1024² BC1 texture, reading from exactly bytes_from(mip) bytes gives the same pixels as reading from the whole texture, and one byte less is TooSmall. It passes on VItoriaBr's own layout code.
  • gpu/texture.rs:1244: % HASH_EVERY == 0 becomes .is_multiple_of(HASH_EVERY). That is the next clippy error (manual_is_multiple_of) once the crate compiles again.

Tested (Linux, the pinned Rust 1.98.1, Windows code type-checked for x86_64-pc-windows-msvc)

  • Both CI clippy runs pass: cargo clippy --workspace --all-targets --locked -- -D warnings and the same with --all-features. On main both fail.
  • The portable job passes: clippy -D warnings and cargo test -p victory-formats, 38 passed.

Not run here: cargo test --workspace on Windows, and the game.

🤖 Generated with Claude Code

**@⁠lcg007xd-c** on GitHub · 2026-11-25 21:30 UTC · [original](https://github.com/uiliannn/VItoriaBr/pull/64) `lcg007xd-c:fix/texture-bytes-from` → `main` · +56 −2 · 2 files · 1 commits · open ## What this fixes `main` has failed the Windows **check** job since 5668b8b ("port VICTORY_TEXTURE_HEAPS and VICTORY_STAGING_BLOCKS from myokex/victory-amd"): ``` error[E0599]: no method named `bytes_from` found for struct `victory_formats::texture::Layout` error: could not compile `victory-gpu` (lib) due to 3 previous errors ``` The ported callers, in `gpu/texture.rs:1766/1771` and `gpu/resource.rs:3012` (`placed_bytes_from`), use `Layout::bytes_from`. That method lives in `victory-formats` in myokex's commit and was not brought along. ## The change (from the same commit, myokex/victory-amd `c3723f3`, GPL-3.0) - **`Layout::bytes_from(first)`:** the bytes mip `first` and the smaller mips take from the start of the texture, since smaller mips lie nearer the start. It returns the whole layout from mip 0, and whenever the chain repeats per slice: array slices, 3D, thick layouts, MSAA. - **`detile`/`tile`:** now accept a tiled buffer of `bytes_from(mip)` bytes instead of the whole layout. The new callers pass exactly that much, so without this their uploads of the smaller mips would get `TooSmall`. Every other case is unchanged, because `bytes_from` returns the full size there. - **myokex's test `smaller_mips_need_only_the_start_of_the_texture`:** for every mip of a 1024² BC1 texture, reading from exactly `bytes_from(mip)` bytes gives the same pixels as reading from the whole texture, and one byte less is `TooSmall`. It passes on VItoriaBr's own layout code. - **`gpu/texture.rs:1244`:** `% HASH_EVERY == 0` becomes `.is_multiple_of(HASH_EVERY)`. That is the next clippy error (`manual_is_multiple_of`) once the crate compiles again. ## Tested (Linux, the pinned Rust 1.98.1, Windows code type-checked for `x86_64-pc-windows-msvc`) - Both CI clippy runs pass: `cargo clippy --workspace --all-targets --locked -- -D warnings` and the same with `--all-features`. On `main` both fail. - The portable job passes: clippy `-D warnings` and `cargo test -p victory-formats`, 38 passed. **Not run here:** `cargo test --workspace` on Windows, and the game. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
5668b8b ported VICTORY_TEXTURE_HEAPS / VICTORY_STAGING_BLOCKS, whose
callers (gpu/texture.rs, gpu/resource.rs placed_bytes_from) use
victory_formats::texture::Layout::bytes_from, which the port did not
bring along, so victory-gpu stopped compiling and the Windows CI job fails
on main (E0599 x3).

From the same myokex/victory-amd commit c3723f3 (GPL-3.0):
- Layout::bytes_from: the bytes mip `first` and the smaller ones take from
  the texture's start (the whole layout when slices or 3D depth repeat
  the chain, for MSAA, and from mip 0).
- detile/tile accept a tiled buffer of bytes_from(mip) bytes instead of
  the whole layout, which is what the new callers pass.
- Its test smaller_mips_need_only_the_start_of_the_texture.

Also is_multiple_of at gpu/texture.rs:1244 (clippy manual_is_multiple_of,
the next error once the crate compiles).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:42:53 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/64/head:github-bot/gh-64'
git switch 'github-bot/gh-64'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-64'
git switch 'github-bot/gh-64'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-64'
git switch 'github-bot/gh-64'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-64'
git switch 'main'
git merge --squash 'github-bot/gh-64'
git switch 'main'
git merge --ff-only 'github-bot/gh-64'
git switch 'main'
git merge 'github-bot/gh-64'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.