Repository navigation
Conversation
The console lets a title view a texture in any format of its family: an R8G8B8A8_UNORM texture as R8G8B8A8_UNORM_SRGB, say, or the reverse. `fits` gave every such view of a typed host texture the texture's own format, so the hardware did no sRGB-to-linear conversion where the title asked for one, or converted where it did not: colours came out with the wrong gamma. Hosts that report CastingFullyTypedFormatSupported (D3D12 options 3) let views of a fully typed resource name another format of its family, with no change to how the resource is made. sRGB and linear twins (8-bit RGBA, BGRA, BGRX, and BC1, BC2, BC3 and BC7) now keep the title's view format on such hosts; other casts within a family read as before, and hosts without the cap keep today's behaviour with a warning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
muhammed-aksoy
pushed a commit
to muhammed-aksoy/VIctory
that referenced
this pull request
Nov 24, 2026
edsuuu
referenced
this pull request
in edsuuu/VIctory-fork
Nov 24, 2026
…eir own curve Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Tested PR #331 at head
Behavior covered: Checks linear and sRGB texture views of one resource use their own color curve; this is a host GPU test. |
|
Tested head
AI-assisted (Claude Code). |
Xeltax
pushed a commit
to Xeltax/VIcky
that referenced
this pull request
Nov 24, 2026
Xeltax
pushed a commit
to Xeltax/VIcky
that referenced
this pull request
Nov 24, 2026
…Marvisak#358 Marvisak#89 Marvisak#331 Marvisak#86 Marvisak#83 Marvisak#211 Marvisak#260 Marvisak#275) Conflict in crates/victory-gpu/src/descriptor/host.rs: gpu-state (Marvisak#251) moved the dynamic-slot search into free_table(); gpu-draw (Marvisak#86) bounds the search by the heap's spare slots instead of DYNAMIC. free_table() works over taken.len(), which is the spare count, so the helper is kept with gpu-draw's spare-based cursor wrap. Both sides' tests kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
edsuuu
referenced
this pull request
in edsuuu/VIctory-fork
Nov 24, 2026
The tester tree (upstream main ffe310e plus its PRs, update 8; see its INTEGRATION.md) ran 11-25 minutes in the world on an RTX 5070 without a device removal. Where both sides carry the same PR (the wave64 stack #223/#233/#320 with #439 and #180, #454, #336, #259, #331 and others), the tester tree's newer head is taken; our own work and the PRs only we merged are kept. Conflicts, file by file: - descriptor/host.rs: the tester layout (`spare`, the guard slot after the dynamic slots, `free_table`, the capped sampler heap). A capped view heap keeps `capped_reserve()` dynamic slots, now 2^18 by default (the tester measurement, and our 91fed158), still `VICTORY_DYNAMIC_SLOTS` in diagnostics builds; uncapped hosts keep our 2^19. Our slot statistics (TAKEN/PEAK/SHORT), the bindless plan cache (`CommittedRegions`, `timed_valid_title_address`, `timed_find`, `title_bounds`) and the revision triple are kept beside the tester's `guard_slot`. - Buffer states: the tester tree's buffer-state tracker (#334: every list moves host copies of title memory between GENERIC_READ and UNORDERED_ACCESS and back to common before it closes) and depth twins (#469) are taken. #40's enhanced/legacy indirect barriers (the indirect prelude, `use_indirect_buffers`, the title buffer handoff mirrored in `host_barrier`) cannot share buffers with that tracker and are dropped; #40's argument checks (`byte_len`, exact spans, overflow-safe clamp shader, aligned counts) stay. `indirect::bound` and #282's `rectangles` go through `buffer_state`, and `indirect::execute` (#334) replaces `done`. #178's DXC fallback compiles both of our passes. Our segments (#387: `close` ends the segment, `close_native` closes a native list) carry the tracker: each native list returns its buffers to common and its twins to their depth targets, and each prelude also holds our texture uploads. - shadow.rs: our write flow (`queue_write`, one `snapshot` after the batch's refreshes, `finish_writes`, the unchanged-page cache) with #261's copy-back that also gives the snapshot the title's bytes; its tests run through our flow. - pipeline/make.rs: #275's per-frame budget and per-pipeline wake pair, with our compute waits (a dispatch waits for its pipeline, up to 20 s). - pipeline/library.rs: the tester version (#347, #275's saver thread); our concurrent-write test kept. shader_cache.rs: our byte-returning cache API with #358's "translated, only not kept". - draw.rs: #493's root SRV tables; where no table can stand in, our drop of a draw whose root view is unset or outside title buffers. Our refusal of a table offset past the capped heap stays. - resource.rs: `HostTexture` has both our `staged` generation and the depth twin. - Shaders: the tester's lower.rs for the wave64 stack, #160's image sampling (it covers our #73 and #136 sample forms) and #453/#587; kept from our side: #136's preference for an image or buffer use of a descriptor read as data and its `s_buffer_` arm, #422's nearest-even narrowing (also for #169's d16 loads and #453's interpolation), #452's spin-wait limit, #391's LDS limit, #302's spilled root arguments (now in `NativeProgram::translation_ir`), #136's PSV0 interpolation beside the tester's row harmonisation. split_tests.rs, lane_read_loop_tests.rs and docs/wave64-on-wave32.md are the tester versions (the same PRs at newer heads). - Tests: #483's heap guard dwords filled in our GPU tests of #200 (v_div_scale) and #437 (scalar loads from a raw view), which read through the guard slot otherwise; #334's debug-layer test passes an offset to our `indirect::bound`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
github-actions Bot
added a commit
to KevinPratap/VIctory
that referenced
this pull request
Nov 24, 2026
…th their own curve
github-actions Bot
added a commit
to KevinPratap/VIctory
that referenced
this pull request
Nov 24, 2026
…th their own curve
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
fits(descriptor/host.rs) keeps the title's view format when the view is the sRGB or lineartwin of a typed texture's format and the host reports
CastingFullyTypedFormatSupported(
D3D12_FEATURE_D3D12_OPTIONS3). An R8G8B8A8_UNORM_SRGB view of an R8G8B8A8_UNORM texture nowconverts sRGB to linear when a shader reads it, and an R8G8B8A8_UNORM view of an sRGB texture no
longer does.
casts_typedasks for the cap once. A host without it keeps today's behaviour and logs a warningonce.
resource::SRGBgains the BC1, BC2, BC3 and BC7 pairs. Its other users handle sRGB unorderedaccess, which block-compressed textures never have.
UNORM, say) still read in the texture's own format.
resource::tests::srgb_and_linear_views_of_one_texture_read_their_own_curve.It makes 4x4 textures through
create_committed: R8G8B8A8, B8G8R8A8 and BC1, each in its linearand its sRGB format. It fills their memory with 0x80 (BC1: one block of red 16/31) and makes three
views with
create_srv: sRGB, linear, and one with no description. They are mirrored into a hostheap as for a draw, uploaded by
texture::upload, and a compute shaderLoads each view once.Why
The console lets a title view a texture in any format of its family. When the view format differed
from a typed texture's own,
fitsswapped in the texture's own format, which its comment flagged asa shortcut. An sRGB view of a UNORM texture then read with no sRGB-to-linear conversion, and a UNORM
view of an sRGB texture converted anyway, so colours came out with the wrong gamma.
Microsoft's D3D12 documentation describes
CastingFullyTypedFormatSupportedas casting "from onefully typed format to another, compatible, format". The DirectX relaxed casting spec defines that as
an SRV, UAV, RTV or DSV in any fully qualified format of the resource's family. Its own example is an
R8G8B8A8_UNORM resource with an R8G8B8A8_UNORM_SRGB SRV. It never allows SNORM to UNORM, or FLOAT to
non-FLOAT. sRGB and UNORM twins are neither, so only those pairs are let through. Depth formats are
not touched.
Two other approaches were weighed:
sRGB textures with unordered access. A view of a typeless resource must name a format; a null
description "inherits the resource format and dimension (if not typeless)". So every null-description
SRV, UAV and RTV of an RGBA8, BGRA8 or BC texture would need a whole-resource description built per
dimension, and frame capture would need to know the typeless formats. That means more code in more
places, overlapping
host_texture, which GPU: create host textures without the uses the host refuses #55 and gpu: packed 16-bit render targets are R8G8B8A8 where the GPU cannot render to them #89 also change.ID3D12Device10::CreateCommittedResource3. That call takes anenhanced-barrier initial layout instead of a resource state and needs Agility SDK 1.7 or later. The
layer uses
ID3D12Deviceand legacy states throughout.Casting fully typed formats needs neither: one feature query and one condition in
fits.Render target views already pass the title's format to the host (
RtvRecord::host_desc), so theyneed no change. sRGB unordered access views still become their linear twin, as before: the host has no
sRGB UAVs.
Tested
Windows 11, NVIDIA GeForce RTX 5080, Rust 1.98.1, and WARP.
The new test run against main (the test alone, without the fix) fails on the RTX 5080 and on
WARP alike. One view of every texture reads with the wrong curve; the values below are on the RTX
5080:
On this branch it passes. Every sRGB view reads 0.216 (BC1: 0.230), every linear view 0.502 (BC1:
0.518), and views without a description read in the texture's own format. WARP's values are within
0.0003 of these (
--features diagnostics,VICTORY_D3D12_WARP=1).cargo test -p victory-gpu: main 43 passed, 0 failed, 1 ignored; branch 44 passed (the new test),0 failed, 1 ignored.
cargo test --workspace: main 264 passed, 0 failed, 4 ignored; branch 265 passed, 0 failed, 4ignored.
cargo clippy -p victory-gpu --all-targets: no new warnings; the one warning, inhost.rs, is onmain too.
cargo xtask policy: ok.rustfmt --checkon the two files reports nothing in the lines this change adds. The otherdifferences it reports are already on main.
Not tested
CastingFullyTypedFormatSupported, where the old behaviour and the warning apply.Overlap
#301 (opened while this was being tested) also fixes the sRGB part, as one piece of a larger change (non-stream PSOs, stream subobjects 25..=28, texture-to-buffer readbacks): it makes sRGB-castable host textures typeless and synthesises view descriptions. This PR is the sRGB fix on its own, with a different mechanism (fully typed format casting, no change to how host textures are made), in case a smaller, separate change is easier to review. The two conflict textually in
resource.rs; if #301 lands first, this one can be closed, and its test could still be moved onto #301's version.AI-assisted (Claude Code, Claude Opus 5.5). No game files were used.