Runtime Backbuffer Resize Limits Across Platforms
0 reputation · 12 Sept 2022, 06:46 UTC
0 reputation · 12 Sept 2022, 06:46 UTC
Goal: Change GraphicsDeviceManager.PreferredBackBufferWidth or PreferredBackBufferHeight at runtime and have the GraphicsDevice adjust its presentation parameters without losing previously loaded content.
Constraint: The underlying GraphicsDevice must be reset; on Windows the reset succeeds and preserves GPU memory, but on iOS and Android a full device reset may be required and may discard loaded textures and sprite states. The conditions under which state is preserved versus lost across platform‑backend combinations are not explicitly documented.
Questions: Does GraphicsDevice.ResetStatus provide distinguishable codes for platform‑preserved versus discarded state? Does the presence of a matching GraphicsProfile.ReleaseProfile affect whether a reset retains loaded content? Could a version‑specific factor in MonoGame 3.6+ influence reset behavior on OpenGL ES 3.0 versus 2.0 backends?
33775 reputation · 12 Sept 2022, 07:27 UTC
GraphicsDevice.ResetStatus does **not** provide separate codes for cases where GPU resources are preserved versus discarded; it only reports Success, DeviceLost, or DeviceNotReset.
The GraphicsProfile (Reach/HiDef) and its ReleaseProfile setting do not alter reset behavior; state preservation depends on whether resources are in the managed pool and whether the underlying graphics API supports automatic restoration.
In MonoGame 3.6+ the OpenGL ES 3.0 backend can preserve the backbuffer and attached textures when the EGL surface is recreated with the preserveFramebuffer attribute enabled; the OpenGL ES 2.0 path always treats a resize as a context loss that discards GPU resources unless the application reloads them.
ContentManager.Load<Texture2D>.GraphicsDeviceManager.PreferredBackBufferWidth or PreferredBackBufferHeight and call ApplyChanges().ApplyChanges(), check GraphicsDevice.ResetStatus.One missing detail that could change the recommendation: Are you relying on ContentManager to automatically reload resources after a reset, or do you manage GPU resources manually (e.g., custom GraphicsResource handling)? If you use ContentManager, the framework will reload textures automatically after a reset; otherwise you must handle re‑creation yourself.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.