Page 2 of 2

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

Posted: Wed Nov 23, 2016 2:25
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. :)

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

Posted: Wed Nov 23, 2016 4:31
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.

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

Posted: Wed Nov 23, 2016 22:23
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).

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

Posted: Wed Nov 23, 2016 23:21
by dpJudas
Excellent! Then we just need that in a pull request shipped off to GZDoom. Any volunteers? :)

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

Posted: Wed Nov 23, 2016 23:24
by Edward-san
Uh why was it closed? I tested only the vid_vsync patch to gzdoom! Let me test qzdoom first! :P

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

Posted: Wed Nov 23, 2016 23:37
by dpJudas
Closed? I never made a PR - only wrote/pasted the vsync code here on the forum.

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

Posted: Wed Nov 23, 2016 23:38
by Rachael
Sorry. XD I'll move it back...

The thread got a bit off the rails so I thought the issue was resolved.

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

Posted: Wed Nov 23, 2016 23:39
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.

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

Posted: Thu Nov 24, 2016 0:07
by Edward-san
I can't reproduce the crash anymore, so it's only about Windows vid_hw2d false.