native: a render target view draws in the format it names #145
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!145
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-145"
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?
@ItsMariusBC on GitHub · 2026-11-26 20:31 UTC · original
ItsMariusBC:fix/render-target-view-format→main· +135 −8 · 5 files · 1 commits · merged 2026-11-26 22:38 UTCWhat this changes
On the native host,
OMSetRenderTargetsandClearRenderTargetViewnow draw in the format the render target view names. This is the boot movie shown too bright ("colours look off" in #110).Cause.
glue::targetsbound the host texture of the view's resource and never read the view's description. The view's format says how writes are stored. The title draws its boot movie through a plain view (R8G8B8A8_UNORM, 28) of an sRGB texture (29): the picture is display values already, and drawn into the sRGB texture itself it was encoded a second time.The Windows host does not have this:
Host::rtvpasses the title's description toCreateRenderTargetView.Fix.
Title::target_ofgives what a view draws into: the host texture, or a host view of it in the other format of its sRGB pair when the title's view names that one. The view is kept with the texture, so the same targets are still the sameRcfrom one call to the next.TargetFormatstakes the view's format, so the pipeline matches the attachment.Limits:
How it was tested
cargo test -p victory-hle -p victory -p victory-gpu -p xtaskcargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings49e7c64plus this change. Not run again after the rebase on57b7ebd.New test
a_render_target_view_stores_in_the_format_it_namesclears half grey through a view and reads the texture's bytes, for four cases:Without the change it fails on the first case, which stores 188.
In the game: with a temporary log line (not in this pull request), one such view is made in the run, about 33 s in, when the movie starts: texture
Rgba8UnormSrgb, viewRgba8Unorm. By eye the movie's colours are now right; before, it looked as if brightness was turned all the way up.cargo xtask policypasses.Checklist
VICTORY_*variable and documented (none added)@ItsMariusBC on GitHub · 2026-11-26 20:37 UTC · original
Run again after the rebase: main
0ae6cfcwith this branch and #144 merged on top, Series S, 75 s, cold shader cache, same Mac.@LakshanSivakumar on GitHub · 2026-11-26 22:38 UTC · original · approved these changes
Reviewed and tested together with the other open PRs on main (macOS x86_64 workspace tests, the setup shell tests, and Windows clippy). Thanks!