Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gpgpuimgui #707

Open
wants to merge 120 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
d8a1f1f
Upgrade Nabla's IMGUI extension backend to use indirect indexed draw …
AnastaZIuk Jul 5, 2024
fd11a0e
update IMGUI to LTS version 1.90.9
AnastaZIuk Jul 7, 2024
85d5681
clean a bit Nabla IMGUI extension backend, remove a lot of useless wr…
AnastaZIuk Jul 7, 2024
c921b9f
Remove SSBO & use Buffer Device Address instead. Clean code, move cli…
AnastaZIuk Jul 7, 2024
b995627
comment out matrix inverse & unpackSnorm2x16 from glsl_compat/core.hl…
AnastaZIuk Jul 8, 2024
e6ecff6
handle imgui clipping correctly, introduce emulated_snorm16_t2 and us…
AnastaZIuk Jul 8, 2024
55031d9
eliminate some Nabla IMGUI extension validation errors, auto submit p…
AnastaZIuk Jul 9, 2024
1bdb902
add 3rdparty/imgui_test_engine submodule
AnastaZIuk Jul 9, 2024
fcca8e0
Create Nabla Imgui Test Engine Tool - integrate 3rdparty/imgui_test_e…
AnastaZIuk Jul 9, 2024
1ce0776
Merge branch 'master' of github.com:Devsh-Graphics-Programming/Nabla …
AnastaZIuk Jul 10, 2024
badbdaf
Correct IMGUI Integration, use Test Engine's configuration and elimin…
AnastaZIuk Jul 10, 2024
54e370f
fail nite's exit code if any test fails
AnastaZIuk Jul 10, 2024
003aae4
Reorganize imgui dependency & utility libraries, create our own imcon…
AnastaZIuk Jul 10, 2024
e932e23
update examples_tests submodule
AnastaZIuk Jul 10, 2024
8eace54
Add CTest for Nabla IMGUI Test Engine, update the tool to use argpars…
AnastaZIuk Jul 10, 2024
fe5dc46
add --queue nite argument which toggles whether tests should be queue…
AnastaZIuk Jul 10, 2024
d755e83
create tools/nite/README.md
AnastaZIuk Jul 11, 2024
f2f89f8
Update README.md, use github uploads for artifacts stored on their aws
AnastaZIuk Jul 11, 2024
2d7d9e2
sync, pull master
AnastaZIuk Jul 11, 2024
e9ac293
Merge branch 'gpgpuimgui' of github.com:Devsh-Graphics-Programming/Na…
AnastaZIuk Jul 11, 2024
a7102f0
update Nabla IMGUI backend to use separated immutable sampler with fo…
AnastaZIuk Jul 11, 2024
c8198be
upgrade Nabla IMGUI backend key IO, use IMGUI_DISABLE_OBSOLETE_KEYIO …
AnastaZIuk Jul 11, 2024
78432b1
Merge branch 'master' of github.com:Devsh-Graphics-Programming/Nabla …
AnastaZIuk Jul 12, 2024
d6e60d4
sync with cad-text-rendering
AnastaZIuk Jul 12, 2024
b52077a
use FreeType to build and rasterize the imgui font atlas instead of s…
AnastaZIuk Jul 12, 2024
b3dc0ca
actually pass descriptor binding flags to Vulkan
AnastaZIuk Jul 12, 2024
38d80c3
use Descriptor Indexing in the IMGUI backend. TODO: ds writes on new …
AnastaZIuk Jul 12, 2024
e87548f
pull master
AnastaZIuk Jul 16, 2024
3eb8fb1
update examples_tests submodule
AnastaZIuk Jul 16, 2024
ab1318c
bring proper dxc submodule pointer back
AnastaZIuk Jul 17, 2024
7385d22
remove openssl again
AnastaZIuk Jul 17, 2024
332fad4
remove 3rdparty/tcpp again
AnastaZIuk Jul 17, 2024
5b6465b
update examples_tests submodule
AnastaZIuk Jul 17, 2024
470b194
Merge branch 'master' of github.com:Devsh-Graphics-Programming/Nabla …
AnastaZIuk Jul 23, 2024
4e10909
Merge branch 'master' of github.com:Devsh-Graphics-Programming/Nabla …
AnastaZIuk Jul 23, 2024
f6d8b89
fix compile issues after pulling master (scoped enums)
AnastaZIuk Jul 23, 2024
b767617
update examples_tests submodule
AnastaZIuk Jul 24, 2024
256c630
fix nite's timeline semaphore issues & sync
AnastaZIuk Jul 24, 2024
b8efcf6
pull master
AnastaZIuk Aug 7, 2024
a86c213
update examples_tests submodule
AnastaZIuk Aug 7, 2024
310369c
update examples_tests submodule & common.cmake
AnastaZIuk Aug 7, 2024
80032c5
fix qualifier issue with builtins, update examples_tests submodule
AnastaZIuk Aug 7, 2024
edf27cd
update examples_tests submodule
AnastaZIuk Aug 8, 2024
6df4dc8
Merge branch 'master' of github.com:Devsh-Graphics-Programming/Nabla …
AnastaZIuk Aug 9, 2024
f70053b
update examples_tests submodule
AnastaZIuk Aug 9, 2024
a488204
update examples_tests submodule
AnastaZIuk Aug 9, 2024
a4f2dac
update examples_tests submodule
AnastaZIuk Aug 9, 2024
47fc1b5
fix NSC include search directories given with CLI
AnastaZIuk Aug 12, 2024
3071f65
update examples_tests submodule
AnastaZIuk Aug 12, 2024
d9624ee
update DXC submodule
AnastaZIuk Aug 13, 2024
f57c274
update examples_tests submodule
AnastaZIuk Aug 17, 2024
9730eb0
update submodule
AnastaZIuk Aug 17, 2024
b1f307b
remove sampler, descriptor set & its pool creation from Nabla IMGUI e…
AnastaZIuk Aug 19, 2024
7a65565
update examples_tests submodule
AnastaZIuk Aug 19, 2024
bfed39c
update examples_test pointer
AnastaZIuk Aug 23, 2024
69a1f65
update examples_tests pointer
AnastaZIuk Aug 23, 2024
675034e
pull asset converter & resolve conflicts
AnastaZIuk Aug 23, 2024
66ade6a
update examples_tests + fix nasty bug with drawID (no more validation…
AnastaZIuk Aug 23, 2024
9415013
update ImGui.cpp & ImGui/shaders/fragment.hlsl, update examples_tests…
AnastaZIuk Aug 23, 2024
9ec03aa
update examples_tests submodule
AnastaZIuk Aug 24, 2024
16187cf
pull asset converter & resolve conflicts
AnastaZIuk Aug 24, 2024
65e1b9a
update examples_tests submodule
AnastaZIuk Aug 24, 2024
b1d5ca7
update examples_tests submodule
AnastaZIuk Aug 24, 2024
7a0e724
update examples_tests submodule
AnastaZIuk Aug 24, 2024
c00a9ea
update examples_tests submodule
AnastaZIuk Aug 25, 2024
4c05ea8
pull asset converter & resolve conflicts
AnastaZIuk Aug 26, 2024
23192ca
update ICPUDescriptorSetLayout.h, add std::span constructor
AnastaZIuk Aug 26, 2024
99ffad4
define ICPURenderpass constructor + add IRenderpass's missing NBL_API…
AnastaZIuk Aug 27, 2024
b956b3c
update examples_tests submodule
AnastaZIuk Aug 27, 2024
5e325e6
update examples_tests submodule
AnastaZIuk Aug 27, 2024
f9f754e
update examples_tests submodule
AnastaZIuk Aug 27, 2024
181f219
pull asset converter & resolve conflicts
AnastaZIuk Aug 28, 2024
5e1cfb6
update examples_tests submodule
AnastaZIuk Aug 28, 2024
f80832b
update examples_tests submodule
AnastaZIuk Sep 3, 2024
ef28cdd
update examples_tests submodule
AnastaZIuk Sep 3, 2024
e4d8cea
pull master & resolve conflicts
AnastaZIuk Sep 3, 2024
7aaf7a9
update examples_tests submodule
AnastaZIuk Sep 3, 2024
6de285f
update examples_tests submodule
AnastaZIuk Sep 3, 2024
1f34e33
update Nabla ImGUI backend to use streaming buffer with multi allocat…
AnastaZIuk Sep 4, 2024
4af890d
preallocate 1Mb MDI buffer in UI's constructor, pass correctly multi …
AnastaZIuk Sep 4, 2024
e9af093
fix awful bugs - requested one extra indirect draw than I have + mist…
AnastaZIuk Sep 5, 2024
73f7713
correct another bug, indeed I don't want to "dont_grab{}" in order to…
AnastaZIuk Sep 5, 2024
cb83a58
add multi alloc fail callback logs, time for intended submit + missin…
AnastaZIuk Sep 5, 2024
5cb70ef
use SIntendedSubmitInfo instead of raw command buffer in UI's render …
AnastaZIuk Sep 5, 2024
839f38f
let's boost default default UI mdi streaming buffer to 2Mb, I still h…
AnastaZIuk Sep 5, 2024
4fbf379
move MULTI_ALLOC_PARAMS to cpp, make mdi the alignment array constexp…
AnastaZIuk Sep 5, 2024
46a5039
cull_frees with streaming buffer, handle failed allocation and make i…
AnastaZIuk Sep 5, 2024
46c78a8
add UI streaming buffer const getter, extra cull frees call, correct …
AnastaZIuk Sep 5, 2024
5be870d
I don't need to cull_frees myself, second allocation attempt fires de…
AnastaZIuk Sep 6, 2024
4b8990b
sort out how we handle window in ImGUI backend - it's really only nee…
AnastaZIuk Sep 7, 2024
bca9f86
bring back GLSLstd450MatrixInverse & GLSLstd450UnpackSnorm2x16 - set …
AnastaZIuk Sep 9, 2024
35af49d
fix IDeviceMemoryAllocation::map bug with setting m_currentMappingAccess
AnastaZIuk Sep 9, 2024
650e2e4
update getters to return dumb pointers, let users pass MDI streaming …
AnastaZIuk Sep 9, 2024
1f19c37
wrap the UI's .update args into S_UPDATE_PARAMETERS, require only the…
AnastaZIuk Sep 10, 2024
738ba75
fix bug with multi allocation timeout, call multi_deallocate right af…
AnastaZIuk Sep 10, 2024
70c5d58
clean more UI's subscribers, remove EUF_INLINE_UPDATE_VIA_CMDBUF from…
AnastaZIuk Sep 10, 2024
17faf3a
typo - registerListener needs to return the same type as unregister t…
AnastaZIuk Sep 10, 2024
ee3fafe
lower mdi allocation timeout time point offset to std::chrono::millis…
AnastaZIuk Sep 10, 2024
2df883e
add IUtilities::getLogger getter
AnastaZIuk Sep 10, 2024
fe79eaf
remove system creation from the UI, take everything it requires from …
AnastaZIuk Sep 10, 2024
be47096
add UI::S_CREATION_PARAMETERS validation
AnastaZIuk Sep 11, 2024
bfdbcf2
clean more code & a small test for sub allocation purposes
AnastaZIuk Sep 11, 2024
4154f08
pull master & resolve conflicts
AnastaZIuk Sep 12, 2024
fbec20b
fix 3rdparty/msdfgen & 3rdparty/nlohmann_json submodule urls (to ssh)
AnastaZIuk Sep 13, 2024
ebe211d
dxc's submodules to ssh
AnastaZIuk Sep 13, 2024
7664479
Merge branch 'master' of github.com:Devsh-Graphics-Programming/Nabla …
AnastaZIuk Sep 14, 2024
1e48c59
turn OPENEXR_FORCE_INTERNAL_DEFLATE ON - fix legacy build system exr'…
AnastaZIuk Sep 15, 2024
9e7cbe2
fix nullptr dereference bug in IShaderCompiler, add some comments to …
AnastaZIuk Sep 15, 2024
dc04722
add asset manager to nbl::ext::imgui::UI::S_CREATION_PARAMETERS, remo…
AnastaZIuk Sep 15, 2024
90cec3b
correct typo in comments
AnastaZIuk Sep 15, 2024
59663ec
pull master & resolve conflicts
AnastaZIuk Sep 17, 2024
de4991b
update UI shader codegen - allow for even more freedom and gen NBL_TE…
AnastaZIuk Sep 17, 2024
ebb16fb
reduce PerObjectData to 10 bytes
AnastaZIuk Sep 17, 2024
18949b1
remove SIntendedSubmitInfo from UI::render, we cannot overflow while …
AnastaZIuk Sep 17, 2024
551c735
ah forgot to uncomment some of GLSL extended math in include/nbl/buil…
AnastaZIuk Sep 17, 2024
eaad1cd
allow for full UI resources setup freedom, exchange descriptor set la…
AnastaZIuk Sep 18, 2024
3c63d01
update UI's validation to cover both immutable & non-immutable samplers
AnastaZIuk Sep 18, 2024
3dd43b8
fix ZERO_CHECK OpenEXR's deps timestamp issues, update libdeflate sub…
AnastaZIuk Sep 19, 2024
421f86c
Merge branch 'master' of github.com:Devsh-Graphics-Programming/Nabla …
AnastaZIuk Sep 19, 2024
1fbbc06
replace StreamingTransientDataBufferST with GeneralpurposeAddressAllo…
AnastaZIuk Sep 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples_tests
Submodule examples_tests updated 1 files
+11 −1 61_UI/main.cpp
37 changes: 22 additions & 15 deletions include/nbl/ext/ImGui/ImGui.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,18 @@ class UI final : public core::IReferenceCounted
EBC_COUNT,
};

nbl::core::smart_refctd_ptr<typename COMPOSE_T> streamingTDBufferST; // composed buffer layout is [EBC_DRAW_INDIRECT_STRUCTURES] [EBC_ELEMENT_STRUCTURES] [EBC_INDEX_BUFFERS] [EBC_VERTEX_BUFFERS]
nbl::core::smart_refctd_ptr<typename COMPOSE_T> streamingTDBufferST; //! composed buffer layout is [EBC_DRAW_INDIRECT_STRUCTURES] [EBC_ELEMENT_STRUCTURES] [EBC_INDEX_BUFFERS] [EBC_VERTEX_BUFFERS]
};

struct S_CREATION_PARAMETERS
{
video::IUtilities* const utilities; //! required
Copy link
Member Author

Choose a reason for hiding this comment

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

for image upload?

Copy link
Member

Choose a reason for hiding this comment

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

yes+ I like the fact I already have device + logger there

video::IQueue* const transfer; //! required
video::IGPURenderpass* const renderpass; //! required
uint32_t subpassIx = 0u; //! optional, default value if not provided
video::IGPUDescriptorSetLayout* const descriptorSetLayout = nullptr; //! optional, default layout used if not provided [STILL TODO, currently its assumed its not nullptr!]
video::IGPUPipelineCache* const pipelineCache = nullptr; //! optional, no cache used if not provided
typename MDI::COMPOSE_T* const streamingMDIBuffer = nullptr; //! optional, default MDI buffer allocated if not provided
};

//! parameters which may change every frame, used with the .update call to interact with ImGuiIO; we require a very *required* minimum - if you need to cover more IO options simply get the IO with ImGui::GetIO() to customize them (they all have default values you can change before calling the .update)
Expand All @@ -44,17 +55,17 @@ class UI final : public core::IReferenceCounted
S_EVENTS events;
};

UI(core::smart_refctd_ptr<video::ILogicalDevice> _device, core::smart_refctd_ptr<video::IGPUDescriptorSetLayout> _descriptorSetLayout, video::IGPURenderpass* renderpass, uint32_t subpassIx, video::IGPUPipelineCache* pipelineCache = nullptr, nbl::core::smart_refctd_ptr<typename MDI::COMPOSE_T> _streamingMDIBuffer = nullptr);
UI(S_CREATION_PARAMETERS&& params);
~UI() override;

//! Nabla ImGUI backend reserves this index for font atlas, any attempt to hook user defined texture within the index will cause runtime error [TODO: could have a setter & getter to control the default & currently hooked font texture ID and init 0u by default]
_NBL_STATIC_INLINE_CONSTEXPR auto NBL_FONT_ATLAS_TEX_ID = 0u;

//! update ImGuiIO & record ImGUI *cpu* draw command lists, call it before .render
bool update(const S_UPDATE_PARAMETERS params);
bool update(const S_UPDATE_PARAMETERS& params);

//! updates mapped mdi buffer & records *gpu* draw commands, handles overflows for mdi allocation failure cases (pop & submit)
bool render(nbl::video::SIntendedSubmitInfo& info, const nbl::video::IGPUDescriptorSet* const descriptorSet);
bool render(nbl::video::SIntendedSubmitInfo& info, const nbl::video::IGPUDescriptorSet* const descriptorSet, const std::span<const VkRect2D> scissors = {});

//! registers lambda listener in which ImGUI calls should be recorded
size_t registerListener(std::function<void()> const& listener);
Expand All @@ -72,17 +83,13 @@ class UI final : public core::IReferenceCounted
//! ImGUI context getter, you are supposed to cast it, eg. reinterpret_cast<ImGuiContext*>(this->getContext());
void* getContext();
private:
void createSystem();
void createPipeline(core::smart_refctd_ptr<video::IGPUDescriptorSetLayout> descriptorSetLayout, video::IGPURenderpass* renderpass, uint32_t subpassIx, video::IGPUPipelineCache* pipelineCache);
void createMDIBuffer(nbl::core::smart_refctd_ptr<typename MDI::COMPOSE_T> _streamingMDIBuffer);
video::ISemaphore::future_t<video::IQueue::RESULT> createFontAtlasTexture(video::IGPUCommandBuffer* cmdBuffer, video::IQueue* queue);
void handleMouseEvents(const core::SRange<const nbl::ui::SMouseEvent>& events, nbl::hlsl::float32_t2 mousePosition) const;
void handleKeyEvents(const core::SRange<const nbl::ui::SKeyboardEvent>& events) const;

core::smart_refctd_ptr<system::ISystem> system;
core::smart_refctd_ptr<system::ILogger> logger;
core::smart_refctd_ptr<video::IUtilities> utilities;
core::smart_refctd_ptr<video::ILogicalDevice> m_device;
void createPipeline();
void createMDIBuffer();
void handleMouseEvents(const S_UPDATE_PARAMETERS& params) const;
void handleKeyEvents(const S_UPDATE_PARAMETERS& params) const;
video::ISemaphore::future_t<video::IQueue::RESULT> createFontAtlasTexture(video::IGPUCommandBuffer* cmdBuffer);

S_CREATION_PARAMETERS m_creationParams;

core::smart_refctd_ptr<video::IGPUGraphicsPipeline> pipeline;
core::smart_refctd_ptr<video::IGPUImageView> m_fontAtlasTexture;
Expand Down
3 changes: 3 additions & 0 deletions include/nbl/video/utilities/IUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ class NBL_API2 IUtilities : public core::IReferenceCounted
//!
inline ILogicalDevice* getLogicalDevice() const { return m_device.get(); }

//!
inline system::ILogger* getLogger() const { return m_logger.getRaw(); }

//!
inline StreamingTransientDataBufferMT<>* getDefaultUpStreamingBuffer()
{
Expand Down
Loading