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

Unable to create debug context with EGL when KHR_create_context_no_error is supported #1635

Closed
bgK opened this issue Oct 19, 2023 · 2 comments · Fixed by #1636
Closed

Unable to create debug context with EGL when KHR_create_context_no_error is supported #1635

bgK opened this issue Oct 19, 2023 · 2 comments · Fixed by #1636
Labels

Comments

@bgK
Copy link

bgK commented Oct 19, 2023

When creating a context with EGL and the following code:

let context_attributes = ContextAttributesBuilder::new()
    .with_debug(true)
    .build(Some(window.raw_window_handle()));

The debug bit does not get set on the GL context:

let mut context_flags = 0;
gl.GetIntegerv(Gl::CONTEXT_FLAGS, &mut context_flags);
assert!(context_flags & Gl::CONTEXT_FLAG_DEBUG_BIT != 0);

This seems to be caused by this check:

if context_attributes.debug && is_one_five && !has_no_error {

The spec for KHR_create_context_no_error mentions an interaction with debug contexts:

BAD_MATCH is generated if the EGL_CONTEXT_OPENGL_NO_ERROR_KHR is TRUE at
the same time as a debug or robustness context is specified.

It's illegal to request a context that is both "no errors" and "debug", however it's fine to have a "debug" context when "no errors" is supported but not enabled.

@bgK bgK changed the title Unable to create debug context with EGL when ·KHR_create_context_no_error is supported Unable to create debug context with EGL when KHR_create_context_no_error is supported Oct 19, 2023
kchibisov added a commit to kchibisov/glutin that referenced this issue Oct 19, 2023
The api/egl always disabled debug when `NO_ERROR` was present in
extensions to avoid errors, however the error will be thrown only
when using `NO_ERROR` and debug context at the same time.

Fix the same issues with GLX/WGL as well as properly enable `NO_ERROR`
for those backends.

Fixes: rust-windowing#1635
@kchibisov kchibisov added the bug label Oct 19, 2023
@kchibisov
Copy link
Member

#1636

@bgK
Copy link
Author

bgK commented Oct 19, 2023

Thanks! I confirm the issue is fixed with your branch with EGL.

kchibisov added a commit that referenced this issue Oct 19, 2023
The api/egl always disabled debug when `NO_ERROR` was present in
extensions to avoid errors, however the error will be thrown only
when using `NO_ERROR` and debug context at the same time.

Fix the same issues with GLX/WGL as well as properly enable `NO_ERROR`
for those backends.

Fixes: #1635
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants