mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-07 21:23:32 +00:00
example: disable vsync of sw window for stability.
SDL + software engine doesn't need the vsync? Observed the rendering performance is noticeably unstable on Intel Arc chipsets with certain window sizes (ie 800x800) when VSync is enabled on software-rendered windows. This might be a workaround, or it could be an issue with the driver or SDL. Either way, the SDL + software engine doesn't need VSync.
This commit is contained in:
parent
2990e72b23
commit
2d695c4d46
1 changed files with 10 additions and 0 deletions
|
@ -283,6 +283,8 @@ struct Window
|
|||
|
||||
struct SwWindow : Window
|
||||
{
|
||||
SDL_Renderer* renderer = nullptr;
|
||||
|
||||
SwWindow(Example* example, uint32_t width, uint32_t height, uint32_t threadsCnt) : Window(example, width, height, threadsCnt)
|
||||
{
|
||||
if (!initialized) return;
|
||||
|
@ -296,9 +298,17 @@ struct SwWindow : Window
|
|||
return;
|
||||
}
|
||||
|
||||
//VSync has been disabled. Remove this line if you need VSync enabled.
|
||||
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_PRESENTVSYNC);
|
||||
|
||||
resize();
|
||||
}
|
||||
|
||||
~SwWindow()
|
||||
{
|
||||
if (renderer) SDL_DestroyRenderer(renderer);
|
||||
}
|
||||
|
||||
void resize() override
|
||||
{
|
||||
auto surface = SDL_GetWindowSurface(window);
|
||||
|
|
Loading…
Add table
Reference in a new issue