AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
25.25k stars 2.19k forks source link

When using Vulkan rendering for Android, app presents black screen when resuming. #16718

Closed jhimes144 closed 2 weeks ago

jhimes144 commented 4 weeks ago

Describe the bug

When using the app and then navigating away from the app (to home screen, app switcher, or locking device) causes the app to display a black screen when reopened. This only occurs with Vulkan rendering enabled, and does not when using the default EGL rendering. I have not tested software rendering.

To Reproduce

Modify xplat template MainActivity.cs to have the following app builder code

        return base.CustomizeAppBuilder(builder).With(new AndroidPlatformOptions
        {
            RenderingMode = new [] { AndroidRenderingMode.Vulkan }
        }).UseReactiveUI();

Run app on a physical android device, navigate away and then back to app.

Expected behavior

The app resumes without issue.

Avalonia version

11.1.1

OS

Android

Additional context

See my related discussion post here:

https://github.com/AvaloniaUI/Avalonia/discussions/16717

kekekeks commented 4 weeks ago

We are probably not handling device loss condition for Vulkan yet. Suspend/Resume is likely to trigger those

emmauss commented 4 weeks ago

Could you test with the latest nightly builds?

PapLabros commented 3 weeks ago

I have tested with the nightly builds (11.2.999-cibuild0051406-alpha) and can confirm that the bug still persists.