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

Win2D Stuttered at DrawImage, DrawTextLayout, etc. #887

Open
pcfulife opened this issue Oct 3, 2022 · 1 comment
Open

Win2D Stuttered at DrawImage, DrawTextLayout, etc. #887

pcfulife opened this issue Oct 3, 2022 · 1 comment

Comments

@pcfulife
Copy link

pcfulife commented Oct 3, 2022

My Direct2D game application sometimes stuttered. And, I found that some DrawImage, DrawTextLayout method blocks at least 1ms. I know that these methods just store drawing command into internal buffer and it should be return immediately.

I expect that it is happened because internal command buffer is full. So, drawing commands are flushed into GPU. Can I increase internal buffer size for only flushing when I call CanvasDrawingSession.Dispose?

I can edit Win2D source code directly. (I was implemented NVIDIA(R) Reflext(TM) technology into Win2D) So, it is OK for changing Direct2D, 3D, DXGI, SwapChain property directly.

I am using .NET Core 3.1 + WPF + Xaml Islands.

@ChewWorker
Copy link

There is no way for you to alter the size of the command buffer inside D2D. So if the buffer is full during one of your draw calls, yes you will see the cost of executing the batched commands during that Draw call. You could try using Flush to empty the internal batch. This might help you balance your draw calls to avoid an expensive blocking call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants