Skip to content

ImGui: DX12 dynamic font atlas (1.92 RendererHasTextures)#221

Merged
Segfaultd merged 1 commit into
MafiaHub:developfrom
Kheartz:imgui-dx12-textures
Jun 27, 2026
Merged

ImGui: DX12 dynamic font atlas (1.92 RendererHasTextures)#221
Segfaultd merged 1 commit into
MafiaHub:developfrom
Kheartz:imgui-dx12-textures

Conversation

@Kheartz

@Kheartz Kheartz commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Init via the InitInfo path wired to the backend's SRV slot pool so the DX12 backend advertises RendererHasTextures; the legacy single-descriptor init asserts when 1.92 rebuilds the atlas at runtime. Adds GetCommandQueue.

Summary by CodeRabbit

  • New Features
    • Improved DirectX 12 integration for the app’s UI, enabling more reliable descriptor allocation and cleanup for rendering.
    • Added access to the graphics command queue within the backend, supporting better coordination with the rendering pipeline.

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Kheartz, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 52 minutes and 26 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 62fe3fb1-ecde-4797-ab52-33d51185f715

📥 Commits

Reviewing files that changed from the base of the PR and between f1707e5 and f32adfc.

📒 Files selected for processing (2)
  • code/framework/src/external/imgui/wrapper.cpp
  • code/framework/src/graphics/backend/d3d12.h

Walkthrough

Adds a GetCommandQueue() accessor to D3D12Backend and introduces internal ImGuiAllocSRV/ImGuiFreeSRV helpers in wrapper.cpp that delegate SRV slot allocation to the D3D12 backend. Wrapper::Init is updated to use the ImGui_ImplDX12_InitInfo struct, populating device, command queue, frame count, RTV format, SRV heap, and the new callbacks.

Changes

ImGui DX12 SRV Callback Wiring

Layer / File(s) Summary
SRV alloc/free callbacks and ImGui DX12 init
code/framework/src/graphics/backend/d3d12.h, code/framework/src/external/imgui/wrapper.cpp
Adds GetCommandQueue() to D3D12Backend; implements anonymous-namespace ImGuiAllocSRV/ImGuiFreeSRV helpers that map to AllocateSRVSlot/FreeSRVSlot; rewires Wrapper::Init to build ImGui_ImplDX12_InitInfo and register the callbacks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • MafiaHub/Framework#213: Implements the AllocateSRVSlot/FreeSRVSlot APIs on D3D12Backend that the new ImGuiAllocSRV/ImGuiFreeSRV helpers directly call.
  • MafiaHub/Framework#217: Introduces ViewD3D12 which renders via ImGui using D3D12 descriptor handles, directly depending on the SRV alloc/free callback wiring added here.

Suggested reviewers

  • zpl-zak

🐇 A descriptor slot, freshly found,
The SRV heap spins round and round.
ImGui asks, the backend grants,
Handles dance in GPU-land chants.
The command queue now has a getter too —
Every frame rendered fresh and new! 🎨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: DX12 ImGui support for dynamic font atlas and RendererHasTextures.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@code/framework/src/external/imgui/wrapper.cpp`:
- Around line 30-34: ImGuiAllocSRV currently assumes AllocateSRVSlot always
succeeds, but it can return -1 on SRV pool exhaustion and then the code returns
invalid descriptor handles. Update ImGuiAllocSRV to detect the failure case
immediately after calling AllocateSRVSlot, fail loudly instead of populating
outCpu/outGpu, and only call GetSRVSlotCPUHandle/GetSRVSlotGPUHandle when the
slot is valid.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 07db31e0-e43e-4729-a41b-a96311969bae

📥 Commits

Reviewing files that changed from the base of the PR and between f6ffc68 and f1707e5.

📒 Files selected for processing (2)
  • code/framework/src/external/imgui/wrapper.cpp
  • code/framework/src/graphics/backend/d3d12.h

Comment thread code/framework/src/external/imgui/wrapper.cpp Outdated
Init via the InitInfo path wired to the backend's SRV slot pool so the DX12
backend advertises RendererHasTextures; the legacy single-descriptor init
asserts when 1.92 rebuilds the atlas at runtime. Adds GetCommandQueue.
@Kheartz Kheartz force-pushed the imgui-dx12-textures branch from f1707e5 to f32adfc Compare June 27, 2026 18:07
@Segfaultd Segfaultd merged commit 019cf4a into MafiaHub:develop Jun 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants