| Summary: | OpenGL initialization crash on XP, unable to fall back to software renderer | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Brad Smith <rainwarrior+libsdl> |
| Component: | render | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | icculus |
| Version: | 2.0.7 | Keywords: | target-2.0.10 |
| Hardware: | x86 | ||
| OS: | Windows (XP) | ||
| See Also: | https://bugzilla.libsdl.org/show_bug.cgi?id=4675 | ||
|
Description
Brad Smith
2018-02-24 22:08:46 UTC
Turning on verbose logs before SDL_CreateRenderer, I get: DEBUG: CreateDevice(): INVALIDCALL DEBUG: Couldn't load GL function glBlendEquation: CreateDevice(): INVALIDCALL I assume the first CreateDevice is failing to create a direct3D renderer? (By the way, intalling the DX9c runtime does not seem to help with this, still gets to the OpenGL attempt.) glBlendEquation is not in OpenGL 1.1, which would explain the failure, but maybe just moving >1.1 functions to the bottom of the procedure list would be enough to get it to finish failing the initialization instead of crashing so it can fall back. It would still be a problem if it got this far and failed to get the functions that /are/ being used here. Unsure if it's possible to get a context but fail the function load on 1.1 functions only, but the UpdateViewport already looks like a problem just by itself? So, trying that as an experiment, moving the two offending functions to the bottom of the list (glBlendEquation, glBlendFuncSeparate), it does get through the initialization attempt with an error, at least. However, it never falls back to software rendering, which I thought was supposed to be an option? The application will run if I set SDL_VIDEO_DRIVER=software, but otherwise it has a "Couldn't find matching render driver" error. Log of this, if it's useful: DEBUG: CreateDevice(): INVALIDCALL DEBUG: Couldn't load GL function glBlendEquation: CreateDevice(): INVALIDCALL DEBUG: Failed loading d3dcompiler_43.dll: The specified module could not be found. DEBUG: Failed loading libGLESv2.dll: The specified module could not be found. DEBUG: Could not initialize OpenGL / GLES library DEBUG: Couldn't find matching render driver > However, it never falls back to software rendering, which I thought was
> supposed to be an option? The application will run if I set
> SDL_VIDEO_DRIVER=software, but otherwise it has a "Couldn't find matching
> render driver" error.
Not falling back to the software renderer was apparently due to using SDL_RENDERER_PRESENTVSYNC in the application I was testing, so that part I understand now, though it's interesting that SDL_VIDEO_DRIVER is apparently allowed to bypass that request?
(The primary problem of the OpenGL attempt access violation remains, though.)
Sorry if my previous comments were a bit rambly, but this is the solution I have been using for the past year or so: src/render/opengl/SDL_glfuncs.h Move these two entries to the bottom of the list: SDL_PROC(void, glBlendEquation, (GLenum)) SDL_PROC(void, glBlendFuncSeparate, (GLenum, GLenum, GLenum, GLenum)) That by itself appeared to be enough for systems that don't have OpenGL 1.1 to avoid crashing and fall back to software rendering. We should fix this in any case, but shouldn’t this be using the Direct3D renderer before OpenGL...? --ryan. I made the failing case you describe more robust here: https://hg.libsdl.org/SDL/rev/b8d437d42151 GL_ActivateRenderer() is also safe to call now, since it only makes the GL context current, since the renderer code was redesigned for 2.0.9. I believe between those redesigns and this patch, we can confidently close this bug. However, I'll open another about why D3D9 doesn't work on Windows XP, so we remember to investigate that. --ryan. (In reply to Ryan C. Gordon from comment #6) > However, I'll open another about why D3D9 doesn't work on Windows > XP, so we remember to investigate that. That bug is now https://bugzilla.libsdl.org/show_bug.cgi?id=4675 --ryan. |