-
Notifications
You must be signed in to change notification settings - Fork 908
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
Bunnymark example does not recompute its projection matrix and other parameters when the canvas size changes #5890
Comments
Can i take this up? has there been any discovery done on this? |
@dv29 doesn't look like, go ahead! |
I cannot replicate this issue on my machine with the following, it seems to be working as expected
|
Me too, I tried even by debugging it and it works nice. Try checking your GPU manufacturer drivers. OS |
@dv29 @techforni I am using Chrome Canary version 128.0.6610.0 (Official Build) canary (arm64) from macOS 15 beta and I think the issue or a similar one persists, specifically the implementation of wgpu/examples/src/bunnymark/mod.rs Line 373 in 101c996
I would propose something along the lines of the following to examples/src/bunnymark/mod.rs, pardon my rust syntax as I have never written a line of rust before:
Another way to illustrate the lack of handling resize is with the below video. I imagine the wgpu logo should not appear stretched out as it does in the video: resize_does_not_update_projection_matrix.movWith the above patch, bunnymark is rendering correctly on Safari from the macOS 15 betas as well. It would be nice to handle resize so it doesn't appear broken in Safari: The reason it doesn't work in Safari currently is we report a 2x2 canvas on page load. Perhaps that is a separate issue, but it seems like handling resize would be a reasonable change. |
@dv29 it shouldn't require a Mac to test. It also reproduces on Chrome stable (Version 126.0.6478.183 (Official Build) (arm64)). As long as you can resize the window, the issue should reproduce. It can also be observed that the orthographic matrix is only computed on page load currently. |
Just tried on
Screencast.from.07-22-2024.08.05.25.PM.webm |
Doesn’t that also illustrate the issue? It seems odd the size of the bunnies is dependent on the initial window size. In the current version, you see a difference if the page is loaded into a window of size 2000 x 300 and then resized to 1200 x 1200 compared to having the window sized to 1200 x 1200 initially. it is because the orthographic matrix is not computed on resize. |
I opened the PR for some initial feedback. I got the vertical out of bounds covered though it still happens when the screen is resized. |
not worth the hassle really, I'd just recreate the group as-is every time the screen resizes |
Updated the PR to recreate the |
Description
examples/src/bunnymark/mod.rs computes an Orthographic RH matrix on page load, but if the canvas is resized, the matrix is not recomputed.
See all uses of config.width and config.height inside examples/src/bunnymark/mod.rs
Repro steps
(1) Open https://wgpu.rs/examples/?backend=webgpu&example=bunnymark in Chrome 126.0.6478.127
(2) Resize the window
Expected vs observed behavior
Observed: Bunnies bounce outside of the canvas or don't bounce to the top
Expected: bunnies bounce within the resized canvas
Extra materials
bunnies_outside_canvas.mov
Platform
macOS using Chrome Version 128.0.6562.0 (Official Build) canary (arm64)
The text was updated successfully, but these errors were encountered: