diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp index bdcea5d2360..3a1380534e6 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp @@ -1681,6 +1681,13 @@ void DX8Wrapper::End_Scene(bool flip_frames) } } + // TheSuperHackers @bugfix 01/2025 + // Add delay before releasing resources to allow GPU to complete pending operations. + // This mitigates race conditions in the D3D9-to-D3D12 translation layer on Windows 10+ + // where the GPU may still be processing commands from the current frame when the CPU + // releases vertex/index buffers, causing access violations in CViewBoundState::IsDirty. + ThreadClass::Sleep_Ms(50); + // Each frame, release all of the buffers and textures. Set_Vertex_Buffer(NULL); Set_Index_Buffer(NULL,0); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp index 04b96f2dbbb..6b5636c54f4 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp @@ -1844,6 +1844,13 @@ void DX8Wrapper::End_Scene(bool flip_frames) } } + // TheSuperHackers @bugfix 01/2025 + // Add delay before releasing resources to allow GPU to complete pending operations. + // This mitigates race conditions in the D3D9-to-D3D12 translation layer on Windows 10+ + // where the GPU may still be processing commands from the current frame when the CPU + // releases vertex/index buffers, causing access violations in CViewBoundState::IsDirty. + ThreadClass::Sleep_Ms(50); + // Each frame, release all of the buffers and textures. Set_Vertex_Buffer(NULL); Set_Index_Buffer(NULL,0);