Skip to content

Commit

Permalink
fix: allow multisampling for the GL framebuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
felipetrz authored and not-fl3 committed Mar 12, 2024
1 parent 36dd9d9 commit 961795b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
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

0 comments on commit 961795b

Please sign in to comment.