Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OpenGL] Add KHR_no_error support #2520

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

[OpenGL] Add KHR_no_error support #2520

SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 2.0
Reported for operating system, platform: All, All

Comments on the original bug report:

On 2017-08-01 15:17:34 +0000, Ethan Lee wrote:

The KHR_no_error extension was formally included in OpenGL 4.6:

https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_no_error.txt

On the surface it's pretty easy, we just add to SDL_GLcontextFlag to support the new value. We may want to check for conflicts with the DEBUG flag though...?

On 2017-08-02 21:55:18 +0000, Ryan C. Gordon wrote:

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.

On 2017-08-02 22:05:11 +0000, Ethan Lee wrote:

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.

On 2017-08-02 22:50:31 +0000, Alex Szpakowski wrote:

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

On 2017-08-25 01:31:32 +0000, Ryan C. Gordon wrote:

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.

On 2017-08-25 02:31:56 +0000, Ethan Lee wrote:

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.

On 2017-08-25 02:44:52 +0000, Ethan Lee wrote:

Created attachment 2887
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.

On 2017-08-25 03:01:23 +0000, Ethan Lee wrote:

Created attachment 2888
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!

On 2017-08-25 05:29:55 +0000, Ryan C. Gordon wrote:

(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.

@SDLBugzilla SDLBugzilla added the enhancement New feature or request label Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant