Skip to content

Commit

Permalink
Make Viewport::default() return a 1x1 viewport (#14372)
Browse files Browse the repository at this point in the history
# Objective

- The current default viewport crashes bevy due to a wgpu validation
error, this PR fixes that
- Fixes #14355

## Solution

- `Viewport::default()` now returns a 1x1 viewport

## Testing

- I modified the `3d_viewport_to_world` example to use
`Viewport::default()`, and it works as expected (only the top-left pixel
is rendered)
  • Loading branch information
SludgePhD authored Jul 20, 2024
1 parent 9da18cc commit c0cebfe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_render/src/camera/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Default for Viewport {
fn default() -> Self {
Self {
physical_position: Default::default(),
physical_size: Default::default(),
physical_size: UVec2::new(1, 1),
depth: 0.0..1.0,
}
}
Expand Down

0 comments on commit c0cebfe

Please sign in to comment.