mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-25 06:41:31 +11:00
Merge pull request #755 from BonsaiDen/glx_multisampling_conformance
glx: Support non-conformant multisampling fbconfigs.
This commit is contained in:
commit
d2343106bc
|
@ -360,6 +360,7 @@ unsafe fn choose_fbconfig(glx: &ffi::glx::Glx, extensions: &str, xlib: &ffi::Xli
|
||||||
-> Result<(ffi::glx::types::GLXFBConfig, PixelFormat), ()>
|
-> Result<(ffi::glx::types::GLXFBConfig, PixelFormat), ()>
|
||||||
{
|
{
|
||||||
let descriptor = {
|
let descriptor = {
|
||||||
|
let mut glx_non_conformant = false;
|
||||||
let mut out: Vec<c_int> = Vec::with_capacity(37);
|
let mut out: Vec<c_int> = Vec::with_capacity(37);
|
||||||
|
|
||||||
out.push(ffi::glx::X_RENDERABLE as c_int);
|
out.push(ffi::glx::X_RENDERABLE as c_int);
|
||||||
|
@ -382,15 +383,6 @@ unsafe fn choose_fbconfig(glx: &ffi::glx::Glx, extensions: &str, xlib: &ffi::Xli
|
||||||
out.push(ffi::glx::RGBA_BIT as c_int);
|
out.push(ffi::glx::RGBA_BIT as c_int);
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(hardware_accelerated) = reqs.hardware_accelerated {
|
|
||||||
out.push(ffi::glx::CONFIG_CAVEAT as c_int);
|
|
||||||
out.push(if hardware_accelerated {
|
|
||||||
ffi::glx::NONE as c_int
|
|
||||||
} else {
|
|
||||||
ffi::glx::SLOW_CONFIG as c_int
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(color) = reqs.color_bits {
|
if let Some(color) = reqs.color_bits {
|
||||||
out.push(ffi::glx::RED_SIZE as c_int);
|
out.push(ffi::glx::RED_SIZE as c_int);
|
||||||
out.push((color / 3) as c_int);
|
out.push((color / 3) as c_int);
|
||||||
|
@ -425,6 +417,7 @@ unsafe fn choose_fbconfig(glx: &ffi::glx::Glx, extensions: &str, xlib: &ffi::Xli
|
||||||
out.push(if multisampling == 0 { 0 } else { 1 });
|
out.push(if multisampling == 0 { 0 } else { 1 });
|
||||||
out.push(ffi::glx_extra::SAMPLES_ARB as c_int);
|
out.push(ffi::glx_extra::SAMPLES_ARB as c_int);
|
||||||
out.push(multisampling as c_int);
|
out.push(multisampling as c_int);
|
||||||
|
glx_non_conformant = true;
|
||||||
} else {
|
} else {
|
||||||
return Err(());
|
return Err(());
|
||||||
}
|
}
|
||||||
|
@ -452,6 +445,20 @@ unsafe fn choose_fbconfig(glx: &ffi::glx::Glx, extensions: &str, xlib: &ffi::Xli
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(hardware_accelerated) = reqs.hardware_accelerated {
|
||||||
|
let caveat = if hardware_accelerated {
|
||||||
|
ffi::glx::NONE as c_int
|
||||||
|
} else {
|
||||||
|
ffi::glx::SLOW_CONFIG as c_int
|
||||||
|
};
|
||||||
|
out.push(ffi::glx::CONFIG_CAVEAT as c_int);
|
||||||
|
out.push(if glx_non_conformant {
|
||||||
|
caveat | ffi::glx::NON_CONFORMANT_CONFIG as c_int
|
||||||
|
} else {
|
||||||
|
caveat
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
out.push(0);
|
out.push(0);
|
||||||
out
|
out
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue