NULL crash with r_newrenderer set to 1 before loading map

Moderators: Rachael, dpJudas

dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: NULL crash with r_newrenderer set to 1 before loading map

Post by dpJudas »

I booted back into Windows now, but to add vsync support to GZDoom (and thus indirectly to QZDoom), SDLGLFB::SetVSync needs to be changed to the following:

Code: Select all

void SDLGLFB::SetVSync( bool vsync )
{
#if defined (__APPLE__)
	const GLint value = vsync ? 1 : 0;
	CGLSetParameter( CGLGetCurrentContext(), kCGLCPSwapInterval, &value );
#else
	if (vsync)
	{
		if (SDL_GL_SetSwapInterval(-1) == -1)
			SDL_GL_SetSwapInterval(1);
	}
	else
	{
		SDL_GL_SetSwapInterval(0);
	}
#endif
}
Not doing the PR myself as I can't test it without booting back into Linux (yes, I am really that lazy!!). But if someone on Linux would like vsync to work, this is what it takes. :)
User avatar
Rachael
Developer
Developer
Posts: 3640
Joined: Sat May 13, 2006 10:30

Re: NULL crash with r_newrenderer set to 1 before loading map

Post by Rachael »

You're fine. It's nice to know that is working, though. :)

Also I cannot test the VSync changes as I do not have a baremetal Linux system, which makes VSync testing essentially unreliable.
Edward-san
Developer
Developer
Posts: 197
Joined: Sun Nov 29, 2009 16:36

Re: NULL crash with r_newrenderer set to 1 before loading map

Post by Edward-san »

I tested on my system and it seems to work. Finally I can see >60 fps if vid_vsync is disabled (though I may not need it because I don't want to overheat my laptop :P).
dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: NULL crash with r_newrenderer set to 1 before loading map

Post by dpJudas »

Excellent! Then we just need that in a pull request shipped off to GZDoom. Any volunteers? :)
Edward-san
Developer
Developer
Posts: 197
Joined: Sun Nov 29, 2009 16:36

Re: NULL crash with r_newrenderer set to 1 before loading map

Post by Edward-san »

Uh why was it closed? I tested only the vid_vsync patch to gzdoom! Let me test qzdoom first! :P
dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: NULL crash with r_newrenderer set to 1 before loading map

Post by dpJudas »

Closed? I never made a PR - only wrote/pasted the vsync code here on the forum.
Last edited by dpJudas on Wed Nov 23, 2016 23:38, edited 1 time in total.
User avatar
Rachael
Developer
Developer
Posts: 3640
Joined: Sat May 13, 2006 10:30

Re: NULL crash with r_newrenderer set to 1 before loading map

Post by Rachael »

Sorry. XD I'll move it back...

The thread got a bit off the rails so I thought the issue was resolved.
dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: NULL crash with r_newrenderer set to 1 before loading map

Post by dpJudas »

Oh, the ticket itself! I'm confident it doesn't happen anymore in Linux, but strictly speaking the original issue still exists. You can most likely make the Windows version crash too if you put vid_hw2d to false.
Edward-san
Developer
Developer
Posts: 197
Joined: Sun Nov 29, 2009 16:36

Re: NULL crash with r_newrenderer set to 1 before loading map

Post by Edward-san »

I can't reproduce the crash anymore, so it's only about Windows vid_hw2d false.
Locked

Return to “Bugs (Archive)”