Backbuffer Swapchain Stays Clamped to Defaults When Larger PreferredBackBufferWidth/Height is Set
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
Research direction
Start by tracing how DesktopVK applies PreferredBackBufferWidth and PreferredBackBufferHeight and creates or resizes the Vulkan swapchain; inspect the change in #9585, which the issue identifies as the point after which rendering became clipped. Reproduce with a 1280x800 backbuffer and compare the SDL window size with the swapchain and framebuffer sizes. Done when the swapchain matches the preferred dimensions and rendering covers the full area.
Written by the indexing model from the issue text.
Description
Prerequisites
- I have verified this issue is present in the
developbranch - I have searched open and closed issues to ensure it has not already been reported.
LLM Declaration
- I used an LLM to generate the code or fix in this Issue.
MonoGame Version
MonoGame 3.8.6.1
Which MonoGame platform are you using?
MonoGame Cross-Platform Desktop Vulkan Application
Operating System
Windows 11 / Linux
Description
On DesktopVK, setting PreferredBackBufferWidth and/or PreferredBackBufferHeight larger than the 800x480 default resizes the window, but creates the Vulkan swapchain while the SDL window is still at 800x480.
Vulkan clamps the swapchain to 800x480, and cached size checks prevent it from recreating after the window resizes.
See this Discord thread for further context.
Steps to Reproduce
Apply these in game ctor:
_graphics.PreferredBackBufferWidth = 1280;
_graphics.PreferredBackBufferHeight = 800;
_graphics.ApplyChanges();
Draw outside the default 800x480 boundaries.
Minimal Example Repo
No response
Expected Behavior
Both the window and the Vulkan swapchain should be 1280x800, and we should be able to render to the entire area.
Resulting Behavior
The window opens up at 1280x800, PresentationParameters and Viewport report 1280x800, but the actual Vulkan swapchain/framebuffer is stuck at 800x480:
In 3.8.6.1 (after #9585): Rendering is clipped to the 800x480 region, and everything past that area is ignored.
In 3.8.6 (before #9585): The 800x480 backbuffer is stretched to fill the larger window.
Files
No response
- Dominant language
- C#
- Stars
- 14.7k
- Forks
- 3.1k
- Avg merge
- 13h 17m
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MonoGame/MonoGame
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
maintenance
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
bug dependencies platform: macos scope: native
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
maintenance scope: build
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
All issues in MonoGame/MonoGame
Similar issues
-
area:frontend bug FE P3
Difficulty 1/5 Under an hour Newbie friendliness 72/100
klasolsson81/jobbliggaren#2288 ·
Maintainers usually reply within 1 day
-
CLI: stale build hint, non-gofmt autocomplete output and a leftover `--revit=<year>` in the docsOpenCommand Line Utility (CLI)
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pyrevitlabs/pyRevit#4217 ·
Maintainers usually reply within 1 day
-
area: ui bug ready
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
account bug effort:S P2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nightscout/nocturne#3745 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
modelcontextprotocol/csharp-sdk#2031 ·
Maintainers usually reply within 1 day