2D camera not 1-to-1 when guessed window scale factor is not 1
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## Bevy version
0.7.0
## Relevant system information
Arch Linux, X11
`AdapterInfo { name: "Intel(R) UHD Graphics 610 (WHL GT1)", vendor: 32902, device: 16033, device_type: IntegratedGpu, backend: Vulkan }`
`cargo 1.62.1 (a748cf5a3 2022-06-08)`
## What you did
`cargo run --example rect`
## What went wrong
Expected to see a 50x50 rectangle. Instead, the rectangle was ~83x83.
## Additional information
Output:
```
2022-07-25T17:25:35.431257Z INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 1.6666666666666667
2022-07-25T17:25:35.483817Z INFO bevy_render::renderer: AdapterInfo { name: "Intel(R) UHD Graphics 610 (WHL GT1)", vendor: 32902, device: 16033, device_type: IntegratedGpu, backend: Vulkan }
2022-07-25T17:25:35.556372Z ERROR wgpu_hal::vulkan::instance: VALIDATION [VUID-VkDescriptorSetLayoutCreateInfo-descriptorType-03001 (0x8ac432cd)]
Validation Error: [ VUID-VkDescriptorSetLayoutCreateInfo-descriptorType-03001 ] Object 0: handle = 0x55731ae47d50, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x8ac432cd | vkCreateDescriptorSetLayout(): binding (8) has VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT flag, but binding (1) has descriptor type VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC. The Vulkan spec states: If any binding has the VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT bit set, then all bindings must not have descriptorType of VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkDescriptorSetLayoutCreateInfo-descriptorType-03001)
2022-07-25T17:25:35.556501Z ERROR wgpu_hal::vulkan::instance: objects: (type: DEVICE, hndl: 0x55731ae47d50, name: ?)
```
Notably, "guessed window scale factor 1.666..." and `83 / 50 = 1.66`.
Contributor guide
Research direction
Start by running `cargo run --example rect` and reproducing the issue with the reported guessed window scale factor of 1.666. Trace the 2D camera and window-scale handling involved in the example; done means the rectangle renders at its expected 50x50 size rather than approximately 83x83.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100