bugfix(rendering): Fix Microwave Heat Haze blackout on (Nvidia) forced AA#2374
bugfix(rendering): Fix Microwave Heat Haze blackout on (Nvidia) forced AA#2374githubawn wants to merge 2 commits intoTheSuperHackers:mainfrom
Conversation
Co-authored-by: stm <14291421+stephanmeesters@users.noreply.github.com>
|
| Filename | Overview |
|---|---|
| Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DSmudge.h | Removed conditional compilation guards around m_backgroundTexture, making it unconditionally available for the Copy path fallback |
| Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp | Implements MSAA detection and RTT disabling: detects multisampled surfaces during init, prevents RTT on forced MSAA, adds graceful failure handling |
| Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DSmudge.cpp | Removes conditional compilation, fixes dimension mismatch by using backbuffer dimensions, adds Copy path fallback support when RTT is unavailable |
Last reviewed commit: 6533d57
Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DSmudge.cpp
Outdated
Show resolved
Hide resolved
| if (m_newRenderSurface) { m_newRenderSurface->Release(); m_newRenderSurface = nullptr; } | ||
| if (m_renderTexture) { m_renderTexture->Release(); m_renderTexture = nullptr; } | ||
| if (m_oldRenderSurface) { m_oldRenderSurface->Release(); m_oldRenderSurface = nullptr; } | ||
| if (m_oldDepthSurface) { m_oldDepthSurface->Release(); m_oldDepthSurface = nullptr; } |
There was a problem hiding this comment.
Multiple statements on same line as if condition prevents setting individual breakpoints
| if (m_newRenderSurface) { m_newRenderSurface->Release(); m_newRenderSurface = nullptr; } | |
| if (m_renderTexture) { m_renderTexture->Release(); m_renderTexture = nullptr; } | |
| if (m_oldRenderSurface) { m_oldRenderSurface->Release(); m_oldRenderSurface = nullptr; } | |
| if (m_oldDepthSurface) { m_oldDepthSurface->Release(); m_oldDepthSurface = nullptr; } | |
| if (m_newRenderSurface) | |
| { | |
| m_newRenderSurface->Release(); | |
| m_newRenderSurface = nullptr; | |
| } | |
| if (m_renderTexture) | |
| { | |
| m_renderTexture->Release(); | |
| m_renderTexture = nullptr; | |
| } | |
| if (m_oldRenderSurface) | |
| { | |
| m_oldRenderSurface->Release(); | |
| m_oldRenderSurface = nullptr; | |
| } | |
| if (m_oldDepthSurface) | |
| { | |
| m_oldDepthSurface->Release(); | |
| m_oldDepthSurface = nullptr; | |
| } |
Context Used: Rule from dashboard - Always place if/else/for/while statement bodies on separate lines from the condition to allow precis... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp
Line: 2850-2853
Comment:
Multiple statements on same line as `if` condition prevents setting individual breakpoints
```suggestion
if (m_newRenderSurface)
{
m_newRenderSurface->Release();
m_newRenderSurface = nullptr;
}
if (m_renderTexture)
{
m_renderTexture->Release();
m_renderTexture = nullptr;
}
if (m_oldRenderSurface)
{
m_oldRenderSurface->Release();
m_oldRenderSurface = nullptr;
}
if (m_oldDepthSurface)
{
m_oldDepthSurface->Release();
m_oldDepthSurface = nullptr;
}
```
**Context Used:** Rule from `dashboard` - Always place if/else/for/while statement bodies on separate lines from the condition to allow precis... ([source](https://app.greptile.com/review/custom-context?memory=16b9b669-b823-49be-ba5b-2bd30ff3ba6d))
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
|
Maybe we can accurately tell if MSAA was forced with some of the changes in #1073 like below, and use that in place of Do you know if the RTT path is much faster when MSAA is off compared to copyRects? Is it worth the extra complexity to support both? |
This PR aims to resolve the black screen bug caused by driver-forced MSAA, continuing and refining the work started in #1073.
The Bug: When users force MSAA via their driver control panel, the driver secretly upgrades the depth buffer to be multisampled. However, the Direct3D 8 API still reports MultiSampleType=NONE for created textures. When ScreenDefaultFilter attempts to use Render-To-Texture (RTT), it binds a non-MSAA texture to this secretly-MSAA depth buffer. This surface mismatch is a D3D API violation that silently breaks depth testing, resulting in a black screen.
This PR fixes the issue by permanently disabling the RTT path inside ScreenDefaultFilter::preRender (falling back to the CopyRects smudge path).