bevy/crates/bevy_render
Matty Weatherley af61ec2bc1
Incorporate viewport position into clamping in camera_system (#18242)
# Objective

In its existing form, the clamping that's done in `camera_system`
doesn't work well when the `physical_position` of the associated
viewport is nonzero. In such cases, it may produce invalid viewport
rectangles (i.e. not lying inside the render target), which may result
in crashes during the render pass.

The goal of this PR is to eliminate this possibility by making the
clamping behavior always result in a valid viewport rectangle when
possible.

## Solution

Incorporate the `physical_position` information into the clamping
behavior. In particular, always cut off enough so that it's contained in
the render target rather than clamping it to the same dimensions as the
target itself. In weirder situations, still try to produce a valid
viewport rectangle to avoid crashes.

## Testing

Tested these changes on my work branch where I encountered the crash.
2025-03-17 18:10:11 +00:00
..
macros Make buffer binding arrays emit bind group layout entries and bindless resource descriptors again. (#18125) 2025-03-10 21:40:24 +00:00
src Incorporate viewport position into clamping in camera_system (#18242) 2025-03-17 18:10:11 +00:00
Cargo.toml Decoupled naga for wgpu testing (#18099) 2025-03-09 21:49:48 +00:00
LICENSE-APACHE Cleanup publish process (#17728) 2025-02-09 17:46:19 +00:00
LICENSE-MIT Cleanup publish process (#17728) 2025-02-09 17:46:19 +00:00
README.md Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00

Bevy Render

License Crates.io Downloads Docs Discord