Loader: a texture fill the desktop refuses fails without an exception #15

Manually merged
github merged 1 commit from gh-pr/15/head into gh-pr/15/base 2026-11-27 03:13:42 +00:00
Owner

@⁠marquezinii on GitHub · 2026-11-24 21:49 UTC · original
marquezinii:loader/texture-upload-oom → main · +129 −26 · 5 files · 1 commits · merged 2026-11-24 22:08 UTC

Fixes the boot crash in #13: on a 16 GB machine the process ended with 0xE0434352, with no error logged, right after the first texture was filled from memory.

Cause. GpuTextureUploader makes its upload buffer with Vortice's CreateCommittedResource, and Vortice throws when that fails. The upload buffer is system memory, the GPU's non-local segment. The heaps over the game's XMem sections take from the same budget, and the address map opens one over the section of every mapped page. On the 16 GB machine in #13 that left nothing for the upload buffer, so E_OUTOFMEMORY was thrown on the game's thread inside slot 133 (or slot 70), and the process ended. The OpenExistingHeapFromAddress ... 0x8007000e warnings just before it are the same budget running out.

The non-local budget is half of physical memory: QueryVideoMemoryInfo reports 16.3 GB on this 32 GB machine with an RTX 5070. On the 15.6 GB machine in #13 that is about 7.8 GB, so what runs out is the machine's RAM, not the 3060's 12 GB.

Change.

  • A fill the desktop refuses (upload buffer, Map, queue) or whose copy does not finish (device removed, timeout) now returns false instead of throwing.
  • The uploader drops its buffer and queue, so the next fill starts anew. It no longer keeps a disposed buffer, which a smaller later fill would have written into.
  • The texture keeps what it held until its next refresh point.
  • UploadFailed is counted in the texture counters line, and the first eight failures are logged with the reason.

Test. A_texture_whose_upload_buffer_the_desktop_refuses_is_left_unfilled_and_filled_later makes the staging factory throw E_OUTOFMEMORY and places a texture through slot 133. Slot 133 succeeds and one UploadFailed is counted. With the factory restored, the slot-70 view fills the texture with the right texels.

  • Without the catch, the same test fails with SharpGenException: HRESULT: [0x8007000E] E_OUTOFMEMORY escaping slot 133.
  • Loader tests: 178 passed, 17 skipped. Architecture rules: 29/29.

This only stops the crash. Pages in a section window whose heap failed still read as zeros on the GPU, so a 16 GB machine will likely reach the later fault that 68b6d06 showed at the story load. I put the details on #13.

**@⁠marquezinii** on GitHub · 2026-11-24 21:49 UTC · [original](https://github.com/ThatRecompDev/five-star-recomp/pull/15) `marquezinii:loader/texture-upload-oom` → `main` · +129 −26 · 5 files · 1 commits · merged 2026-11-24 22:08 UTC Fixes the boot crash in #13: on a 16 GB machine the process ended with 0xE0434352, with no error logged, right after the first texture was filled from memory. **Cause.** `GpuTextureUploader` makes its upload buffer with Vortice's `CreateCommittedResource`, and Vortice throws when that fails. The upload buffer is system memory, the GPU's non-local segment. The heaps over the game's XMem sections take from the same budget, and the address map opens one over the section of every mapped page. On the 16 GB machine in #13 that left nothing for the upload buffer, so `E_OUTOFMEMORY` was thrown on the game's thread inside slot 133 (or slot 70), and the process ended. The `OpenExistingHeapFromAddress ... 0x8007000e` warnings just before it are the same budget running out. The non-local budget is half of physical memory: `QueryVideoMemoryInfo` reports 16.3 GB on this 32 GB machine with an RTX 5070. On the 15.6 GB machine in #13 that is about 7.8 GB, so what runs out is the machine's RAM, not the 3060's 12 GB. **Change.** - A fill the desktop refuses (upload buffer, Map, queue) or whose copy does not finish (device removed, timeout) now returns false instead of throwing. - The uploader drops its buffer and queue, so the next fill starts anew. It no longer keeps a disposed buffer, which a smaller later fill would have written into. - The texture keeps what it held until its next refresh point. - `UploadFailed` is counted in the texture counters line, and the first eight failures are logged with the reason. **Test.** `A_texture_whose_upload_buffer_the_desktop_refuses_is_left_unfilled_and_filled_later` makes the staging factory throw `E_OUTOFMEMORY` and places a texture through slot 133. Slot 133 succeeds and one `UploadFailed` is counted. With the factory restored, the slot-70 view fills the texture with the right texels. - Without the catch, the same test fails with `SharpGenException: HRESULT: [0x8007000E] E_OUTOFMEMORY` escaping slot 133. - Loader tests: 178 passed, 17 skipped. Architecture rules: 29/29. This only stops the crash. Pages in a section window whose heap failed still read as zeros on the GPU, so a 16 GB machine will likely reach the later fault that `68b6d06` showed at the story load. I put the details on #13.
The upload buffer of a texture fill is system memory, the GPU's non-local
segment (half the physical memory), which the heaps over the game's XMem
sections share. On a 16 GB machine they took it, Vortice threw
E_OUTOFMEMORY from CreateCommittedResource on the game's thread, and the
process ended with 0xE0434352 right after the first texture filled from
memory (issue #13).

A refused upload buffer or queue, or a copy that does not finish, now
fails the fill: the uploader drops its buffer and queue so the next fill
starts anew, the counters count UploadFailed and the first eight are
logged with the reason.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 03:13:41 +00:00
github manually merged commit a6547365ec into gh-pr/15/base 2026-11-27 03:13:42 +00:00
Author
Owner

@⁠ThatRecompDev on GitHub · 2026-11-24 22:08 UTC · original

merged, thanks! nice catch on the non-local budget being half of RAM, that explains a lot about #13. the windows CI fail was a rounding thing in an unrelated test (0.5 clear color, WARP rounds it the other way), fixed on main now

**@⁠ThatRecompDev** on GitHub · 2026-11-24 22:08 UTC · [original](https://github.com/ThatRecompDev/five-star-recomp/pull/15#issuecomment-7145865852) merged, thanks! nice catch on the non-local budget being half of RAM, that explains a lot about #13. the windows CI fail was a rounding thing in an unrelated test (0.5 clear color, WARP rounds it the other way), fixed on main now
This discussion has been locked. Commenting is limited to contributors.
No description provided.