diff options
| author | hachem <im@hachem.wtf> | 2026-08-18 15:24:44 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-08-18 15:24:44 +0200 |
| commit | 06ef412cd83315d7995aa0afd7e6792b305086ea (patch) | |
| tree | 200b7e9d5192e406df8ca0383d8c249af6f7ad4b /src/Engine | |
| parent | dfe9da43dab6c933bc1024f992383f08e01386de (diff) | |
[chore]: optimization
Diffstat (limited to 'src/Engine')
| -rw-r--r-- | src/Engine/Engine.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Engine/Engine.cpp b/src/Engine/Engine.cpp index 76be360..9c2a4f6 100644 --- a/src/Engine/Engine.cpp +++ b/src/Engine/Engine.cpp @@ -160,7 +160,10 @@ namespace Donut // a single fullscreen draw, so render it in scissored tiles and flush // after each, keeping every submission short enough to survive the // watchdog. Compute-capable platforms draw it in one pass. - const int tile = 24; + // Largest tile that keeps a tile's worst-case work (tile^2 * stepCap) + // inside the safe watchdog zone measured on this GPU (~25M pixel-steps + // per submission); bigger tiles mean fewer glFinish stalls. + const int tile = 64; glEnable(GL_SCISSOR_TEST); for (int y = 0; y < ch; y += tile) { @@ -302,8 +305,11 @@ namespace Donut // fragment shader under the OS GPU watchdog. The stock step counts // (up to 30000) make a single tile exceed the watchdog and hang the // GPU, so cap them here. Windows/Linux keep the full step count. - data.maxStepsMoving = std::min(data.maxStepsMoving, 10000); - data.maxStepsStatic = std::min(data.maxStepsStatic, 10000); + // While the camera moves, render cheaply so interaction stays smooth; + // when it settles, spend more steps for a cleaner image. Both stay well + // under the per-tile GPU-watchdog budget (see DrawGeodesicPass). + data.maxStepsMoving = std::min(data.maxStepsMoving, 4000); + data.maxStepsStatic = std::min(data.maxStepsStatic, 6000); #endif m_SimulationUBO->SetData(&data, sizeof(data)); |
