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

Fix MSAA on linux-wayland (and other EGL backends) #416

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/native/android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ where
&mut libegl,
std::ptr::null_mut(), /* EGL_DEFAULT_DISPLAY */
conf.platform.framebuffer_alpha,
conf.sample_count,
)
.expect("Cant create EGL context");

Expand Down
3 changes: 3 additions & 0 deletions src/native/egl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ pub const EGL_GREEN_SIZE: u32 = 12323;
pub const EGL_RED_SIZE: u32 = 12324;
pub const EGL_DEPTH_SIZE: u32 = 12325;
pub const EGL_STENCIL_SIZE: u32 = 12326;
pub const EGL_SAMPLES: u32 = 12337;
pub const EGL_NATIVE_VISUAL_ID: u32 = 12334;
pub const EGL_WIDTH: u32 = 12375;
pub const EGL_HEIGHT: u32 = 12374;
Expand Down Expand Up @@ -261,6 +262,7 @@ pub unsafe fn create_egl_context(
egl: &mut LibEgl,
display: *mut std::ffi::c_void,
alpha: bool,
sample_count: i32,
) -> Result<(EGLContext, EGLConfig, EGLDisplay), EglError> {
let display = (egl.eglGetDisplay.unwrap())(display as _);
if display == /* EGL_NO_DISPLAY */ null_mut() {
Expand All @@ -281,6 +283,7 @@ pub unsafe fn create_egl_context(
EGL_ALPHA_SIZE, alpha_size,
EGL_DEPTH_SIZE, 16,
EGL_STENCIL_SIZE, 0,
EGL_SAMPLES, sample_count as u32,
EGL_NONE,
];
let mut available_cfgs: Vec<EGLConfig> = vec![null_mut(); 32];
Expand Down
1 change: 1 addition & 0 deletions src/native/linux_wayland.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,7 @@ where
&mut libegl,
wdisplay as *mut _,
conf.platform.framebuffer_alpha,
conf.sample_count,
)
.unwrap();

Expand Down
1 change: 1 addition & 0 deletions src/native/linux_x11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ where
&mut egl_lib,
display.display as *mut _,
conf.platform.framebuffer_alpha,
conf.sample_count,
)
.unwrap();

Expand Down
Loading