Repository navigation
Comprehensive GTA 6 World, Pipeline, HLE, and Shader Compatibility Integration - #14
Open
LAKSHYA-cmd-tech wants to merge 188 commits into
Open
LAKSHYA-cmd-tech wants to merge 188 commits into
LAKSHYA-cmd-tech wants to merge 188 commits into
Conversation
… reads Host copies of title buffers start in the common state and relied on implicit promotion, which allows a buffer to be written (unordered access) or read in a list, not both. The world's 174 MB heap is both: the argument clamp and title passes write it, draws read vertices and indices from it. indirect.rs also moved the argument buffer from unordered access to indirect arguments and back after every execution, whatever state the buffer was really in. Each list now tracks the state of every host copy it uses (BufferStates): reads (vertex, index, constant, shader resource, arguments) in GENERIC_READ, shader writes in UNORDERED_ACCESS, with a transition where the use changes. The list's prelude moves each buffer from common to its first state and the list moves it back before closing, so state never leaks into the next list of a submission. indirect::execute replaces the fixed UAV <-> INDIRECT_ARGUMENT barriers. Refs Marvisak#199, Marvisak#264. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The title's descriptor writes and texture releases reach the host at once, from its own threads, while the host runs a submission for most of a second in the world. A descriptor slot rewritten then dropped the resource it held, and a released title texture dropped its host copy, while the running submission still read them: device-removed data showed a page fault inside a freed 1024x1024 BC7 texture, about 65 s into the world (DXGI_ERROR_DEVICE_HUNG, RX 7600). Those objects now go to a retired list tagged with the submission count and are dropped when that submission has been waited for (at once if none is running). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSD61BBk7E79WkryEQA
The world's peak counted 3,630 host textures, 8.9 GB, against a 7 GB video memory budget on an 8 GB card: the driver moves the excess to system memory, where it counts against the commit limit. A texture the title makes and the GPU never uses (no view, target, copy or barrier) now costs nothing; the creation state and clear value are kept for the copy made on first use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSCvCZuokASx7f59sAG
A root SRV is a bare GPU address: nothing bounds what a shader reads through it. Vertex fetch reads its stream through a root SRV with no record limit, and a mesh shader read past the end of the buffer's host copy into memory the host had already freed (the "inside freed texture" device removal after the fix for #59: the fault lay just past the copy's end, in the gap where released textures had been). Each root SRV is now a one-descriptor table holding a raw view of the host copy from the root address to the copy's end, made once per address per list in the heap's dynamic slots; reads past the end return zero, as for any bounded view. A root SRV the title did not set, or one with no host copy, gets a null raw view (an unset table is undefined). Addresses not on 16 bytes, which a raw view cannot start at, read zeros and are logged once. VICTORY_ROOT_SRV_DIRECT=1 restores root descriptors.
… names A buffer read whose element stride is not known at translation takes a raw handle and a byte offset from the runtime stride table. The handle was of the slot the title's view is in, and a raw handle over a structured or typed view is undefined in D3D12: for the load of [index 2, offset 4] an RTX 5070 reads dword 21 of a structured view of 12 bytes (dword 7 asked for) and dword 36 of one of 16 bytes or a typed RGBA32F one (dword 9 asked for), where a Radeon and WARP read the bytes asked for. No handle of another kind is right everywhere either: with a structured handle whose declared stride differs from the view's, the RTX 5070 addresses by the view's stride and the Radeon and WARP by the declared one. The table's entry per slot is now a StrideEntry of two dwords: the stride, and the heap slot holding a raw view of the bytes the slot's view reads (none: the slot's own view is raw), with the bytes from that raw view's start to the view's first byte (raw views start on 16 bytes on the host). The shader reads, stores and runs atomics through a raw handle of the slot named, so the handle's kind always matches the view. RawWindow gives the host the raw view for a byte range. The GPU side writes the new entries without raw slots yet, which reads as before. The test binds raw, structured (12, 16, 20 bytes) and typed (RGBA32F, R32_UINT) views, as shader views for the load and as unordered access views for the store and the atomics, with their raw views beside them, on the hardware adapter and WARP; a second one takes the descriptor from a join of two loads. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The programs that read a buffer without a known stride pick its heap slot at run time, so the runtime stride table has to be looked up by the slot the shader computes, and the view in it can differ from one thread group to the next. A new test loads the heap slot from a buffer per thread group (a scalar load whose offset is the loaded value), with a structured view of 12 bytes in one slot and one of 16 bytes in the other: the four lanes of each group read the bytes of the view their group chose, in one dispatch and again with the choice swapped. A lane reading past the three elements of the first view reads zero, not the buffer's next bytes. The test host's raw views now cover a window of the buffer (as RawWindow gives the host for a view's elements) rather than all of it, which is what ends the read there; the view kinds test takes its raw views and entries from the same function, with views starting 4 and 12 bytes into their raw views. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ide reads A shader that reads a buffer without knowing its stride takes a raw handle of the slot the runtime stride table names. The host heap now makes that slot: when it makes a structured or typed buffer view (for a shader or for unordered access), it also makes a raw view of the same bytes of the same host copy in a pool of 65,536 slots after the dynamic ones, and writes the slot, the stride and the bytes from the raw view's start to the view's first byte (raw views start on 16 bytes) into the slot's entry. A raw view keeps its own slot. The raw view ends with the view's last element, so reads past it give zeros. The entry and the raw view are written wherever the slot's descriptor is (tables made for a draw, title slots a draw reads through a table, slots made null), so they are as current as the descriptor; a slot made again reuses its raw view slot, and one made null, raw or constant, or a dynamic slot given back, returns it to the pool. Views the host cannot make raw (starting off a dword of the copy, or with the pool full) point at a null raw view and are logged once. The test makes placed structured, typed and raw views in a host heap and runs the translated program of victory-shader's run-time slot test on it: each thread group reads the bytes of the view in the slot it chose, zeros past the view's end, and the new view's bytes after the slots are made again. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
main moved under Marvisak#193 and this branch. One conflict, in HostHeap::new (descriptor/host.rs): Marvisak#336 tries the heap with DYNAMIC dynamic slots, then with MIN_DYNAMIC, then capped, and records the range it got in `dynamic`; this branch puts ALIASES raw-view slots after the dynamic ones. Both kept: each attempt asks for the alias slots too, the capped count leaves room for them, the lease bitmap has `extra` entries as on main, and `alias_base` stays `count + extra`. A merge rather than a rebase so Marvisak#193's commits keep their ids. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…clamps, and non-multiple-of-4 stride refusal
…spilled lane masks
…ess/virtualized environments (Marvisak#727)
main now has CI (clippy with -D warnings, then the workspace's tests). No conflict; both of CI's clippy commands are clean on the result. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ew-kinds Marvisak#193 moved: buffer views are clamped to what is left of the host copy, a shader that reads the stride table without a host view heap is not run, and a known stride that is no multiple of four is refused. Conflicts were with main, not with this branch's change: `bind` already returns whether the draw may run (Marvisak#336), with its doc comment and the dropped counter, and main already renamed the second test module in host.rs. main's side kept in all three; Marvisak#193's `return false` in the stride-table branch is in. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… refusals on joined values (Marvisak#736)
…ta6-world-and-shader-fixes
…rld-and-shader-fixes
…to integrate/gta6-world-and-shader-fixes
…-and-shader-fixes
…utput HLE: write decoded Opus samples through unaligned output buffers (Marvisak#1214)
…-cube-shaders Shaders: fix GFX10 independent a16/g16 gradient fields and cube gradients (Marvisak#1209, Marvisak#563)
…dmask Shaders: lower v_ldexp_f16 and resolve Structured::other in v_cndmask_b32 (Marvisak#1223, Marvisak#1221)
…d-sync-uav GPU: order shader writes on command list pipeline syncs (Marvisak#1228)
…l-and-breadcrumbs Survive the title's watchdog: null-page breadcrumbs and int3 traps (Marvisak#1239)
…nd-bcpack Shaders, HLE: quad gradients for compute samples and dynamic BCPack inflation (Marvisak#1237, Marvisak#1238)
…in32 errors in DirectStorage (Marvisak#1370, Marvisak#1383)
…d-and-dstorage-errors Shaders, HLE: zero-pad missing channels in typed loads and preserve Win32 errors in DirectStorage (Marvisak#1370, Marvisak#1383)
…-list GPU placed copy forwarding (Marvisak#1372, Marvisak#1374)
…u-same-list-forwarding Loader, GPU: lazy NOP patching on #UD, BLAKE3 image caching, and same-list GPU placed copy forwarding (Marvisak#1372, Marvisak#1374)
…ts (Marvisak#2441, Marvisak#1946) - Add opt-in VICTORY_PRESENT_1440P=1 diagnostic fallback for GTA VI 4K upscale failure (Marvisak#2441) - Track 2560x1440 color targets and publish only upon submitting command list fence completion - Substitute plane 0 at present time when primary extent is 3840x2160 and differs from candidate - Support switch module to ensure switches set to 0 remain off - Guard CreateUnorderedAccessView for packed 16-bit textures (B5G5R5A1, B4G4R4A4) via typed_store checks to prevent NVIDIA device removal (Marvisak#1946) - Add unit test present_fallback_uses_completed_work_once_and_only_at_4k and switch tests
…nd-packed16-uav GPU: live 1440p present fallback and null UAV for packed 16-bit formats (Marvisak#2441, Marvisak#1946)
…arvisak#1564, Marvisak#1565) - Map slot 34 (0x110) MakeResident to object::ignore, returning S_OK as guest memory is always resident - Map slot 35 (0x118) Evict to object::ignore, returning S_OK as guest memory is never evicted - Add unit tests make_resident_succeeds_without_doing_anything and evict_succeeds_without_doing_anything
…dent-and-evict GPU: implement MakeResident (0x110) and Evict (0x118) device slots (Marvisak#1564, Marvisak#1565)
…-textures GPU/Shader: declare wave64 wave size and strip unsupported video-texture flags (Marvisak#1281)
… DirectStorage file opens (Marvisak#3036, Marvisak#3018)
…watch-and-file-sharing GPU, HLE: guard pending shadow copy-backs on buffer release and share DirectStorage file opens (Marvisak#3036, Marvisak#3018)
…dia-translate Shaders, HLE: fold waterfall loop SCC after loop and translate \??\ NT paths in media (Marvisak#3016, Marvisak#3030)
… soffset on typed buffer stores (Marvisak#3010, Marvisak#3009)
…ed-store-offset Shaders/Lower: return 6 faces for cubemap resinfo and reject non-zero soffset on typed buffer stores (Marvisak#3010, Marvisak#3009)
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.
Comprehensive GTA 6 World, Pipeline, HLE, and Shader Compatibility Integration
This master integration PR consolidates verified backports and compatibility fixes (PRs #15 through #79) required to execute Grand Theft Auto VI into the 3D world.
Integrated Fixes Highlights:
Validation: