https://bugs.winehq.org/show_bug.cgi?id=52574
--- Comment #6 from Zebediah Figura z.figura12@gmail.com --- Created attachment 71965 --> https://bugs.winehq.org/attachment.cgi?id=71965 submit GL command fences when blitting to the front buffer
The application is repeatedly issuing draw calls from a ddraw sysmem buffer. This causes ddraw to repeatedly discard a vertex buffer, asynchronously replacing the existing BO (block) with a new one.
The problem is that the old BOs aren't getting reclaimed. In order to be nice to the GL driver, we don't reclaim them until they aren't in use anymore by the GPU, and we use command fences to determine that. We submit command fences periodically so that we don't let retired resources pile up infinitely.
Unfortunately, our means of submitting command fences periodically is "when the swapchain is presented". The application uses IDirectDrawSurface7::Blt() to blit directly to the front buffer, which has the result that we apparently do correctly render to the screen, but never call wined3d_swapchain_present().
So there are multiple potential ways to fix this, and I don't know which is the correct one. We could be trying to submit command fences more often (when?). Or maybe ddraw should be actually presenting the swapchain, but the correct semantics associated with that are unclear to me.
The attached patch seems potentially correct, though, and does fix the application.