-
Notifications
You must be signed in to change notification settings - Fork 247
.pr_agent_accepted_suggestions
| PR 3140 (2026-08-14) |
[correctness] Stale smudge count
Stale smudge count
The new early-return path in W3DSmudgeManager::render exits before updating m_smudgeCountLastFrame, so SmudgeManager::getSmudgeCountLastFrame() can return a previous-frame value when there are no smudges/sets. This breaks the contract of a “last frame” counter on frames where the global smudge set is empty.W3DSmudgeManager::render now returns early when there are no smudge sets or no smudges in the global set, but it does so before updating m_smudgeCountLastFrame. This leaves SmudgeManager::getSmudgeCountLastFrame() returning a stale non-zero value on subsequent empty frames.
m_smudgeCountLastFrame is only assigned later in render after the visibility pass. With the new early return, that assignment is skipped entirely.
- Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DSmudge.cpp[311-317]
- Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DSmudge.cpp[429-436]
Set m_smudgeCountLastFrame = 0; before returning from the new early-return condition (or otherwise ensure it is updated on all return paths that represent “no smudges rendered this frame”).
[reliability] Support check never runs
Support check never runs
The early return can prevent testHardwareSupport() from ever being called when the global smudge set remains empty, leaving m_hardwareSupportStatus stuck at SMUDGE_SUPPORT_UNKNOWN. Since getHardwareSupport() treats UNKNOWN as supported, upstream code may keep smudge-related processing enabled even on unsupported hardware until at least one smudge exists.W3DSmudgeManager::render now returns before calling testHardwareSupport() when the smudge-set list is empty or the global set has zero smudges. This can leave m_hardwareSupportStatus as SMUDGE_SUPPORT_UNKNOWN indefinitely, while getHardwareSupport() reports support for all states except SMUDGE_SUPPORT_NO.
-
SmudgeManagerinitializesm_hardwareSupportStatustoSMUDGE_SUPPORT_UNKNOWN. -
getHardwareSupport()returns true for UNKNOWN. - Multiple call sites gate smudge work on
getHardwareSupport(). -
testHardwareSupport()is the codepath that transitions UNKNOWN -> YES/NO.
- Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DSmudge.cpp[311-320]
- Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DSmudge.cpp[203-221]
- Core/GameEngine/Include/GameClient/Smudge.h[106-113]
- Core/GameEngine/Source/GameClient/System/Smudge.cpp[36-40]
Preserve the perf win (skipping Flush/visibility pass/backbuffer copy) while still allowing capability detection by:
- Calling
testHardwareSupport()before the early-return check (it is effectively one-time work due to internal caching), or - Calling
testHardwareSupport()only whenm_hardwareSupportStatus == SMUDGE_SUPPORT_UNKNOWNeven if returning early. Either approach avoids leaving hardware support permanently UNKNOWN in smudge-free sessions.
- How to Get Involved
- How to Contribution
- Replays for testing
- New Configuration Options
- In-Game Debug Commands
- Community forks
- License
- Credits
- Changelog
- FAQ
- Known Issues
- Contact & Community
-
Visual Studio 6 Guides:
-
Visual Studio 2022 Guides:
- DirectX
- STLport
- Max4SDK
- NVASM
- Benchmark
- MilesSoundSystem
- Bink
- SafeDisk
- Asimp3
- GameSpy
- ZLib
- LZHCompress