| Summary: | [OpenGL] Add KHR_no_error support | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Ethan Lee <flibitijibibo> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | enhancement | ||
| Priority: | P2 | CC: | amaranth72 |
| Version: | HG 2.0 | Keywords: | target-2.0.6 |
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
EGL KHR_no_error fix
KHR_no_error fix |
||
|
Description
Ethan Lee
2017-08-01 15:17:34 UTC
Wait, how does this work? The new context flag has the same value as GLX_CONTEXT_RESET_ISOLATION_BIT_ARB; is there a non-glX interface for creating contexts we need to make this work? Is this EGL only or something? I'm confused. --ryan. It looks like part of the extension also includes another extension for WGL/GLX called ARB_create_context_no_error and an EGL extension called EGL_KHR_create_context_no_error: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_create_context_no_error.txt https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_create_context_no_error.txt So that's what we're actually adding, I think. FWIW the nvidia driver (the only one to implement this currently) currently just doesn't post the error it detects, rather than running a separate codepath that doesn't bother checking errors, so performance gains are (right now) negligible. https://www.slideshare.net/Mark_Kilgard/nvgl17/49 I've implemented this in https://hg.libsdl.org/SDL/rev/4d2bf1b340cd, but it's totally untested as I have nothing here that can use this extension at the moment. Please test and report back!! --ryan. I still need to try this out as well but it looks like the EGL implementation needs to use "EGL_KHR_create_context_no_error" for both the ifdef and SDL_EGL_HasExtension check, rather than GL_KHR_no_error. Will report back once I've actually tested it on a supported driver. Created attachment 2887 [details]
EGL KHR_no_error fix
Right, so the current revision doesn't work but the fix is really simple: Just move the attrib check to CreateContext rather than CreateVisual (or whatever the equivalent is). Attached is the EGL version of that fix, along with that extension check fix I mentioned earlier.
Created attachment 2888 [details]
KHR_no_error fix
Sorry for posting a whole bunch at once but it turns out this was easier to work on that I was expecting. Here's a patch for EGL/WGL/GLX, works on my NVIDIA PC just fine!
(In reply to Ethan Lee from comment #7) > Here's a patch for EGL/WGL/GLX, works on my NVIDIA PC just fine! This patch is now https://hg.libsdl.org/SDL/rev/7f254d0b7842, thanks! --ryan. |