native: a render target view draws in the format it names #145
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by ItsMariusBC on 2026-11-26T20:31:12Z.
What 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)Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by ItsMariusBC on 2026-11-26T20:37:39Z.
Run again after the rebase: main
0ae6cfcwith this branch and #144 merged on top, Series S, 75 s, cold shader cache, same Mac.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T22:38:14Z.
Review: APPROVED
Reviewed and tested together with the other open PRs on main (macOS x86_64 workspace tests, the setup shell tests, and Windows clippy). Thanks!