The following assert in the test fails sometimes (approx. 1 out of 5 times):
unsafe {
let framebuffer_object = device
.context_surface_info(&depth_context)
.unwrap()
.unwrap()
.framebuffer_object;
gl.BindFramebuffer(gl::FRAMEBUFFER, framebuffer_object);
gl.Viewport(0, 0, 640, 480);
gl.ClearDepth(0.5);
gl.Clear(gl::DEPTH_BUFFER_BIT);
let mut depth_value: f32 = -1.0;
gl.ReadPixels(
0,
0,
1,
1,
gl::DEPTH_COMPONENT,
gl::FLOAT,
(&mut depth_value) as *mut f32 as *mut c_void,
);
// Note: edited the assertion to output the actual value.
assert!(approx_eq(depth_value, 0.5), "actual depth value was {}, but expected 0.5", depth_value);
}
Output:
---- platform::unix::wayland::tests::test_depth_and_stencil stdout ----
thread 'platform::unix::wayland::tests::test_depth_and_stencil' panicked at surfman/src/platform/unix/wayland/../../../tests.rs:785:9:
actual depth value was NaN, but expected 0.5
The following assert in the test fails sometimes (approx. 1 out of 5 times):
Output:
Tested on Fedora 40.