Repository navigation
Retail game shows its first menus: depth views, buffers outside unified memory, rect lists - #195
theaustinayers wants to merge 3 commits into
Conversation
…ed memory, rect lists Includes open PRs ivall#163, ivall#170 (Sr-0w) and ivall#168 (ShyVortex) as they are; this does not work without them. - d3d12x: CreateDepthStencilView hooked; view and clear-value formats mapped; shader views of depth buffers get the PC's format names, stencil views plane 1; a UAV of a texture without ALLOW_UNORDERED_ACCESS is a null UAV. - list_x: index / vertex buffers in title memory outside the unified-memory windows are mirrored in unified memory, each draw copies what it reads. - bind: DrawInstanced of a rect list is two triangles a rectangle, the fourth corner (v0 + v2 - v1) made on the CPU. - xg: XGTextureAddressComputer ivall#10 as GetResourceTiling (not checked against the console's library). - GetGPUVirtualAddress of a committed texture gives memory to write through. - Debug layer log: 8 messages per id. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ted too gpu_rect_list_fullscreen_order also draws the other half of the full-screen rect as a triangle: v0, v2 and the implied corner, what a draw expanded to two triangles a rect on the CPU sends next (ivall#195). Those are three corners of the same rect, so the GS completes it to the whole rect as well. A draw expanded on the CPU must therefore not also get this GS, or each rect is drawn twice (the same image when opaque, wrong with blending). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Thanks for this, and for writing down the full-screen corner order: it helped. I've been working on rect lists for #189, now open as #199. The approach is different: a translated VS+PS pipeline of topology type 19 gets a generated geometry shader that adds the fourth corner. Since both PRs touch rect lists, here is how they interact. What the GS path covers that the CPU path doesn't
The hazard if both land as they are
Proposed split
Merging our branch onto your head (bf26412) gives no conflicts. On the merge, our four rect tests pass on an RTX 5070 Ti. They test the GS and don't go through |
|
I reviewed the non-rect parts of #195 at XG #10 (
On these fixtures #195 differs from #192 only in those three places; the 64 KiB 2D numbers match exactly. One of the three implementations should be picked. IA buffer mirror (
Checked, no finding:
Not covered: no D3D12 debug-layer run of the depth views, any GPU test or AI-assisted (Claude Code); synthetic inputs only. |
|
its all claude my GUY |
|
About the missing body text and the The log line means more than one chunk. On Mode 7 is BC7. An experiment to tell them apart: #201 (diagnostics only; the refusals don't change).
Run the menus once with
Either way, AI-assisted (Claude Code). No game data. |
… views and null UAVs After xcl (ivall/xcl#195, #163, #170; GPL-2.0-only): - a DrawInstanced of a rect list with vertex buffers draws each rectangle as two triangles, the fourth corner v0 + v2 - v1 made on the CPU; - shader views naming a depth buffer's plane by a colour format get the desktop's plane formats and plane slice; - a UAV of a texture without unordered access is a null view, and a depth buffer created in the UAV state starts as a depth target. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- mirror_of looks again under the lock: two lists binding one new range at once shared no mirror, and the second was never synced. - A draw with a first instance other than 0 copies the whole buffer (a per-instance buffer was synced by the vertex range). - 0xffff / 0xffffffff count as indices (they are cut values only for strips; a wider range only copies more). - A vertex range past the buffer copies the whole buffer. - The 2 GiB cap is logged when it is reached. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- mirror_of looks again under the lock: two lists binding one new range at once shared no mirror, and the second was never synced. - A draw with a first instance other than 0 copies the whole buffer (a per-instance buffer was synced by the vertex range). - 0xffff / 0xffffffff count as indices (they are cut values only for strips; a wider range only copies more). - A vertex range past the buffer copies the whole buffer. - The 2 GiB cap is logged when it is reached. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
@Kalmarv thank you, that is a careful read and you are right on the points below. Pushed two commits. Rect lists. Your split works for me: the GS where a pipeline has it, XG #10. Dropped from this PR in favour of #192, which is read from the library. Your three differences are all cases where mine guessed. The branch now needs #192 as well as #163 / #168 / #170 to reach the menus; I have been running it with #192 since this afternoon (same result in the menus). Mirrors.
BCPack. You were right that the line hides the count, and I was wrong to call it one chunk. I added a running count on my fork: on the first screen there is exactly one refused request (mode 7, 51012 → 65536 bytes), but one button press later there are 32 within 70 ms, modes 7 and 5, over 3 MB, and it keeps going. So the menus' textures are largely BCPack and none of it loads. The letters that are missing are the short lowercase ones (a c e m n o r s u) while digits, capitals and tall letters draw, which fits blocks of a height-sorted atlas being absent. I have not run #201's magenta fill yet; I will and report here. Tested: (AI-assisted, as before.) |
For ivall#195, which expands rect lists to two triangles a rect on the CPU: a draw on a pipeline that has the GS must not be expanded too, since each half is three corners of the rect and the GS would complete both. has_rect_list_gs(pso) answers that, for a pipeline as is_translated_graphics takes it. A pipeline made again without the GS (retry_without_rect_gs) is not noted, and forget_pso drops the entry with the pipeline's address. Test (CPU): pipelines_with_the_rect_list_gs_are_known_until_forgotten. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Thanks, the flag is in #199 as fbc855c: |
…y physical pages, PC view formats GPU-owned textures placed at title addresses are reserved (tiled) resources on 64 KiB pages of video memory, one per page of the title's address and shared by every target there; arenas remain for what the driver will not tile. Straddling placements had made 15 GB of union arenas in two seconds (video memory is charged to the process's commit), and the device was removed. Physical pages mapped into plain reservations are committed on first CPU access (a vectored handler; ReadFile, DirectStorage and CPU writes commit first). Title GPU heaps go to the coherent window when it fits; free sparse pools go. The device removal at ~14 s was a B5G5R5A1 UAV of a target the PC makes R8G8B8A8: views get the PC's format for their resource – depth buffers are typeless with R24_UNORM_X8 / R32_FLOAT views (stencil: plane 1), 116/117 are half floats, B5G5R5A1/B4G4R4A4 targets R8G8B8A8. XG #10 is GetResourceTiling (checked against the console library), the D16S8 family is laid out as the console's. Pipelines with the console MS in the AS slot are refused (translated, the title rendered nothing). From PR #195, in parts: index/vertex buffers outside unified memory are mirrored, rect lists are two triangles a rectangle, committed textures get an address on request, the debug layer logs per message id. XCL_ACTIVITY logs commit and video memory.
…ormats and views From PR #195 (fa79d46): a mirror is looked up again under the lock (two lists binding one new range shared none), a draw with a first instance other than 0 copies the whole buffer, strip cut values count as indices, a vertex range past the buffer copies all of it, the 2 GiB cap is logged. A unit test for pc_resource_desc / pc_shader_view_format.
|
Closing - taken into main in parts, thanks! On main (38b05b7, eaa36b6) the retail game now reaches its first menu at 30 fps with ~19 GB of commit, checked on an RX 9070; |
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…eam main now) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ted too gpu_rect_list_fullscreen_order also draws the other half of the full-screen rect as a triangle: v0, v2 and the implied corner, what a draw expanded to two triangles a rect on the CPU sends next (ivall#195). Those are three corners of the same rect, so the GS completes it to the whole rect as well. A draw expanded on the CPU must therefore not also get this GS, or each rect is drawn twice (the same image when opaque, wrong with blending). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
For ivall#195, which expands rect lists to two triangles a rect on the CPU: a draw on a pipeline that has the GS must not be expanded too, since each half is three corners of the rect and the GS would complete both. has_rect_list_gs(pso) answers that, for a pipeline as is_translated_graphics takes it. A pipeline made again without the GS (retry_without_rect_gs) is not noted, and forget_pso drops the entry with the pipeline's address. Test (CPU): pipelines_with_the_rect_list_gs_are_known_until_forgotten. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Main expands a DrawInstanced of a rect list on the CPU (bind::draw_rects, from ivall#195): v0 v1 v2, then v0 v2 v3. On a pipeline with the rect list GS each of those halves is three corners of the rect, so the GS completed both and every rect was drawn twice (gpu_rect_list_fullscreen_order shows the second half completed). draw_rects now leaves a pipeline with the GS alone (cpu_rect_expansion: real::has_rect_list_gs of the resolved pipeline); it still expands rect lists on the pipelines the GS refuses. Test (CPU): rect_lists_with_the_rect_list_gs_are_not_expanded_on_the_cpu. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ted too gpu_rect_list_fullscreen_order also draws the other half of the full-screen rect as a triangle: v0, v2 and the implied corner, what a draw expanded to two triangles a rect on the CPU sends next (ivall#195). Those are three corners of the same rect, so the GS completes it to the whole rect as well. A draw expanded on the CPU must therefore not also get this GS, or each rect is drawn twice (the same image when opaque, wrong with blending). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
For ivall#195, which expands rect lists to two triangles a rect on the CPU: a draw on a pipeline that has the GS must not be expanded too, since each half is three corners of the rect and the GS would complete both. has_rect_list_gs(pso) answers that, for a pipeline as is_translated_graphics takes it. A pipeline made again without the GS (retry_without_rect_gs) is not noted, and forget_pso drops the entry with the pipeline's address. Test (CPU): pipelines_with_the_rect_list_gs_are_known_until_forgotten. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Main expands a DrawInstanced of a rect list on the CPU (bind::draw_rects, from ivall#195): v0 v1 v2, then v0 v2 v3. On a pipeline with the rect list GS each of those halves is three corners of the rect, so the GS completed both and every rect was drawn twice (gpu_rect_list_fullscreen_order shows the second half completed). draw_rects now leaves a pipeline with the GS alone (cpu_rect_expansion: real::has_rect_list_gs of the resolved pipeline); it still expands rect lists on the pipelines the GS refuses. Test (CPU): rect_lists_with_the_rect_list_gs_are_not_expanded_on_the_cpu. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The fork, rebuilt on current upstream main with only what upstream does not have: the launcher's folder picker, click-to-capture mouse handling with F8 and Page Up / Page Down, a heap per DXC compile thread, the limit on waits for pipelines still being built, the installer, build.ps1, BUILDING.md, the release workflow and the README. Everything else the fork carried is in upstream now (ivall#195 in parts, ivall#211, ivall#244, ivall#252, ivall#283, ivall#289) or was a diagnostic. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
What this does
With these changes the newer retail game from the README table ("the image is still black") shows its first menu screens on an NVIDIA GPU: after about 45 s of black frames the account prompt appears full screen, and the next menus (legal terms) can be stepped through with a gamepad. A 4-minute run through those menus ends without a device removal. Nothing past the menus has been seen.
Tested on one machine only: Ryzen 9 9950X3D, RTX 5090, Windows 11, on top of 956a476.
cargo check --release -p xclpasses on this branch; I did not run the test suite (no samples here).It includes three open PRs
This branch does not work without #163, #170 (Sr-0w) and #168 (ShyVortex), and since the review it also needs #192 (gbuyssens) for
XGTextureAddressComputer#10, which is no longer in this diff, so their changes toreal.rs/device_x.rsare in the diff as they are. That is their work, not mine. If you merge those first I will rebase and this shrinks to the parts below. If you would rather have this split into smaller PRs, say so.What is new here
Each item was found with
XCL_D3D12_DEBUG=1; the debug-layer message is named where there was one.Device removals (0x887a0001)
CreateDepthStencilViewhad no hook, so a view in the console's D16S8 format (118) reached the PC as it was (messages 47 / 276). Hooked, format mapped withpc_format.R32_FLOATof anR32G8X24buffer (message 28) and the like.pc_depth_view_formatgives the family's name; a stencil view (X24_TYPELESS_G8_UINT,X32_TYPELESS_G8X24_UINT) reads plane 1 (message 29), also in the SRV twin thatdev_create_uav_xmakes.ALLOW_UNORDERED_ACCESS(a console depth buffer that is also a UAV) is a null UAV instead of an illegal call (message 340), with plane 0 (message 344). Workaround: compute writes to those buffers are lost until they get a UAV twin.pc_format; 86 / 115 → R8G8B8A8, 116 / 117 → R16G16B16A16_FLOAT.Device hang (0x887a0006)
IASetIndexBuffer: message 725).pc_vapassed the address through and the GPU stopped responding. Now a 64 KiB-aligned range of that memory gets one mirror in unified memory, and each draw copies the part it reads (the index range, and the vertices those indices name) –list_x::gpu_va,mirror_of,sync_title_buffers. The title binds one ring buffer at many offsets, so views inside a mirrored range share the mirror. Limits: mirrors are never freed (capped at 2 GiB);ExecuteIndirectdraws are not synced; the copy is made when the draw is recorded, so what the title writes between recording andExecuteCommandListsis missed; this is a copy, not the real fix (that memory being GPU-visible).Rect lists
DrawInstancedwith topology 17 is expanded on the CPU to two triangles a rectangle (bind::draw_rects). The title's full-screen passes give (−1,1) (−1,−1) (1,−1) with uv (0,0) (0,1) (1,1), so the fourth corner isv0 + v2 − v1. The vertex layout is not looked at: a 4-byte word equal in all three vertices is kept, any other is taken as a float. Limits: indexed rect lists and rectangles a shader makes from the vertex index alone are still one triangle.Others
XGTextureAddressComputermethod Olympus: harden GameSave read results #10 answered asGetResourceTiling, derived from the layout model. Not checked against the console's library. (I looked at Retail game: XGTextureAddressComputer subresource layout, DSV format … #169's version of this and kept mine; happy to drop it in favour of that one.)GetGPUVirtualAddressof a committed texture returns a block of plain memory, so the title'smemsetthrough it no longer writes to address 0. Workaround: those writes are not uploaded.Still wrong after this
DirectStorage: BCPack mode 7 unsupportedrefuses one 64 KiB chunk.Disclosure
Written with AI assistance (Claude Code); I ran every build and test run described above on my own machine and can re-run anything you want checked. A build of this branch plus #151 and some launcher changes, with source, is at https://github.com/theaustinayers/xcl/releases/tag/v0.1.0-mod.6
🤖 Generated with Claude Code