Open raphaelschmitz00 opened 1 month ago
Noted - this is because the Vulkan renderer is currently utter garbage. Will be reworking it completely in the future anyway. Thank you for the info though - this will be considered then!
Yes, understandable.
Especially since window resizing is comparatively complex in Vulkan, I had no delusion that this would be quickly fixed. But for documentation purposes, this issue is here now.
Exactly; and as I mentioned in the discord - you can probably get away with keeping the render pass because it remains compatible from re-sizing. In cases it doesn't (if you change more than window size) you can just GC the nvg
object and make a new one, then it might work. Should not happen to often and thus have manageable performance impact.
I currently have a situation where on view resizing, I'm recreating the
RenderPass
. That means I also have to recreateNvg
in order to pass the newRenderPass
to it. This causes errors for me.If on resizing, I
.Dispose()
the currentNvg
instance and create a new one, disposing works fine, but then I get an error forvkCmdBindPipeline
"pipeline must be a valid VkPipeline handle"at SilkyNvg.Rendering.Vulkan.Calls.ConvexFillCall.Run(Frame frame, CommandBuffer cmd)
If instead I wait a couple of frames after
Nvg.Dispose()
before creating the new one, I get an error forvkDestroyPipeline
"pipeline must be a valid VkPipeline handle"at SilkyNvg.Rendering.Vulkan.Pipelines.Pipeline.Dispose().
The error does not pop up until the wait time is over. This happens even if I set a long wait time, e.g. 1000 frames (= longer than a second), but if I run it in debug mode instead and use a breakpoint, I get the same error as above withvkCmdBindPipeline
I'm using 2 frames in flight. I'm using one
RenderPass
with 2 Subpasses, the second one being for SilkyNvg (to draw a UI over the stuff rendered in the first subpass).Nvg creation code:
Error for disposing and immediately recreating:
Error for disposing and waiting a couple of frames before (these calls repeat a couple of times, actually):