-
-
Notifications
You must be signed in to change notification settings - Fork 123
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
Larger resolutions fail to render #186
Comments
That definitely doesn't have anything to do with pixel aspect ratio. The scissor was added with the update to It definitely should not be creating a scissor rect larger than the texture extent. (But I'll have to look into it this weekend at the earliest.) Also FYI, #170 has some ideas for improving performance which will be necessary for large pixel buffers. (Especially if you plan to update it frequently.) |
Thanks for confirming my sanity that I wasn’t just doing something super wrong :)
That does sound rather appealing for this. I subbed to the issue so I can follow along. |
I found the bug!
This shows the condition failing when the window size is smaller than the pixel buffer. |
Is this true all the time? |
In my case, I requested a vertical screen height of 1440 on a monitor which only has 1440 vertical pixels. My initial reaction is that this is kind of outside of the scope of This is where the issue occurs when your patch is applied: pixels/examples/minimal-winit/src/main.rs Lines 28 to 43 in 480764e
|
Thanks for clarifying more, though it still seems odd to me. If you don't mind, why does #151's branch work fine then? EDIT: Its cutoff a bit towards the top. It doesn't seem to have an issue creating a window that goes beyond my monitors scale. In the example screenshoted, the window goes quite a ways more downwards past the taskbar: In this case, the resolution is |
That branch works because it predates the scissor addition. There is no scissor rect, so it isn't possible to get the Arguably, I think it's still a bug to allow users to create pixel buffers that don't fit on the surface. Check the size of the window that |
Ahh, that makes a lot more sense now, thanks for clarifying.
I'd agree there since it leads to slightly more confusing errors and scaling can be taken care of by the user. Looks like you're also right about the
|
I'm still thinking the right thing to do in this case is just return an error from It might help to know why on earth you are trying to do this in the first place? But at least an error with an obvious reason would be better than just letting this happen until it hits some other issue at a deeper level. |
This bug also happens (as you might imagine) when resizing the window so the inner size is smaller than the pixel buffer size. This is easy with, e.g. a patch like this: diff --git a/examples/minimal-winit/src/main.rs b/examples/minimal-winit/src/main.rs
index a48e7d0..8b599bb 100644
--- a/examples/minimal-winit/src/main.rs
+++ b/examples/minimal-winit/src/main.rs
@@ -30,7 +30,6 @@ fn main() -> Result<(), Error> {
WindowBuilder::new()
.with_title("Hello Pixels")
.with_inner_size(size)
- .with_min_inner_size(size)
.build(&event_loop)
.unwrap()
}; With no minimum window constraint, dragging the window handle to a tiny size immediately triggers the same scissor error. To handle this, I'm going to panic with a friendly message in the resize methods when an invalid state is created like this. |
Still testing things out. I can make it not panic in |
Great question :P Originally, I ran into this bug due to not handling resizing logic in my code correctly. However, in the time since then, I think that the possibility of a full-size/jumbo Pixels surface isn't fully out of the question for a kind of "enlarged"/fullscreen feature down the line for the project I'm working on. |
I've been trying to use Pixels in a personal project, but I've hit what seems to be a bug with resolution handling. It seems that if you have a larger winit window, therefore a large surface texture, the first attempt at calling
Pixels.render()
crashes with a wgpu validation error. I think its related to the aspect ratio it ends up using,I dug through just about the entire issue tracker but I wasn't able to find anything related. The closest thing seems to be this open PR about aspect ratios. Interesting, the minimal example on this branch doesn't panic rendering at 2K. I'm not sure how intentional this is though or if there's something else needed for the "ideal" result.
Steps to reproduce:
git clone https://github.com/parasyte/pixels.git
cd pixels/examples/minimal-winit
sed -i "s/320/2560/; s/240/1440/" src/main.rs
cargo run --release
OS: Windows 10 or Linux (X11 vs Wayland doesn't matter)
The text was updated successfully, but these errors were encountered: