Skip to content

Commit 461e941

Browse files
committed
Use len(draw_data.cmd_lists) in imgui backend
<details><summary>Claude's draft</summary> `ImDrawData.cmd_lists_count` was a legacy alias, documented in the imgui_bundle stubs as `== CmdLists.Size`, and imgui_bundle removed it in 1.92.900. Every `ImguiWgpuBackend.render()` call raises AttributeError against that release. Fixes #829. `len(draw_data.cmd_lists)` is exactly what the removed attribute equalled, and works across the whole supported `imgui-bundle>=1.92.0,<2` range: verified against 1.92.0, 1.92.3, 1.92.4, 1.92.5, 1.92.600, 1.92.601, 1.92.700, 1.92.801 and 1.92.900. No shim or version check is needed, and the pin does not need narrowing. The test from the previous commit fails without this change and passes with it. Resume this Claude session: ``` cd /home/mark/git/wgpu-py claude --resume 590dd7bc-312c-419e-ad3d-2c69d00943cd ``` </details>
1 parent 71d2a61 commit 461e941

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ Possible sections in each release:
3333
Downstream code should capture that error and skip the frame, optionally invoking some sort of sleep to save energy.
3434
See https://github.com/pygfx/wgpu-py/pull/820 for context.
3535

36+
### Fixed:
37+
* The imgui backend no longer uses ``ImDrawData.cmd_lists_count``, which was removed in imgui-bundle 1.92.900.
38+
See https://github.com/pygfx/wgpu-py/issues/829.
39+
3640

3741
## [v0.31.1] - 23-06-2026
3842

wgpu/utils/imgui/imgui_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ def render(
445445
fb_width = int(display_width * draw_data.framebuffer_scale.x)
446446
fb_height = int(display_height * draw_data.framebuffer_scale.y)
447447

448-
if fb_width <= 0 or fb_height <= 0 or draw_data.cmd_lists_count == 0:
448+
if fb_width <= 0 or fb_height <= 0 or len(draw_data.cmd_lists) == 0:
449449
return
450450

451451
if draw_data.textures is not None:

0 commit comments

Comments
 (0)