Auto fallback to Softpoly for unsupported hardware

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

Auto fallback to Softpoly for unsupported hardware

Postby Nash » Wed Feb 05, 2020 9:28 am

I briefly talked about this on Discord but I think it's something worth pursuing. A lot of people are still getting the misconception that GZDoom absolutely requires OpenGL 3.3, which hasn't been the case anymore since recent versions have the Softpoly backend.

One common problem is that sometimes users cannot get to the IWAD selector window to set the preferred backend to Softpoly - either they set the window to "never ask again", or if they only own one IWAD, they'd have no chance to toggle this option because the game engine starts immediately and therefore failing because OpenGL 3.3 cannot be set.

I propose that some checks be done at startup so that if OpenGL 3.3 support doesn't exist, it should fall back to the Softpoly backend... this would be the most user-friendly way to go about this.

Currently the only alternative is to instruct the user to edit their INI to change the vid_preferbackend CVar... not ideal especially for those computer-illiterate types. :)
User avatar
Nash
Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: Auto fallback to Softpoly for unsupported hardware

Postby Rachael » Wed Feb 05, 2020 9:37 am

It should be possible to query the OpenGL driver for its version and available extensions without doing a full initialization, because that's exactly what the Linux "glxinfo" does anyhow. But I get shot down every time I suggest that.

Sure it's just a hack around the spaghetti-coded GL init, but it's better than nothing.
User avatar
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Auto fallback to Softpoly for unsupported hardware

Postby Redneckerz » Wed Feb 05, 2020 10:14 am

I was under the impression aswell that GZDoom hard requires OpenGL 3.3. If it does not anymore and it can run using the Softpoly backend, than the requirements should be revised or atleast more pronounced.

In the GZDoom menu (So where you can select things), would it be an option to have that mention something like: ''Warning, Your GPU does not support OpenGL 3.3. GZDoom will render in software using the SoftPoly renderer'' or something to that effect?

Sadly this assumes that:
- Everyone uses that menu
- Everyone knows what Softpoly does

There should be some autodetection in the code itself, similar to what Rachael is suggesting, so it gets done before nagging the user with the info. After detection, then obviously one can inform the player.

I wonder how any of this affects LZDoom, given that with the Softpoly backend you essentially get a ''vintage'' version of GZDoom that runs on older hardware.
User avatar
Redneckerz
To it's ports i may have seen
Spotlight Team
 
Joined: 25 Nov 2019
Discord: Redneckerz#8399
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: Intel (Modern GZDoom)

Re: Auto fallback to Softpoly for unsupported hardware

Postby Nash » Wed Feb 05, 2020 10:31 am

The one thing that LZDoom has (which I am only realizing now) is that LZDoom still runs on lesser OpenGL hardware (feel free to correct me if I'm wrong), whereas GZDoom is "OpenGL 3.3 or software renderering".
User avatar
Nash
Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: Auto fallback to Softpoly for unsupported hardware

Postby Redneckerz » Wed Feb 05, 2020 10:38 am

Nash wrote:The one thing that LZDoom has (which I am only realizing now) is that LZDoom still runs on lesser OpenGL hardware (feel free to correct me if I'm wrong), whereas GZDoom is "OpenGL 3.3 or software renderering".

LZDoom targets OpenGL 2.0, but it actually also supports OpenGL 3.3, but i'd let drfrag do the official definition for it :)
User avatar
Redneckerz
To it's ports i may have seen
Spotlight Team
 
Joined: 25 Nov 2019
Discord: Redneckerz#8399
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: Intel (Modern GZDoom)

Re: Auto fallback to Softpoly for unsupported hardware

Postby drfrag » Wed Feb 05, 2020 11:56 am

Nash wrote:The one thing that LZDoom has

Actually there's much more to it. :)
Redneckerz wrote:i'd let drfrag do the official definition for it.

Again?

There's this code in hardware.cpp:
Code: Select allExpand view
   else
   {
      Video = new Win32GLVideo();
   }

   if (Video == NULL)
      Video = new Win32PolyVideo();


But of course it doesn't work, SetPixelFormat() always returns true and there's a dummy window there. Can Video even be NULL?
User avatar
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666

Re: Auto fallback to Softpoly for unsupported hardware

Postby Rachael » Wed Feb 05, 2020 12:02 pm

drfrag wrote:Can Video even be NULL?

If it fails to find an OpenGL driver at all, sure.

Unfortunately though, Windows has a software rasterizer for OpenGL 1.1 still (inherited from the NT days during those brief years when they actually were interested in it), so loading the OpenGL driver on any system where GZDoom could feasibly run is always going to be successful.
User avatar
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Auto fallback to Softpoly for unsupported hardware

Postby Chris » Wed Feb 05, 2020 1:33 pm

drfrag wrote:There's this code in hardware.cpp:
Code: Select allExpand view
   else
   {
      Video = new Win32GLVideo();
   }

   if (Video == NULL)
      Video = new Win32PolyVideo();


But of course it doesn't work, SetPixelFormat() always returns true and there's a dummy window there. Can Video even be NULL?

From a quick look at the code, no. 'new' throws on allocation failure, and the only way a constructor call can fail is by throwing, so if it returns anything it will be a valid non-null pointer. All paths have a new call, so the only way it can fail is by throwing out of the calling function which will bypass the null check.
User avatar
Chris
 
Joined: 17 Jul 2003

Re: Auto fallback to Softpoly for unsupported hardware

Postby drfrag » Wed Feb 05, 2020 1:37 pm

What i'd do is change the backend and print a falling back to softpoly for next run error message, what i already do in LZDoom as i said. Also better than nothing.
BTW could the renderer still run on GL 3.1 in theory?
User avatar
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666

Re: Auto fallback to Softpoly for unsupported hardware

Postby Graf Zahl » Wed Feb 05, 2020 1:43 pm

drfrag wrote: BTW could the renderer still run on GL 3.1 in theory?



No. It requires a few extensions like uniform buffers to work. But all hardware that may be affected has a 3.3 driver, the only exception is Intel HD 3000 whose driver is not capable of activating its extensions properly.
Better forget that GL 3.0-3.2 even exist, they are useless.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Auto fallback to Softpoly for unsupported hardware

Postby drfrag » Wed Feb 05, 2020 1:48 pm

Thanks, i thought 3.0 already supported uniforms. Older versions could run on GL 3.1 using the modern path with gl_riskymodernpath, LZDoom in theory could.
User avatar
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666


Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest