bevyengine / bevyengine/bevy

wgpu error when setting Viewport::physical_position value for a Camera

Open
#15,708 1 comment 0 reactions 0 assignees View on GitHub
A-Rendering C-Bug S-Needs-Investigation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

![Image](https://github.com/user-attachments/assets/bac0359b-b98f-4020-89e2-84d8877e824f)
## Bevy version

0.15.0

## \[Optional\] Relevant system information

- Rust 1.81.0
- Windows 11

## What you did

putting Viewport::physical_position value

## What went wrong

I recieved a wgpu error:

ERROR wgpu::backend::wgpu_core: Handling wgpu errors as fatal by default
thread '' panicked at C:\Users\Mohamed\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-22.1.0\src\backend\wgpu_core.rs:3411:5:
wgpu error: Validation Error

Caused by:
In RenderPass::end
In a set_viewport command
Viewport has invalid rect Rect { x: 150.0, y: 0.0, w: 1600.0, h: 900.0 }; origin and/or size is less than or equal to 0, and/or is not contained in the render target (1600, 900, 1)

Contributor guide

Open the contributing guide

Research direction

No repository file or test is named. Start by reproducing the Bevy 0.15 issue using Camera's Viewport::physical_position and inspect the reported set_viewport rectangle against the render target dimensions; done means the valid viewport behavior is identified and the error no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.