From 991670b79ba9edef5f9955b2228be0639d3493c8 Mon Sep 17 00:00:00 2001 From: Suyash Date: Fri, 18 Sep 2026 02:44:35 +0000 Subject: [PATCH] fix(ui): upload device hero images so they actually render `_deviceTexture()` pushed the freshly created `ImTextureData` straight into `ImGui::GetPlatformIO().Textures`, but `UpdateTexturesEndFrame()` resizes that list to 0 each frame and refills it from the font atlases plus the registered user textures. The entry was therefore gone before the renderer backend could honour `ImTextureStatus_WantCreate`, and the texture was never uploaded: - Release: the product image area is blank; every device falls back to nothing. - Debug: `IM_ASSERT(tex_id != ImTextureID_Invalid && "ImDrawCmd is referring to ImTextureData that wasn't uploaded to graphics system...")` fires. `ImGui::RegisterUserTexture()` (imgui 1.92+) adds it to `g.UserTextures`, which is what the per-frame rebuild reads from, so the upload request survives. Co-Authored-By: Claude Opus 5 --- Client/CrossPlatformGUI.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Client/CrossPlatformGUI.cpp b/Client/CrossPlatformGUI.cpp index 993d9a85..2c010180 100644 --- a/Client/CrossPlatformGUI.cpp +++ b/Client/CrossPlatformGUI.cpp @@ -1,5 +1,7 @@ #include "CrossPlatformGUI.h" +#include "imgui_internal.h" // ImGui::RegisterUserTexture() + #include #include #include @@ -317,8 +319,12 @@ const CrossPlatformGUI::DeviceTexture& CrossPlatformGUI::_deviceTexture(const st ImTextureData* tex = IM_NEW(ImTextureData)(); tex->Create(ImTextureFormat_RGBA32, w, h); memcpy(tex->GetPixels(), pixels, (size_t)w * h * 4); - tex->SetStatus(ImTextureStatus_WantCreate); - ImGui::GetPlatformIO().Textures.push_back(tex); + // ImGui::UpdateTexturesEndFrame() clears and rebuilds PlatformIO.Textures from the font atlases + // and the registered user textures on every frame, so pushing into it directly was dropped again + // before the renderer backend ever saw the WantCreate request: the hero image stayed blank in + // Release builds and tripped the "ImDrawCmd is referring to ImTextureData that wasn't uploaded" + // assert in Debug. RegisterUserTexture() is the supported way in (imgui >= 1.92). + ImGui::RegisterUserTexture(tex); out.ref = tex->GetTexRef(); out.w = w;