Skip to content

Commit c4fa25d

Browse files
authored
Udpate to ImGui v1.91.8. (#15)
* Update ImGui to v1.91.8. * Update the vulkan backend to v1.91.8. * Re-introduce unusedVkPipelineRenderingCreateInfo in the vulkan backend header file. * Add FIX(zig-gamedev) comment to vulkan backend header file.
1 parent 92b2df4 commit c4fa25d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+7323
-4219
lines changed

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ Easy to use, hand-crafted API with default arguments, named parameters and Zig s
1616

1717
## Versions
1818

19-
* [ImGui](https://github.com/ocornut/imgui/tree/v1.91.0-docking) `1.91.0-docking`
20-
* [ImGui test engine](https://github.com/ocornut/imgui_test_engine/tree/v1.91.0) `1.91.0`
19+
* [ImGui](https://github.com/ocornut/imgui/tree/v1.91.8-docking) `1.91.8-docking`
20+
* [ImGui test engine](https://github.com/ocornut/imgui_test_engine/tree/v1.91.8) `1.91.8`
2121
* [ImPlot](https://github.com/epezent/implot) `O.17`
2222
* [ImGuizmo](https://github.com/CedricGuillemet/ImGuizmo) `1.89 WIP`
2323
* [ImGuiNodeEditor](https://github.com/thedmd/imgui-node-editor/tree/v0.9.3) `O.9.3`

Diff for: libs/imgui/LICENSE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014-2023 Omar Cornut
3+
Copyright (c) 2014-2025 Omar Cornut
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Diff for: libs/imgui/backends/imgui_impl_dx12.cpp

+165-98
Large diffs are not rendered by default.

Diff for: libs/imgui/backends/imgui_impl_dx12.h

+49-16
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33

44
// Implemented features:
55
// [X] Renderer: User texture binding. Use 'D3D12_GPU_DESCRIPTOR_HANDLE' as ImTextureID. Read the FAQ about ImTextureID!
6-
// [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices.
6+
// [X] Renderer: Large meshes support (64k+ vertices) even with 16-bit indices (ImGuiBackendFlags_RendererHasVtxOffset).
7+
// [X] Renderer: Expose selected render state for draw callbacks to use. Access in '(ImGui_ImplXXXX_RenderState*)GetPlatformIO().Renderer_RenderState'.
78
// [X] Renderer: Multi-viewport support (multiple windows). Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'.
89

9-
// Important: to compile on 32-bit systems, this backend requires code to be compiled with '#define ImTextureID ImU64'.
10-
// See imgui_impl_dx12.cpp file for details.
10+
// The aim of imgui_impl_dx12.h/.cpp is to be usable in your engine without any modification.
11+
// IF YOU FEEL YOU NEED TO MAKE ANY CHANGE TO THIS CODE, please share them and your feedback at https://github.com/ocornut/imgui/
1112

1213
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
1314
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
@@ -21,30 +22,62 @@
2122
#include "imgui.h" // IMGUI_IMPL_API
2223
#ifndef IMGUI_DISABLE
2324
#include <dxgiformat.h> // DXGI_FORMAT
24-
25-
struct ID3D12Device;
26-
struct ID3D12DescriptorHeap;
27-
struct ID3D12GraphicsCommandList;
28-
struct D3D12_CPU_DESCRIPTOR_HANDLE;
29-
struct D3D12_GPU_DESCRIPTOR_HANDLE;
25+
#include <d3d12.h> // D3D12_CPU_DESCRIPTOR_HANDLE
3026

3127
// FIX(zig-gamedev)
3228
extern "C" {
3329

34-
// cmd_list is the command list that the implementation will use to render imgui draw lists.
35-
// Before calling the render function, caller must prepare cmd_list by resetting it and setting the appropriate
36-
// render target and descriptor heap that contains font_srv_cpu_desc_handle/font_srv_gpu_desc_handle.
37-
// font_srv_cpu_desc_handle and font_srv_gpu_desc_handle are handles to a single SRV descriptor to use for the internal font texture.
38-
IMGUI_IMPL_API bool ImGui_ImplDX12_Init(ID3D12Device* device, int num_frames_in_flight, DXGI_FORMAT rtv_format, ID3D12DescriptorHeap* cbv_srv_heap,
39-
D3D12_CPU_DESCRIPTOR_HANDLE font_srv_cpu_desc_handle, D3D12_GPU_DESCRIPTOR_HANDLE font_srv_gpu_desc_handle);
30+
// Initialization data, for ImGui_ImplDX12_Init()
31+
struct ImGui_ImplDX12_InitInfo
32+
{
33+
ID3D12Device* Device;
34+
ID3D12CommandQueue* CommandQueue;
35+
int NumFramesInFlight;
36+
DXGI_FORMAT RTVFormat; // RenderTarget format.
37+
DXGI_FORMAT DSVFormat; // DepthStencilView format.
38+
void* UserData;
39+
40+
// Allocating SRV descriptors for textures is up to the application, so we provide callbacks.
41+
// (current version of the backend will only allocate one descriptor, future versions will need to allocate more)
42+
ID3D12DescriptorHeap* SrvDescriptorHeap;
43+
void (*SrvDescriptorAllocFn)(ImGui_ImplDX12_InitInfo* info, D3D12_CPU_DESCRIPTOR_HANDLE* out_cpu_desc_handle, D3D12_GPU_DESCRIPTOR_HANDLE* out_gpu_desc_handle);
44+
void (*SrvDescriptorFreeFn)(ImGui_ImplDX12_InitInfo* info, D3D12_CPU_DESCRIPTOR_HANDLE cpu_desc_handle, D3D12_GPU_DESCRIPTOR_HANDLE gpu_desc_handle);
45+
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
46+
D3D12_CPU_DESCRIPTOR_HANDLE LegacySingleSrvCpuDescriptor; // To facilitate transition from single descriptor to allocator callback, you may use those.
47+
D3D12_GPU_DESCRIPTOR_HANDLE LegacySingleSrvGpuDescriptor;
48+
#endif
49+
50+
ImGui_ImplDX12_InitInfo() { memset((void*)this, 0, sizeof(*this)); }
51+
};
52+
53+
// Follow "Getting Started" link and check examples/ folder to learn about using backends!
54+
IMGUI_IMPL_API bool ImGui_ImplDX12_Init(ImGui_ImplDX12_InitInfo* info);
55+
56+
4057
IMGUI_IMPL_API void ImGui_ImplDX12_Shutdown();
4158
IMGUI_IMPL_API void ImGui_ImplDX12_NewFrame();
4259
IMGUI_IMPL_API void ImGui_ImplDX12_RenderDrawData(ImDrawData* draw_data, ID3D12GraphicsCommandList* graphics_command_list);
4360

61+
// FIX(zig-gamedev)
62+
#if 0
63+
// Legacy initialization API Obsoleted in 1.91.5
64+
// font_srv_cpu_desc_handle and font_srv_gpu_desc_handle are handles to a single SRV descriptor to use for the internal font texture, they must be in 'srv_descriptor_heap'
65+
IMGUI_IMPL_API bool ImGui_ImplDX12_Init(ID3D12Device* device, int num_frames_in_flight, DXGI_FORMAT rtv_format, ID3D12DescriptorHeap* srv_descriptor_heap, D3D12_CPU_DESCRIPTOR_HANDLE font_srv_cpu_desc_handle, D3D12_GPU_DESCRIPTOR_HANDLE font_srv_gpu_desc_handle);
66+
#endif
67+
4468
// Use if you want to reset your rendering device without losing Dear ImGui state.
45-
IMGUI_IMPL_API void ImGui_ImplDX12_InvalidateDeviceObjects();
4669
IMGUI_IMPL_API bool ImGui_ImplDX12_CreateDeviceObjects();
70+
IMGUI_IMPL_API void ImGui_ImplDX12_InvalidateDeviceObjects();
4771

4872
}
4973

74+
// [BETA] Selected render state data shared with callbacks.
75+
// This is temporarily stored in GetPlatformIO().Renderer_RenderState during the ImGui_ImplDX12_RenderDrawData() call.
76+
// (Please open an issue if you feel you need access to more data)
77+
struct ImGui_ImplDX12_RenderState
78+
{
79+
ID3D12Device* Device;
80+
ID3D12GraphicsCommandList* CommandList;
81+
};
82+
5083
#endif // #ifndef IMGUI_DISABLE

0 commit comments

Comments
 (0)