Open
Conversation
This was referenced May 5, 2025
There was a problem hiding this comment.
Pull Request Overview
This pull request fixes DPI scaling issues in the glfw_wgpu backend while also working around a Dawn/Vulkan viewport bug. Key changes include updating the viewport clamping in the wgpu backend, removing redundant mouse position hacks, and adjusting DPI scaling handling in the GLFW implementation.
Reviewed Changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| libs/imgui/backends/imgui_impl_wgpu.h | Removed superfluous macros and wrapped declarations in extern "C". |
| libs/imgui/backends/imgui_impl_wgpu.cpp | Updated viewport calculation with integer clamping as a workaround for Dawn/Vulkan bug. |
| libs/imgui/backends/imgui_impl_glfw.h | Added extern "C" block and updated comments regarding known issues. |
| libs/imgui/backends/imgui_impl_glfw.cpp | Removed DPI scaling multiplications from mouse event callbacks and mouse data updates. |
Files not reviewed (2)
- build.zig: Language not supported
- src/backend_glfw_wgpu.zig: Language not supported
This was referenced May 5, 2025
f2ea04e to
7111932
Compare
7111932 to
daafcea
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Let the upstream Dear imgui backends do the DPI scaling and delete our mouse position hacks.
This fixes DPI scaling for glfw_wgpu backend (#3) but exposes a bug in Dawn's vulkan backend. We work around this by ensuring the viewport size is clamped. However, there remains a validation error that results in a crash if the window size is increased; this appears to be a bug in the imgui wgpu backend, where the render target is not resized before the viewport is set.
This ought to be fixed or worked-around before this is merged.
Note: We're going to have to bring Dawn up to a newer version at some point but it's no small feat.
To test these changes, check out zig-gamedev/zig-gamedev#755 and run
zig build triangle_wgpu-run.