Description
Version/Branch of Dear ImGui:
Version: v1.86
Branch: master
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_opengl3.cpp
+ imgui_impl_glfw.cpp
Compiler: MSVC
Operating System: Windows 10
Hi, I've been having this problem for a long time on my GTX 1050 Ti card, when line 428 below gets called, access violation occurs. Today I just tried the newest version 1.86 where glBufferData()
was changed to glBufferSubData()
, but the error is still there. I cannot find anything wrong such as null pointers in cmd_list->VtxBuffer
, I searched a lot on google and also updated my driver, still no luck.
imgui/backends/imgui_impl_opengl3.cpp
Lines 422 to 430 in 440824d
Here is a minimal example that reproduces the error:
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 6);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_SAMPLES, 4);
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GLFW_TRUE);
window_ptr = glfwCreateWindow(width, height, title.c_str(), NULL, NULL);
glfwMakeContextCurrent(window_ptr);
glfwSwapInterval(0);
gladLoadGLLoader((GLADloadproc)glfwGetProcAddress);
ImGui::CreateContext();
ImGui_ImplGlfw_InitForOpenGL(Window::window_ptr, false);
ImGui_ImplOpenGL3_Init();
// register callbacks manually .....
while (true) {
glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
glClearDepth(1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
ImGui_ImplOpenGL3_NewFrame();
ImGui_ImplGlfw_NewFrame();
ImGui::NewFrame();
ImGui::Text("test"); // doesn't matter what we draw
ImGui::Render();
ImGui_ImplOpenGL3_RenderDrawData(GetDrawData()); // access violation inside this call
glfwSwapBuffers(Window::window_ptr);
glfwPollEvents();
}
I'm not sure if this is a problem of ImGui, just wonder if people have reported similar issues or solutions on this. It looks like a driver issue because it only happens on my NVIDIA 1050 ti card, but works fine on AMD 540 and Intel HD 620. The weird thing is that, this access violation is gone when I try to debug the app in RenderDoc, as long as I run it through RenderDoc, everything work as expected, but of course I can't debug line by line then.....