diff --git a/backends/imgui_impl_dx10.cpp b/backends/imgui_impl_dx10.cpp index 4dc5f884e..b7be791c7 100644 --- a/backends/imgui_impl_dx10.cpp +++ b/backends/imgui_impl_dx10.cpp @@ -642,7 +642,8 @@ void ImGui_ImplDX10_NewFrame() IM_ASSERT(bd != nullptr && "Context or backend not initialized! Did you call ImGui_ImplDX10_Init()?"); if (!bd->pVertexShader) - ImGui_ImplDX10_CreateDeviceObjects(); + if (!ImGui_ImplDX10_CreateDeviceObjects()) + IM_ASSERT(0 && "ImGui_ImplDX10_CreateDeviceObjects() failed!"); } //----------------------------------------------------------------------------- diff --git a/backends/imgui_impl_dx11.cpp b/backends/imgui_impl_dx11.cpp index 14e74e9b2..1917f6c0f 100644 --- a/backends/imgui_impl_dx11.cpp +++ b/backends/imgui_impl_dx11.cpp @@ -662,7 +662,8 @@ void ImGui_ImplDX11_NewFrame() IM_ASSERT(bd != nullptr && "Context or backend not initialized! Did you call ImGui_ImplDX11_Init()?"); if (!bd->pVertexShader) - ImGui_ImplDX11_CreateDeviceObjects(); + if (!ImGui_ImplDX11_CreateDeviceObjects()) + IM_ASSERT(0 && "ImGui_ImplDX11_CreateDeviceObjects() failed!"); } //----------------------------------------------------------------------------- diff --git a/backends/imgui_impl_dx12.cpp b/backends/imgui_impl_dx12.cpp index 5f7eec063..1baa3c4e8 100644 --- a/backends/imgui_impl_dx12.cpp +++ b/backends/imgui_impl_dx12.cpp @@ -914,7 +914,8 @@ void ImGui_ImplDX12_NewFrame() IM_ASSERT(bd != nullptr && "Context or backend not initialized! Did you call ImGui_ImplDX12_Init()?"); if (!bd->pPipelineState) - ImGui_ImplDX12_CreateDeviceObjects(); + if (!ImGui_ImplDX12_CreateDeviceObjects()) + IM_ASSERT(0 && "ImGui_ImplDX12_CreateDeviceObjects() failed!"); } //----------------------------------------------------------------------------- diff --git a/backends/imgui_impl_opengl3.cpp b/backends/imgui_impl_opengl3.cpp index 3f6c08756..40b3be68b 100644 --- a/backends/imgui_impl_opengl3.cpp +++ b/backends/imgui_impl_opengl3.cpp @@ -431,7 +431,8 @@ void ImGui_ImplOpenGL3_NewFrame() ImGui_ImplOpenGL3_InitLoader(); // Lazily init loader if not already done for e.g. DLL boundaries. if (!bd->ShaderHandle) - ImGui_ImplOpenGL3_CreateDeviceObjects(); + if (!ImGui_ImplOpenGL3_CreateDeviceObjects()) + IM_ASSERT(0 && "ImGui_ImplOpenGL3_CreateDeviceObjects() failed!"); } static void ImGui_ImplOpenGL3_SetupRenderState(ImDrawData* draw_data, int fb_width, int fb_height, GLuint vertex_array_object) @@ -965,21 +966,24 @@ bool ImGui_ImplOpenGL3_CreateDeviceObjects() GL_CALL(vert_handle = glCreateShader(GL_VERTEX_SHADER)); glShaderSource(vert_handle, 2, vertex_shader_with_version, nullptr); glCompileShader(vert_handle); - CheckShader(vert_handle, "vertex shader"); + if (!CheckShader(vert_handle, "vertex shader")) + return false; const GLchar* fragment_shader_with_version[2] = { bd->GlslVersionString, fragment_shader }; GLuint frag_handle; GL_CALL(frag_handle = glCreateShader(GL_FRAGMENT_SHADER)); glShaderSource(frag_handle, 2, fragment_shader_with_version, nullptr); glCompileShader(frag_handle); - CheckShader(frag_handle, "fragment shader"); + if (!CheckShader(frag_handle, "fragment shader")) + return false; // Link bd->ShaderHandle = glCreateProgram(); glAttachShader(bd->ShaderHandle, vert_handle); glAttachShader(bd->ShaderHandle, frag_handle); glLinkProgram(bd->ShaderHandle); - CheckProgram(bd->ShaderHandle, "shader program"); + if (!CheckProgram(bd->ShaderHandle, "shader program")) + return false; glDetachShader(bd->ShaderHandle, vert_handle); glDetachShader(bd->ShaderHandle, frag_handle); diff --git a/backends/imgui_impl_vulkan.cpp b/backends/imgui_impl_vulkan.cpp index 3e2c043de..a0f787e8a 100644 --- a/backends/imgui_impl_vulkan.cpp +++ b/backends/imgui_impl_vulkan.cpp @@ -1236,7 +1236,8 @@ bool ImGui_ImplVulkan_Init(ImGui_ImplVulkan_InitInfo* info) } #endif - ImGui_ImplVulkan_CreateDeviceObjects(); + if (!ImGui_ImplVulkan_CreateDeviceObjects()) + IM_ASSERT(0 && "ImGui_ImplVulkan_CreateDeviceObjects() failed!"); // <- Can't be hit yet. return true; } diff --git a/backends/imgui_impl_wgpu.cpp b/backends/imgui_impl_wgpu.cpp index 09bd30ca8..c0ec2e3f9 100644 --- a/backends/imgui_impl_wgpu.cpp +++ b/backends/imgui_impl_wgpu.cpp @@ -901,7 +901,8 @@ void ImGui_ImplWGPU_NewFrame() { ImGui_ImplWGPU_Data* bd = ImGui_ImplWGPU_GetBackendData(); if (!bd->pipelineState) - ImGui_ImplWGPU_CreateDeviceObjects(); + if (!ImGui_ImplWGPU_CreateDeviceObjects()) + IM_ASSERT(0 && "ImGui_ImplWGPU_CreateDeviceObjects() failed!"); } //-----------------------------------------------------------------------------