Repository navigation
fix(dx8): Unbind device resources before Reset and guard against a failed reset - #634
Open
tintinhamans wants to merge 1 commit into
Conversation
tintinhamans
force-pushed
the
arctic/go/fix/reset-device-after-failed-reset
branch
2 times, most recently
from
October 9, 2026 12:34
7798f90 to
9f36faf
Compare
tintinhamans
force-pushed
the
arctic/go/fix/reset-device-after-failed-reset
branch
from
October 9, 2026 12:56
9f36faf to
d4ed1dd
Compare
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.
DX8Wrapper::Reset_Devicecan crash inside the driver (DestroyResourceduringReset) when the device still holds a bound vertex buffer, index buffer, texture or render target.Set_Vertex_Buffer/Set_Index_Bufferare deferred and only drop the wrapper's references, so the device keeps its bindings intoReset, which D3D8 forbids.This consolidates the unbind into one helper,
Unbind_Device_Resources, that drops the device's references to the last draw's textures, streams and index buffer.Reset_Devicecalls it beforeResetand also restores the back buffer as the render target;Release_Devicenow calls the same helper instead of repeating the calls inline.The helper does nothing after a failed
Reset: the device is then in an undefined state and must not be touched until a laterResetsucceeds, and nothing is drawn in between so nothing is bound. The state is tracked in a newDeviceResetFailedmember, cleared when a device is created.Reproduced and verified on the upstream retail build on two GPUs. Binding a custom render target and forcing a device loss made
Resetfail on every frame forever (2000+ failures, an endless reset storm) on both an Intel UHD 770 (igd9trinity32.dll) and an NVIDIA RTX 4070 Ti. With this change both reset cleanly and the game continues. In the field this maps to theDestroyResourcecrash group (CLIENT-55Y and related); the release that had only the render-target release still hit it ~17% of the time.