opentk / GLWpfControl

A fast native control for OpenTK 4.x + 3.x on WPF.
MIT License
194 stars 48 forks source link

Graphics Memory Increase When Resize #130

Closed IDXGI closed 1 month ago

IDXGI commented 3 months ago

When I use GLWpfControl, if I keep dragging the borders to resize the window, the GPU's memory continues to grow. And even if I stop resizing, the graphics memory usage remains high.

If it is a normal WPF control, there is no such problem and the memory stays the same when resize the control, without any growth.

Maybe the frame buffer is not released correctly when the size is changed, causing the memory to grow?

Library version: 4.2.3 Hardware Information: AMD Radeon(TM) 780M Driver version: 31.0.14005.1004 Driver Date: 2023/7/20 DirectX Version: 12 (FL 12.1) Physical Location: PCI Bus 100, Device 0, Function 0

0 1

NogginBops commented 3 months ago

Will investigate this issue for the next release. It's definitely possible that we have a leak, but looking at the code there is no obvious leak.

IDXGI commented 3 months ago

In fact, it will not always increace, when up to 3.7/4.0GB, it will drop to 3.2/4.0GB, then increase. I use CodeXL to debug, set break when OpenGL error, then resize the window, it immediately hit break point. Maybe something is wrong. But I'm not good at OpenGL programming. The error is: error