Skip to content

Commit

Permalink
Add a log for catching image sync bug
Browse files Browse the repository at this point in the history
  • Loading branch information
maximbaz committed Oct 25, 2024
1 parent a599f26 commit db8bf31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/frame/capturer/wayland.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ impl Dispatch<ZwlrScreencopyFrameV1, ()> for Capturer {

zwlr_screencopy_frame_v1::Event::Ready { .. } => {
// The frame is sadly not always ready at this stage, and I couldn't find how to make Vulkan synchronize with the compositor ☹️
thread::sleep(Duration::from_millis(10));
// thread::sleep(Duration::from_millis(10));

let luma = state
.vulkan
Expand Down
4 changes: 4 additions & 0 deletions src/frame/vulkan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ impl Vulkan {

let result = compute_perceived_lightness_percent(rgbas, true, pixels);

if result == 0 {
log::warn!("Perceived lightness is 0, this could be a bug I'm trying to catch. If you see this value while your screen is not pitch-black, please open a GitHub issue (or use an already opened one) and share your logs, ideally with RUST_LOG=trace and this message.");
}

unsafe {
self.device.unmap_memory(self.buffer_memory);
self.device.destroy_image(frame_image, None);
Expand Down

0 comments on commit db8bf31

Please sign in to comment.