diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2022-07-17 20:26:28 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2022-07-17 20:26:28 +0200 |
| commit | 9d786ab096ed36ea384e03ee5cea498790e31eec (patch) | |
| tree | adee54b5b90a35238d5794e9ffd3ebcf65798a06 /Backends/VkvgBackend/src/DefaultBackend.cs | |
| parent | 57daad000aa31c7bcfa1f76b90d40da5a21da041 (diff) | |
wip
Diffstat (limited to 'Backends/VkvgBackend/src/DefaultBackend.cs')
| -rw-r--r-- | Backends/VkvgBackend/src/DefaultBackend.cs | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/Backends/VkvgBackend/src/DefaultBackend.cs b/Backends/VkvgBackend/src/DefaultBackend.cs index 8521d503..eeed4d0a 100644 --- a/Backends/VkvgBackend/src/DefaultBackend.cs +++ b/Backends/VkvgBackend/src/DefaultBackend.cs @@ -32,7 +32,7 @@ namespace Crow.VkvgBackend protected Fence drawFence; Surface surf; Device vkvgDev; - SampleCount samples = SampleCount.Sample_1; + SampleCount samples = SampleCount.Sample_8; bool vsync = false; bool tryGetPhy (vke.PhysicalDeviceCollection physicalDevices, VkPhysicalDeviceType phyType, out PhysicalDevice phy, bool swapchainSupport) { @@ -189,6 +189,7 @@ namespace Crow.VkvgBackend new SvgHandle (vkvgDev, System.Text.Encoding.Unicode.GetBytes (svgFragment)); bool disposeContextOnFlush; IRegion clipping; + volatile bool resizeMainSurface = false; protected void clear(IContext ctx) { for (int i = 0; i < clipping.NumRectangles; i++) ctx.Rectangle (clipping.GetRectangle (i)); @@ -200,6 +201,11 @@ namespace Crow.VkvgBackend } public override IContext PrepareUIFrame(IContext existingContext, IRegion clipping) { + if (resizeMainSurface) { + createMainSurface (swapChain.Width, swapChain.Height); + clipping.UnionRectangle (new Rectangle(new Size((int)swapChain.Width, (int)swapChain.Height))); + resizeMainSurface = false; + } this.clipping = clipping; IContext ctx = existingContext; if (ctx == null) { @@ -216,23 +222,24 @@ namespace Crow.VkvgBackend { if (disposeContextOnFlush) ctx.Dispose (); - clipping = null; - - dev.WaitIdle(); int idx = swapChain.GetNextImage (); if (idx < 0) { - createMainSurface (swapChain.Width, swapChain.Height); + resizeMainSurface = true; return; } + clipping = null; + + //dev.WaitIdle(); + drawFence.Wait (); drawFence.Reset (); graphicQueue.Submit (cmds[idx], swapChain.presentComplete, drawComplete[idx], drawFence); (graphicQueue as PresentQueue).Present (swapChain, drawComplete[idx]); - dev.WaitIdle(); + //dev.WaitIdle(); } public override void ResizeMainSurface (int width, int height) { //resize is done on swapchain image aquisition failure |