|
KiCad PCB EDA Suite
|
Limit how often the OpenGL canvases are rebuilt after GPU resets. More...
#include <gl_reset_budget.h>
Public Types | |
| using | CLOCK = std::chrono::steady_clock |
Public Member Functions | |
| GL_RESET_BUDGET (size_t aMaxResets, CLOCK::duration aWindow) | |
| bool | RecordReset (CLOCK::time_point aNow) |
| Record a reset. | |
Private Attributes | |
| size_t | m_maxResets |
| CLOCK::duration | m_window |
| std::deque< CLOCK::time_point > | m_resets |
Limit how often the OpenGL canvases are rebuilt after GPU resets.
A driver that resets on every frame would otherwise rebuild the canvases forever, so once more than the allowed number of resets land inside the window the caller should stop using OpenGL.
Definition at line 37 of file gl_reset_budget.h.
| using KIGFX::GL_RESET_BUDGET::CLOCK = std::chrono::steady_clock |
Definition at line 40 of file gl_reset_budget.h.
|
inline |
Definition at line 42 of file gl_reset_budget.h.
References m_maxResets, and m_window.
|
inline |
Record a reset.
Definition at line 53 of file gl_reset_budget.h.
References m_maxResets, m_resets, and m_window.
|
private |
Definition at line 64 of file gl_reset_budget.h.
Referenced by GL_RESET_BUDGET(), and RecordReset().
|
private |
Definition at line 66 of file gl_reset_budget.h.
Referenced by RecordReset().
|
private |
Definition at line 65 of file gl_reset_budget.h.
Referenced by GL_RESET_BUDGET(), and RecordReset().