Skip to content

Commit

Permalink
glx:wgl: don't pass default flush behavior
Browse files Browse the repository at this point in the history
Work around the weird driver bugs.

Links: alacritty/alacritty#6824
  • Loading branch information
kchibisov committed May 12, 2023
1 parent cc223a6 commit c16e53b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- **Breaking:** `bitflags` which is used as a part of public API was updated to `2.0`.
- **Breaking:** `.*SurfaceAccessor` traits got removed; their methods now on respective `.*GlContext` traits instead.
- **Breaking:** `GlContext` trait is now a part of the `prelude`.
- On GLX, fixed startup failure when passing default `Flush` with `KHR_context_flush_control`.

# Version 0.30.7

Expand Down
8 changes: 4 additions & 4 deletions glutin/src/api/glx/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ impl Display {
// Flush control.
if self.inner.features.contains(DisplayFeatures::CONTEXT_RELEASE_BEHAVIOR) {
match context_attributes.release_behavior {
ReleaseBehavior::Flush => {
attrs.push(glx_extra::CONTEXT_RELEASE_BEHAVIOR_ARB as c_int);
attrs.push(glx_extra::CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB as c_int);
},
// This is the default behavior in specification.
//
// XXX passing it explicitly causing issues with older mesa versions.
ReleaseBehavior::Flush => (),
ReleaseBehavior::None => {
attrs.push(glx_extra::CONTEXT_RELEASE_BEHAVIOR_ARB as c_int);
attrs.push(glx_extra::CONTEXT_RELEASE_BEHAVIOR_NONE_ARB as c_int);
Expand Down
9 changes: 5 additions & 4 deletions glutin/src/api/wgl/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,11 @@ impl Display {
// Flush control.
if self.inner.features.contains(DisplayFeatures::CONTEXT_RELEASE_BEHAVIOR) {
match context_attributes.release_behavior {
ReleaseBehavior::Flush => {
attrs.push(wgl_extra::CONTEXT_RELEASE_BEHAVIOR_ARB as c_int);
attrs.push(wgl_extra::CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB as c_int);
},
// This is the default behavior in specification.
//
// XXX even though we check for extensions don't pass it because it could cause
// issues.
ReleaseBehavior::Flush => (),
ReleaseBehavior::None => {
attrs.push(wgl_extra::CONTEXT_RELEASE_BEHAVIOR_ARB as c_int);
attrs.push(wgl_extra::CONTEXT_RELEASE_BEHAVIOR_NONE_ARB as c_int);
Expand Down

0 comments on commit c16e53b

Please sign in to comment.