shader: lower primitive-ordered (POPS) pixel shaders as rasterizer-ordered UAVs (fxceless/victory-fork #215) + a synthetic test #36

Manually merged
github merged 1 commit from gh-pr/36/head into gh-pr/36/base 2026-11-26 03:41:58 +00:00
Owner

@⁠martindevbr on GitHub · 2026-11-25 19:28 UTC · original
martindevbr:pr/pops-rov → main · +136 −1 · 4 files · 1 commits · merged 2026-11-25 19:56 UTC

O que é / What

Port do PR fxceless/victory-fork #215 (autor: arminkhaleghirod, GPL-3.0-or-later), que ainda não está no VItoriaBr, mais um teste sintético.
Port of fxceless/victory-fork #215 (by arminkhaleghirod, GPL-3.0-or-later), not yet in VItoriaBr, plus a synthetic test.

Problema: 10 variantes dos pixel shaders de recorte/tingimento de personagens (PS_PedTexturedCutOutTint) usam POPS (primitive-ordered pixel shading, o hardware por trás das ROVs): leem o ID de colisão que o hardware carrega no SGPR depois dos de sistema, escrevem o empacotador em HW_REG_POPS_PACKER, esperam num laço s_sleep em src_pops_exiting_wave_id e fazem read-modify-write ordenado em imagens UAV. Eram recusados com a hardware SGPR input e os desenhos descartados.

Correção (#215): o ID e o exiting id viram 0 (caminho da primeira onda: nada a esperar), o s_setreg do empacotador vira no-op e toda UAV que o programa abre vira rasterizer-ordered view (flag e feature bit de ROV) — a ordem dos fragmentos sobrepostos fica com o host.

Conflito resolvido em emit/shader.rs (o sampler_range_handle deste repositório mantido ao lado do novo comentário de annotate).

Verificado / Checked (RTX 3060 12 GB, Windows 11)

  • cargo test -p victory-shader: 232 ok (inclui o teste sintético novo: programa POPS com bits do empacotador, setreg e exiting id → traduz e valida).
  • victory translate --validate nos 42 contêineres dessa família: 42/42 emitidos e validados (32 antes).
  • victory translate --pipelines: 42 pipelines de host criadas (ROV aceito pelo driver).
  • Ainda não visto no jogo: esses programas não desenham nas primeiras salas.

Also confirmed independently with an unordered variant (id = 0, setreg no-op, no ROV): same 42/42; this port keeps #215's exact ordering instead.

**@⁠martindevbr** on GitHub · 2026-11-25 19:28 UTC · [original](https://github.com/uiliannn/VItoriaBr/pull/36) `martindevbr:pr/pops-rov` → `main` · +136 −1 · 4 files · 1 commits · merged 2026-11-25 19:56 UTC ## O que é / What Port do PR **fxceless/victory-fork #215** (autor: arminkhaleghirod, GPL-3.0-or-later), que ainda não está no VItoriaBr, mais um teste sintético. Port of **fxceless/victory-fork #215** (by arminkhaleghirod, GPL-3.0-or-later), not yet in VItoriaBr, plus a synthetic test. **Problema:** 10 variantes dos pixel shaders de recorte/tingimento de personagens (`PS_PedTexturedCutOutTint`) usam POPS (*primitive-ordered pixel shading*, o hardware por trás das ROVs): leem o ID de colisão que o hardware carrega no SGPR depois dos de sistema, escrevem o empacotador em `HW_REG_POPS_PACKER`, esperam num laço `s_sleep` em `src_pops_exiting_wave_id` e fazem read-modify-write ordenado em imagens UAV. Eram recusados com `a hardware SGPR input` e os desenhos descartados. **Correção (#215):** o ID e o exiting id viram 0 (caminho da primeira onda: nada a esperar), o `s_setreg` do empacotador vira no-op e toda UAV que o programa abre vira *rasterizer-ordered view* (flag e feature bit de ROV) — a ordem dos fragmentos sobrepostos fica com o host. Conflito resolvido em `emit/shader.rs` (o `sampler_range_handle` deste repositório mantido ao lado do novo comentário de `annotate`). ## Verificado / Checked (RTX 3060 12 GB, Windows 11) - `cargo test -p victory-shader`: 232 ok (inclui o teste sintético novo: programa POPS com bits do empacotador, setreg e exiting id → traduz e valida). - `victory translate --validate` nos 42 contêineres dessa família: **42/42 emitidos e validados** (32 antes). - `victory translate --pipelines`: **42 pipelines de host criadas** (ROV aceito pelo driver). - Ainda não visto no jogo: esses programas não desenham nas primeiras salas. Also confirmed independently with an unordered variant (id = 0, setreg no-op, no ROV): same 42/42; this port keeps #215's exact ordering instead.
Port of fxceless/victory-fork PR #215 by arminkhaleghirod (GPL-3.0-or-later;
one conflict in emit/shader.rs resolved: this tree's sampler_range_handle
kept next to the new annotate comment).

Ten variants of the title's character cut-out/tint pixel shaders use the
console's primitive-ordered pixel shading: they read the collision wave id
the hardware loads into the SGPR after the system ones, write the packer to
HW_REG_POPS_PACKER, wait in an s_sleep loop on src_pops_exiting_wave_id
until the waves they overlap leave, then read-modify-write UAV images in
order. They were refused with "a hardware SGPR input" and their draws
dropped. Now the id and the exiting id lower to 0 (the first wave's path:
nothing to wait for), the packer write is a no-op, and every UAV the
program opens is a rasterizer-ordered view (ROV flag and feature bit set),
which gives the host's ordering for overlapping fragments.

Added here: a synthetic POPS pixel program test (packer bits of the id,
setreg, exiting id) that translates and validates.

Checked on an RTX 3060 12 GB: victory-shader's suite passes (232); the 42
containers of that shader family: 42 of 42 emitted and validated with
`translate --validate` (32 before) and 42 host pipelines created with
`translate --pipelines`. Not seen in game yet: those programs do not draw in
the first rooms.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:41:57 +00:00
github manually merged commit f82c60a736 into gh-pr/36/base 2026-11-26 03:41:58 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.