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

This part is unnecessary in wgpu_integration.rs #5043

Closed
wants to merge 6 commits into from

Conversation

rustbasic
Copy link
Contributor

@rustbasic rustbasic commented Aug 31, 2024

This part is unnecessary, as we call remove_viewports_not_in() in the handle_viewport_output() function right before it.

Comment on lines 555 to 591
let clear_color = self
.app
.clear_color(&self.integration.egui_ctx.style().visuals);

let has_many_viewports = self.glutin.borrow().viewports.len() > 1;
let clear_before_update = !has_many_viewports; // HACK: for some reason, an early clear doesn't "take" on Mac with multiple viewports.

if clear_before_update {
// clear before we call update, so users can paint between clear-color and egui windows:

let mut glutin = self.glutin.borrow_mut();
let GlutinWindowContext {
viewports,
current_gl_context,
not_current_gl_context,
..
} = &mut *glutin;
let viewport = &viewports[&viewport_id];
let Some(window) = viewport.window.as_ref() else {
return Ok(EventResult::Wait);
};
let Some(gl_surface) = viewport.gl_surface.as_ref() else {
return Ok(EventResult::Wait);
};

let screen_size_in_pixels: [u32; 2] = window.inner_size().into();

{
frame_timer.pause();
change_gl_context(current_gl_context, not_current_gl_context, gl_surface);
frame_timer.resume();
}

self.painter
.borrow()
.clear(screen_size_in_pixels, clear_color);
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this break test_inline_glow_paint?

Copy link
Contributor Author

@rustbasic rustbasic Sep 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this break test_inline_glow_paint?

(The plan was to PR wgpu and glow separately.)

Copy link
Contributor Author

@rustbasic rustbasic Sep 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this break test_inline_glow_paint?

As planned, I will test glow separately and if there are no issues, I will PR again.
It was a mistake that I didn't check to make sure that glow was included in this PR. Sorry about that.

@rustbasic rustbasic requested a review from emilk September 1, 2024 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants