|
14 | 14 |
|
15 | 15 | // CHANGELOG
|
16 | 16 | // (minor and older changes stripped away, please see git history for details)
|
| 17 | +// 2022-11-09: OpenGL: Reverted use of glBufferSubData(), too many corruptions issues + old issues seemingly can't be reproed with Intel drivers nowadays (revert 2021-12-15 and 2022-05-23 changes). |
17 | 18 | // 2022-10-11: Using 'nullptr' instead of 'NULL' as per our switch to C++11.
|
18 | 19 | // 2022-09-27: OpenGL: Added ability to '#define IMGUI_IMPL_OPENGL_DEBUG'.
|
19 | 20 | // 2022-05-23: OpenGL: Reworking 2021-12-15 "Using buffer orphaning" so it only happens on Intel GPU, seems to cause problems otherwise. (#4468, #4825, #4832, #5127).
|
@@ -272,12 +273,15 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
|
272 | 273 | }
|
273 | 274 | bd->GlVersion = (GLuint)(major * 100 + minor * 10);
|
274 | 275 |
|
| 276 | + bd->UseBufferSubData = false; |
| 277 | + /* |
275 | 278 | // Query vendor to enable glBufferSubData kludge
|
276 | 279 | #ifdef _WIN32
|
277 | 280 | if (const char* vendor = (const char*)glGetString(GL_VENDOR))
|
278 | 281 | if (strncmp(vendor, "Intel", 5) == 0)
|
279 | 282 | bd->UseBufferSubData = true;
|
280 | 283 | #endif
|
| 284 | + */ |
281 | 285 | #else
|
282 | 286 | bd->GlVersion = 200; // GLES 2
|
283 | 287 | #endif
|
@@ -495,9 +499,13 @@ void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
|
495 | 499 | const ImDrawList* cmd_list = draw_data->CmdLists[n];
|
496 | 500 |
|
497 | 501 | // Upload vertex/index buffers
|
498 |
| - // - On Intel windows drivers we got reports that regular glBufferData() led to accumulating leaks when using multi-viewports, so we started using orphaning + glBufferSubData(). (See https://github.com/ocornut/imgui/issues/4468) |
499 |
| - // - On NVIDIA drivers we got reports that using orphaning + glBufferSubData() led to glitches when using multi-viewports. |
500 |
| - // - OpenGL drivers are in a very sorry state in 2022, for now we are switching code path based on vendors. |
| 502 | + // - OpenGL drivers are in a very sorry state nowadays.... |
| 503 | + // During 2021 we attempted to switch from glBufferData() to orphaning+glBufferSubData() following reports |
| 504 | + // of leaks on Intel GPU when using multi-viewports on Windows. |
| 505 | + // - After this we kept hearing of various display corruptions issues. We started disabling on non-Intel GPU, but issues still got reported on Intel. |
| 506 | + // - We are now back to using exclusively glBufferData(). So bd->UseBufferSubData IS ALWAYS FALSE in this code. |
| 507 | + // We are keeping the old code path for a while in case people finding new issues may want to test the bd->UseBufferSubData path. |
| 508 | + // - See https://github.com/ocornut/imgui/issues/4468 and please report any corruption issues. |
501 | 509 | const GLsizeiptr vtx_buffer_size = (GLsizeiptr)cmd_list->VtxBuffer.Size * (int)sizeof(ImDrawVert);
|
502 | 510 | const GLsizeiptr idx_buffer_size = (GLsizeiptr)cmd_list->IdxBuffer.Size * (int)sizeof(ImDrawIdx);
|
503 | 511 | if (bd->UseBufferSubData)
|
|
0 commit comments