upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorlucsoft <mail@lucsoft.de>2026-12-02 14:52:18 +0100
committerGitHub <noreply@github.com>2026-12-02 14:52:18 +0100
commit5eaadb54c14e0fc29597b2a1689d7dbd83491303 (patch)
tree0cd95bb9af1ca9c80c543e57e40fc1926ead619d /scripts
parent38ad22daa624b0fe415889f480016099a9aae390 (diff)
D3D12.X: hand the title reserved textures with live page tables (#3553)HEADmainHEAD
* D3D12.X: cover tile mappings whose Signal failed vram's mapping queue raised its value and then signalled it, ignoring the result. When that Signal failed, the value was one no Signal would reach: every queue's next submit waited for it (before_execute) and a retired texture's NULL unmap counted as done although nothing marked it. The value now moves only when the Signal was queued. A mapping or unmapping whose Signal failed is marked, and gets a later Signal before anything counts on it: before_execute queues one and has the title's queue wait for it, and a retired texture stays out of the pool until one completes. When none can be queued either, before_execute says so, and the submission stops with that cause (MappingUnmarked) instead of going out with mappings nothing covers. Tests: a failed Signal leaves the value a Signal reached; with the mapping queue held behind a test fence, a bind, a held unmap released inside before_execute and a retired texture's unmap whose Signals fail each get a later mark, and the work waits for it or does not go. The held-queue test cannot hang the test process: each gate is a guard that Drop opens on unwind, and a detached watchdog opens it after 10 s and fails the test with the phase it was held in. With FAIL_SIGNALS nothing else signals the gates, so an assert between mq.Wait and a gate's Signal, or a test placing on the shared device meanwhile, would otherwise leave the mapping queue waiting for good. reserved_resource_with_private_data_is_excluded_from_recycle takes VRAM_TEST_LOCK, and a test-only lock keeps drain_recycled from marking the test's retired texture while it checks that nothing marked it. * D3D12.X: require mapping waits before using uploaded textures Publish a consumer wait only once it was queued. Propagate mapping readiness failures out of texture upload preparation, including mappings made after the title queue’s initial wait. Assisted-by: Codex (GPT-6.2 Sol) * D3D12.X: hand the title reserved textures with live page tables amdgpu, the Linux kernel driver, runs a process's page-table updates in order on one queue, and every unmap and every sparse rebind (REPLACE frees the old range) waits for all command submissions of the VM first. While a frame is in flight, a reserved texture made after its submit has no page-table entries, not even the PRT ones, until that frame is done. A console title may write a descriptor of a texture it has just placed that work it already submitted reads; on the console the memory is there, here the read is a GPU page fault (TCP, PERMISSION_FAULTS 0x3) and the device is lost. RADV_DEBUG=bo_history and the kernel log put the faulting virtual BO 32-38 ms after its creation, by a new placement, with the hung IB older than the texture. A texture from the pool has had its entries since before: its rebind still lands late, but the work in flight reads a NULL tile meanwhile. So: - the pool also takes render targets, depth and UAV textures and those with a clear value, keyed by its meaningful bytes; - every placement tops its description up to XCL_RESERVED_SPARES (default 2) spares made ahead, reserved under the pages lock and pooled only once a Signal of the mapping queue after them completes; - a placement that still has to make a new texture waits up to XCL_PLACE_MAP_WAIT_MS (default 1000) for such a Signal, polling the fence; when no Signal can be queued for it, the placement fails as a failed creation does. It is one change because the parts only work together: without the wait a burst of new textures outruns the spares and faults; without the spares every new placement waits a frame. It builds on the marks for mappings whose Signal failed (the commit before): spares and new placements count on a Signal reaching their mappings. On by default only under Wine with an AMD GPU, judged by the Vulkan physical device vkd3d-proton drives (DXVK's DXGI may report an NVIDIA GPU as AMD), else by the DXGI adapter: Windows drivers do not order page-table updates like this, and the extra creations and waits cost time on the title's thread (the log says how much: the placements, the spares made and the time spent making them, and the waits). XCL_LIVE_RESERVED=1/0 forces it either way. Tests: the gate and the vendor source, clear keys, the fence wait, placements with the gate on and off, concurrent placements and their spares, spares and a cold lazy placement whose Signal fails, and spares kept out of dump tracking.
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions