GL renderer crashes in a map with mirror+portal+skybox

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!
User avatar
ZZYZX
 
 
Posts: 1384
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine
Contact:

GL renderer crashes in a map with mirror+portal+skybox

Post by ZZYZX »

Stack trace is against Git revision c92e6b03ac461ac16c13412ae414332145e60081.
The "725f3332()" is apparently virtual delete in HWPortal.

Code: Select all

 	725f3332()	Unknown
 	[Frames below may be incorrect and/or missing]	
>	gzdoom.exe!FPortalSceneState::EndFrame(HWDrawInfo * di, FRenderState & state) Line 101	C++
 	gzdoom.exe!OpenGLRenderer::FGLRenderer::DrawScene(HWDrawInfo * di, int drawmode) Line 141	C++
 	[External Code]	
 	gzdoom.exe!HWDrawInfo::ProcessScene(bool toscreen, const std::function<void __cdecl(HWDrawInfo *,int)> & drawScene) Line 655	C++
 	gzdoom.exe!OpenGLRenderer::FGLRenderer::RenderViewpoint(FRenderViewpoint & mainvp, AActor * camera, IntRect * bounds, float fov, float ratio, float fovratio, bool mainview, bool toscreen) Line 190	C++
 	gzdoom.exe!OpenGLRenderer::FGLRenderer::RenderView(player_t * player) Line 276	C++
 	gzdoom.exe!D_Display() Line 758	C++
 	gzdoom.exe!D_DoomLoop() Line 1008	C++
 	gzdoom.exe!D_DoomMain() Line 2681	C++
 	gzdoom.exe!DoMain(HINSTANCE__ * hInstance) Line 1077	C++
 	gzdoom.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * nothing, char * cmdline, int nCmdShow) Line 1349	C++
 	[External Code]	
Steps to reproduce:
1. Make sure you have vid_rendermode=4
2. Use the map attached (IWAD=doom2.wad). The reflective floors are 1.0 reflective on purpose — makes it easier to spot the issue.
3. Position yourself at roughly (-3289, 488, 32)
4. Make sure you see this: https://i.imgur.com/2K8e5sI.png (this is on it's own a problem, but not related and not visible in production map so w/e)
5. Move around for a bit, turn camera around. It will crash at some point



You can try the attached demo. For me it crashes reliably (and differently every time!)
Attachments
crashdemo.zip
(3.71 KiB) Downloaded 190 times
portals.CRASH.zip
(185.21 KiB) Downloaded 200 times
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: GL renderer crashes in a map with mirror+portal+skybox

Post by Graf Zahl »

Hm. You seem to have found the one situation here where the multithreading in the renderer appears to get into synchronization problems. Both the main thread and the worker can modify the scene's portal state and occasionally stomp onto each other's data, and that's the random crash here.

When I switch off the multithreading the crash disappears, but not the glitch. It does look a bit different, though.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: GL renderer crashes in a map with mirror+portal+skybox

Post by Graf Zahl »

Fixed the crash, but to analyze the glitch this map is too complex. Can you try reducing detail a bit while retaining the glitch? With this many linedefs in the game it is very hard to find out which one causes the renderer to think that it cannot see all parts of the portal.
User avatar
ZZYZX
 
 
Posts: 1384
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine
Contact:

Re: GL renderer crashes in a map with mirror+portal+skybox

Post by ZZYZX »

Linedefs 1533, 1535, 1538, 1541 (relatively to portals.CRASH.wad)
Highlighted with yellow, if I remove these sectors it stops blocking
Image

Also, partially related: GZDoom ate ~48px of upper portal sector in the reflection: https://i.imgur.com/7JY08hP.png
Might be related to the fact that portal plane's Z is -56px.
Post Reply

Return to “OpenGL Renderer Bugs”