formats: add Layout::bytes_from (the build was broken since 5668b8b) #67

Closed
github-bot wants to merge 1 commit from gh-pr/67/head into gh-pr/67/base
Owner

@⁠martindevbr on GitHub · 2026-11-25 21:33 UTC · original
martindevbr:pr/fix-bytes-from → main · +44 −0 · 1 files · 1 commits · closed without merging

Problema / Problem

O commit 5668b8b (port de VICTORY_TEXTURE_HEAPS / VICTORY_STAGING_BLOCKS do myokex/victory-amd c3723f3) chama Layout::bytes_from em resource.rs e texture.rs, mas o método não foi portado: victory-gpu não compila na main (E0599, três chamadas).

5668b8b calls Layout::bytes_from in three places but the method was not ported: victory-gpu does not compile on main (E0599).

error[E0599]: no method named `bytes_from` found for struct `victory_formats::texture::Layout`
   --> crates\victory-gpu\src\resource.rs:3012
   --> crates\victory-gpu\src\texture.rs:1766, 1771

Correção / Fix

Adiciona Layout::bytes_from como no myokex/victory-amd c3723f3 (GPL-3.0): os bytes, a partir do início da textura, que o mip first e os menores ocupam (os mips menores ficam mais perto do início; o layout inteiro quando as fatias têm cada uma sua cadeia, e para 3D, multisample, thick e mip 0). Com o teste da mesma origem (a parte que não depende da mudança no detile de lá).

Adds Layout::bytes_from as in myokex/victory-amd c3723f3, with the part of its test that does not depend on its detile change.

Verificado / Checked

  • cargo build --release -p victory volta a compilar.
  • cargo test -p victory-formats (38 ok) e cargo test -p victory-gpu texture (15 ok).
**@⁠martindevbr** on GitHub · 2026-11-25 21:33 UTC · [original](https://github.com/uiliannn/VItoriaBr/pull/67) `martindevbr:pr/fix-bytes-from` → `main` · +44 −0 · 1 files · 1 commits · closed without merging ## Problema / Problem O commit `5668b8b` (port de `VICTORY_TEXTURE_HEAPS` / `VICTORY_STAGING_BLOCKS` do myokex/victory-amd `c3723f3`) chama `Layout::bytes_from` em `resource.rs` e `texture.rs`, mas o método não foi portado: **`victory-gpu` não compila na `main`** (E0599, três chamadas). `5668b8b` calls `Layout::bytes_from` in three places but the method was not ported: **`victory-gpu` does not compile on `main`** (E0599). ``` error[E0599]: no method named `bytes_from` found for struct `victory_formats::texture::Layout` --> crates\victory-gpu\src\resource.rs:3012 --> crates\victory-gpu\src\texture.rs:1766, 1771 ``` ## Correção / Fix Adiciona `Layout::bytes_from` como no myokex/victory-amd `c3723f3` (GPL-3.0): os bytes, a partir do início da textura, que o mip `first` e os menores ocupam (os mips menores ficam mais perto do início; o layout inteiro quando as fatias têm cada uma sua cadeia, e para 3D, multisample, thick e mip 0). Com o teste da mesma origem (a parte que não depende da mudança no `detile` de lá). Adds `Layout::bytes_from` as in myokex/victory-amd `c3723f3`, with the part of its test that does not depend on its `detile` change. ## Verificado / Checked - `cargo build --release -p victory` volta a compilar. - `cargo test -p victory-formats` (38 ok) e `cargo test -p victory-gpu texture` (15 ok).
5668b8b (VICTORY_TEXTURE_HEAPS / VICTORY_STAGING_BLOCKS from
myokex/victory-amd c3723f3) calls `Layout::bytes_from` in resource.rs and
texture.rs, but the method itself was not ported: victory-gpu does not
compile on main (E0599, three call sites).

This adds it as in myokex/victory-amd c3723f3 (GPL-3.0): the bytes from the
texture's start that mip `first` and the smaller ones take (smaller mips
lie nearer the start, so a title streaming textures has memory for them
only); the whole layout where slices each hold their chain, for 3D,
multisampled or thick layouts, and for mip 0. With a test from the same
source (the part that does not depend on its detile change): mip 0 is the
whole texture, the bytes never grow down the chain, tail mips take one
block, and two slices take the whole texture.

cargo build --release -p victory passes again; victory-formats' tests and
victory-gpu's texture tests pass.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:42:57 +00:00
github-bot closed this pull request 2026-11-26 03:42:57 +00:00
Author
Owner

@⁠martindevbr on GitHub · 2026-11-25 21:33 UTC · original

Fechando como duplicado do #64, aberto alguns minutos antes com a mesma correção (Layout::bytes_from do myokex/victory-amd c3723f3). Confirmei aqui que com o método a main volta a compilar e que os testes de victory-formats e de textura do victory-gpu passam. / Closing as a duplicate of #64, which came first with the same fix.

**@⁠martindevbr** on GitHub · 2026-11-25 21:33 UTC · [original](https://github.com/uiliannn/VItoriaBr/pull/67#issuecomment-7175244796) Fechando como duplicado do #64, aberto alguns minutos antes com a mesma correção (`Layout::bytes_from` do myokex/victory-amd c3723f3). Confirmei aqui que com o método a `main` volta a compilar e que os testes de `victory-formats` e de textura do `victory-gpu` passam. / Closing as a duplicate of #64, which came first with the same fix.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.