Open aybe opened 2 years ago
Related to #1493
I found a temporary workaround, setting the preferred full screen size makes the error vanish actually:
using Stride.Core.Mathematics;
using Stride.Engine;
using Stride.Games;
using Stride.Input;
namespace StrideTest;
internal class Game1 : Game
{
protected override void Update(GameTime gameTime)
{
if (Input.IsKeyPressed(Keys.Escape))
Exit();
base.Update(gameTime);
}
protected override Task LoadContent()
{
var w = GraphicsDevice.Adapter.Outputs[0].CurrentDisplayMode.Width;
var h = GraphicsDevice.Adapter.Outputs[0].CurrentDisplayMode.Height;
Window.PreferredFullscreenSize = new Int2(w, h);
Window.AllowUserResizing = true;
Window.FullscreenIsBorderlessWindow = true;
return base.LoadContent();
}
protected override void Draw(GameTime gameTime)
{
var color = new Color4((float)(gameTime.Total.TotalSeconds % 1.0f), 0, 0);
GraphicsContext.CommandList.Clear(GraphicsContext.CommandList.RenderTarget, color);
base.Draw(gameTime);
}
}
I am also interested in the problem because it also occurs in OpenGL on Linux. Interestingly, if you set FullscreenIsBorderlessWindow to true, it is possible to set fullscreen mode but you can no longer exit it.
Here is result of trying to exit fullscreen mode.
Unhandled exception. System.Exception: Depth buffer is not the same size as the render target
at Stride.Graphics.CommandList.SetRenderTargetsImpl(Texture depthStencilBuffer, Int32 renderTargetCount, Texture[] renderTargets)
at Stride.Graphics.CommandList.SetRenderTargets(Texture depthStencilView, Int32 renderTargetViewCount, Texture[] renderTargetViews)
at Stride.Rendering.Compositing.ForwardRenderer.ResolveDepthAsSRV(RenderDrawContext context) in ...stride/sources/engine/Stride.Engine/Rendering/Compositing/ForwardRenderer.cs:line 821
Release Type: nuget
Version: 4.1.0.1734
Platform(s): Windows
Describe the bug
When you go full screen using Alt-Enter on the following sample, you get "Could not recreate all objects."
Furthermore, the app resolution in full screen doesn't even match desktop resolution.
To Reproduce
callstack.txt