Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow renderer choice to be stored in user configuration (and add automatic fallbacks) #5682

Merged
merged 38 commits into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
44527c1
Rename `CreateRenderer` to `CreateGLRenderer` and never return veldri…
peppy Mar 16, 2023
471770f
Add renderer configuration setting
peppy Mar 16, 2023
864403e
Restructure renderer / window construction to allow reading from the …
peppy Mar 16, 2023
5283911
Add basic fallback step
peppy Mar 16, 2023
4a5d2b1
Move renderer selection to own method and add per-platform fallback l…
peppy Mar 16, 2023
05e1d15
Add more logging and avoid duplicate attempts of same surface type
peppy Mar 16, 2023
2abce46
Move out input handler initialisation from window setup function
peppy Mar 16, 2023
684d339
Ensure any unsuccessful initialisation attempts destroy the associate…
peppy Mar 16, 2023
c913ba8
Fix early access to `DrawThread` causing test failures
peppy Mar 16, 2023
145ba9a
Rename `Legacy` to `OpenGLLegacy`
peppy Mar 16, 2023
e90a35b
Fix headless tests failing due to attempting to use the veldrid renderer
peppy Mar 16, 2023
5c0ec9e
Rename configuration enum to not conflict with `Renderer` class
frenzibyte Mar 17, 2023
a10e2ee
Allow `GameHost` subclasses to use custom renderer implementations
frenzibyte Mar 17, 2023
2861dca
Reword initialisation log message
frenzibyte Mar 17, 2023
eac4660
Keep try-catch limited to the phase of window/renderer initialisation
frenzibyte Mar 17, 2023
8d863d1
Update fallback order log
frenzibyte Mar 17, 2023
b348205
Fix maximum inactive fps for draw thread not correct
frenzibyte Mar 17, 2023
9dcc5be
Move window and SDL destruction to disposal
frenzibyte Mar 17, 2023
586009e
Add quit/close back to run method
peppy Mar 17, 2023
85f04bf
Harden logic surrounding window close to avoid any chance of misfirings
peppy Mar 17, 2023
7d924d3
Add important log output when user renderer setting is reverted
peppy Mar 17, 2023
a03ebad
Don't force config value to legacy GL when falling back
peppy Mar 17, 2023
24e07e7
Refactor to expose enough information to show a renderer selector gam…
peppy Mar 17, 2023
eb60b99
Don't prefer vulkan for now
peppy Mar 18, 2023
a945d0e
Explicitly define valid renderers rather than appending to preferred …
peppy Mar 18, 2023
b887636
Add simple test scene for updating renderer configuration
frenzibyte Mar 19, 2023
375fed6
Remove unused using directive
frenzibyte Mar 19, 2023
265de8c
Fix weird formatting failure
peppy Mar 20, 2023
ccde21f
Add `OpenGLLegacy` to preferred fallback order to better match expect…
peppy Mar 20, 2023
5ae0129
Combine `Preferred` and `Available` methods into one
peppy Mar 20, 2023
a2e91ad
Change initialisation path to consume `OpenGLLegacy` inline inside ma…
peppy Mar 20, 2023
82bfcef
Fix fallback order being output before raising user's preference to top
peppy Mar 20, 2023
3f75003
Fix renderer test running in headless mode
peppy Mar 20, 2023
28949fd
Remove stale comment
frenzibyte Mar 20, 2023
f08742e
Fix fallback order log including `Automatic` type
frenzibyte Mar 20, 2023
0486c10
Add xmldoc for `ResolvedRenderer`
peppy Mar 21, 2023
5857f6f
Merge branch 'master' into renderer-config-fallback
peppy Mar 21, 2023
0fffc81
Move window setup inside try-catch
smoogipoo Mar 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions osu.Framework/Platform/GameHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,7 @@ protected void SetupRendererAndWindow(IRenderer renderer, GraphicsSurfaceType su
Logger.Log(e.ToString());

Window?.Close();
Window?.Dispose();
Window = null;

Renderer = null;
Expand Down
15 changes: 5 additions & 10 deletions osu.Framework/Platform/SDL2DesktopWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,6 @@ public void Run()
}

Exited?.Invoke();

if (SDLWindowHandle != IntPtr.Zero)
SDL.SDL_DestroyWindow(SDLWindowHandle);

SDL.SDL_Quit();
}

private bool firstDraw = true;
Expand All @@ -303,11 +298,7 @@ public void OnDraw()
/// <summary>
/// Forcefully closes the window.
/// </summary>
public void Close() => ScheduleCommand(() =>
frenzibyte marked this conversation as resolved.
Show resolved Hide resolved
{
SDL.SDL_DestroyWindow(SDLWindowHandle);
Exists = false;
});
public void Close() => ScheduleCommand(() => Exists = false);

public void Raise() => ScheduleCommand(() =>
{
Expand Down Expand Up @@ -534,6 +525,10 @@ internal virtual void SetIconFromGroup(IconGroup iconGroup)

public void Dispose()
{
if (SDLWindowHandle != IntPtr.Zero)
SDL.SDL_DestroyWindow(SDLWindowHandle);

SDL.SDL_Quit();
}
}
}