Skip to content

fix(dx8): Prevent device reset crash on Intel GPUs - #591

Merged
x64-dev merged 1 commit into
mainfrom
seer/fix/d3d8-intel-reset-crash
Sep 3, 2026
Merged

fix(dx8): Prevent device reset crash on Intel GPUs#591
x64-dev merged 1 commit into
mainfrom
seer/fix/d3d8-intel-reset-crash

Conversation

@sentry

@sentry sentry Bot commented Sep 3, 2026

Copy link
Copy Markdown

This PR fixes a fatal EXCEPTION_ACCESS_VIOLATION_READ crash occurring in the Intel integrated graphics driver (igd9trinity32.dll) during a D3D8 device reset operation.

Root Cause:
The DX8Wrapper::Reset_Device() function in dx8wrapper.cpp was calling IDirect3DDevice8::Reset() without first releasing all outstanding COM references to non-managed D3D8 surfaces, specifically DefaultRenderTarget, DefaultDepthBuffer, CurrentRenderTarget, and CurrentDepthBuffer. While most drivers would return D3DERR_INVALIDCALL in this scenario, the Intel 32-bit legacy D3D8 compatibility driver crashes during its internal resource destruction (CSwapChain::Reset -> DestroyResource). Additionally, the Reset() call was not protected by a DbgHelpGuard, which is present in Create_Device() to mitigate driver-specific issues.

Solution:

  1. Release Surface References: Explicitly release DefaultRenderTarget, DefaultDepthBuffer, CurrentRenderTarget, and CurrentDepthBuffer before calling IDirect3DDevice8::Reset(). This ensures all non-managed surface references are zeroed out as required by D3D8.
  2. Re-acquire Default Surfaces: After a successful Reset(), re-acquire the new default render target and depth stencil surfaces.
  3. Add DbgHelpGuard: Wrap the IDirect3DDevice8::Reset() call with a DbgHelpGuard to prevent potential conflicts with dbghelp.dll that can lead to driver crashes.

Fixes CLIENT-196

@x64-dev
x64-dev merged commit 3ef291d into main Sep 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant