Repository navigation
Conversation
An ASTC texture kept as BC3 was decoded, (on AMD) resized and encoded on the GPU in one upload command buffer. Hyrule
Field's two terrain material arrays (1365 x 1365 x 90, 11 levels, BC3 at 1536 x 1536 x 8 levels on AMD) are evicted
in Castle Town and made again when Link comes back: ~570 M texels of decode, blit and encode in one submission. On an
RX 7700S (8 GB, Adrenalin 26.10.1, Windows 11) that ran past Windows' 2-second limit three times out of three: the
driver was reset ("AMD Software detected a driver timeout") and the device lost, with VRAM not full.
upload_astc_gpu now records runs of layers (each with all its levels) while the recording's share lasts,
RX_VK_BC_PART_MTEXELS (16 M texels; 0: all at once, as before), at least one run per call; the layers left wait in
bc_pending and texture_bc_continue() records more at the start of each next recording. While some wait, a submission
is split every 16 draws instead of 120, so they are in within a frame or two. Until then the texture shows what its
image held for those layers, during the scene change. The run arithmetic is in gpu/vk/bc_parts.h.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: Claude Opus 5.5
Owner
|
Closing to keep the queue clear — please rebase on current main and reopen; thanks! |
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 changed
An ASTC texture kept as BC3 is decoded, resized on AMD (#705) and encoded on the GPU. All of it went into one upload
command buffer, so into one submission.
Hyrule Field's two terrain material arrays are 1365 x 1365 x 90 with 11 levels; on AMD they become BC3 at 1536 x 1536
with 8 levels. They are evicted while Link is in Castle Town and made again when he comes back. That is about 570 M texels
of decode, blit and encode in a single submission.
Now
upload_astc_gpurecords runs of layers, each with all its levels, while the recording's share lasts:RX_VK_BC_PART_MTEXELS: 16 M texels by default, or 0 for everything at once, as before.bc_pending.texture_bc_continue()records more of them at the start of each followingrecording.
or two.
The run arithmetic is in
gpu/vk/bc_parts.h. A texture that is destroyed while some of its layers are waiting is takenoff the list.
Why
That single submission ran past Windows' 2-second GPU timeout. Windows reset the driver ("AMD Software detected a driver
timeout"), and Hookshot logged
device lost. When it happened, the VRAM was not full: 6.5 of 7.2 GB.How it was tested
RX 7700S Laptop (8 GB), Ryzen 7 7735HS, Adrenalin 26.10.1, Windows 11, v2.0.5.
again right before each reset. Then came a 10-12 s GPU wait,
submit ... failed (-4)anddevice lost.Game-free check:
tests/test_bc_parts.pycompilestests/test_bc_parts.cpp. It simulates the upload across recordingsand checks that every layer goes in exactly once and in order. It covers the terrain array (12 recordings at 16 M texels),
no budget (one recording), a larger budget, and only a few dirty layers. It also checks that the upload and the replay still
use the parts. It is listed in
tests/run_all.pywith--cxx g++.python -I -B tests/run_all.py: everything passeshere except
nx2/test_nup_paths.pyandtests/test_fps_overlay_order.py, which fail the same way on a cleanmainonthis machine.
Note: this PR and #899 each add one line at the same place in
tests/run_all.py'sARGS. Whichever ismerged second needs a one-line rebase.
🤖 Generated with Claude Code