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 9 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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,6 @@
[submodule "3rdparty/imguizmo"]
path = 3rdparty/imguizmo
url = [email protected]:Devsh-Graphics-Programming/ImGuizmo.git
[submodule "3rdparty/imgui_test_engine"]
path = 3rdparty/imgui_test_engine
url = [email protected]:ocornut/imgui_test_engine.git
19 changes: 12 additions & 7 deletions 3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -274,19 +274,24 @@ if(NBL_BUILD_IMGUI)
PUBLIC "imgui/backends"
)

# ImPlot
set(NBL_IMGUI_TEST_ENGINE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/imgui_test_engine/imgui_test_suite")
set(NBL_IMPLOT_ROOT "${NBL_IMGUI_TEST_ENGINE_ROOT}/thirdparty/implot")

add_library(implot STATIC
"implot/implot.h"
"implot/implot_internal.h"
"implot/implot.cpp"
"implot/implot_items.cpp"
"${NBL_IMPLOT_ROOT}/implot.h"
"${NBL_IMPLOT_ROOT}/implot_internal.h"
"${NBL_IMPLOT_ROOT}/implot.cpp"
"${NBL_IMPLOT_ROOT}/implot_items.cpp"
"${NBL_IMPLOT_ROOT}/implot_demo.cpp"
)

target_include_directories(implot
PUBLIC "imgui"
PUBLIC imgui
PUBLIC "${NBL_IMPLOT_ROOT}"
)
target_link_libraries(implot PUBLIC imgui)
target_compile_definitions(implot PUBLIC IMPLOT_DEBUG IMPLOT_DLL_EXPORT)
set_property(TARGET implot PROPERTY CXX_STANDARD 11)
set_property(TARGET implot PROPERTY CXX_STANDARD 20)
if(MSVC)
target_compile_options(implot PRIVATE /MT /W4 /WX /arch:AVX2 /fp:fast /permissive-)
else()
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/imgui
Submodule imgui updated 114 files
1 change: 1 addition & 0 deletions 3rdparty/imgui_test_engine
Submodule imgui_test_engine added at 60b295
2 changes: 1 addition & 1 deletion examples_tests
Submodule examples_tests updated 1 files
+3 −14 61_UI/main.cpp
11 changes: 11 additions & 0 deletions include/nbl/builtin/hlsl/glsl_compat/core.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,23 @@ enable_if_t<is_spirv_type_v<Ptr_T>, T> atomicCompSwap(Ptr_T ptr, T value)
/**
* GLSL extended math
*/

// COMMENTING OUT BECAUSE OF https://github.com/microsoft/DirectXShaderCompiler/issues/6751, bring back when fixed!
/*
Copy link
Member Author

Choose a reason for hiding this comment

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

issue is now resolved, see the issue for new syntax for extended instruction sets



template<typename SquareMatrix> // NBL_REQUIRES() extents are square
SquareMatrix inverse(NBL_CONST_REF_ARG(SquareMatrix) mat)
{
return spirv::matrixInverse(mat);
}

float32_t2 unpackSnorm2x16(uint32_t p)
{
return spirv::unpackSnorm2x16(p);
}

*/

/**
* For Vertex Shaders
Expand Down
9 changes: 9 additions & 0 deletions include/nbl/builtin/hlsl/spirv_intrinsics/core.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,19 @@ template<typename T, typename P, uint32_t alignment >
enable_if_t<is_spirv_type_v<P>, void> store(P pointer, T obj, [[vk::ext_literal]] uint32_t __aligned = /*Aligned*/0x00000002, [[vk::ext_literal]] uint32_t __alignment = alignment);

//! Std 450 Extended set operations

// COMMENTING OUT BECAUSE OF https://github.com/microsoft/DirectXShaderCompiler/issues/6751, bring back when fixed!
/*

template<typename SquareMatrix>
[[vk::ext_instruction(GLSLstd450MatrixInverse)]]
SquareMatrix matrixInverse(NBL_CONST_REF_ARG(SquareMatrix) mat);

[[vk::ext_instruction(GLSLstd450UnpackSnorm2x16)]]
float32_t2 unpackSnorm2x16(uint32_t p);

*/
devshgraphicsprogramming marked this conversation as resolved.
Show resolved Hide resolved

// Memory Semantics link here: https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#Memory_Semantics_-id-

// https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#_memory_semantics_id
Expand Down
61 changes: 20 additions & 41 deletions include/nbl/ext/ImGui/ImGui.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,68 +3,47 @@

namespace nbl::ext::imgui
{

class UI final : public core::IReferenceCounted
{
public:
UI(core::smart_refctd_ptr<video::ILogicalDevice> device, int maxFramesInFlight, video::IGPURenderpass* renderpass, video::IGPUPipelineCache* pipelineCache, core::smart_refctd_ptr<ui::IWindow> window);
UI(core::smart_refctd_ptr<video::ILogicalDevice> device, uint32_t _maxFramesInFlight, video::IGPURenderpass* renderpass, video::IGPUPipelineCache* pipelineCache, core::smart_refctd_ptr<ui::IWindow> window);
~UI() override;

bool Render(nbl::video::IGPUCommandBuffer* commandBuffer, int frameIndex);
void Update(float deltaTimeInSec, float mousePosX, float mousePosY, size_t mouseEventsCount, ui::SMouseEvent const * mouseEvents); // TODO: Keyboard events
void BeginWindow(char const* windowName);
void EndWindow();
int Register(std::function<void()> const& listener);
bool UnRegister(int listenerId);
void SetNextItemWidth(float nextItemWidth);
void SetWindowSize(float width, float height);
void Text(char const* label, ...);
void InputFloat(char const* label, float* value);
void InputFloat2(char const* label, float* value);
void InputFloat3(char const* label, float* value);
void InputFloat4(char const* label, float* value);
void InputFloat3(char const* label, nbl::core::vector3df& value);
bool Combo(char const* label, int32_t* selectedItemIndex, char const** items, int32_t itemsCount);
bool Combo(const char* label, int* selectedItemIndex, std::vector<std::string>& values);
void SliderInt(char const* label, int* value, int minValue, int maxValue);
void SliderFloat(char const* label, float* value, float minValue, float maxValue);
void Checkbox(char const* label, bool* value);
void Spacing();
void Button(char const* label, std::function<void()> const& onPress);
void InputText(char const* label, std::string& outValue);
[[nodiscard]] bool HasFocus();
[[nodiscard]] bool IsItemActive();
[[nodiscard]] bool TreeNode(char const* name);
void TreePop();
bool render(nbl::video::IGPUCommandBuffer* commandBuffer, const uint32_t frameIndex);
void update(float deltaTimeInSec, float mousePosX, float mousePosY, size_t mouseEventsCount, ui::SMouseEvent const * mouseEvents); // TODO: Keyboard events
int registerListener(std::function<void()> const& listener);
bool unregisterListener(int listenerId);

void* getContext();
void setContext(void* imguiContext);

private:

core::smart_refctd_ptr<video::IGPUDescriptorSetLayout> CreateDescriptorSetLayout();

void CreatePipeline(video::IGPURenderpass* renderpass, video::IGPUPipelineCache* pipelineCache);
void CreateFontTexture(video::IGPUCommandBuffer* cmdBuffer, video::IQueue* queue);
void UpdateDescriptorSets();
core::smart_refctd_ptr<video::IGPUDescriptorSetLayout> createDescriptorSetLayout();
void createPipeline(video::IGPURenderpass* renderpass, video::IGPUPipelineCache* pipelineCache);
void createFontTexture(video::IGPUCommandBuffer* cmdBuffer, video::IQueue* queue);
void updateDescriptorSets();
void createSystem();
void CreateFontSampler();
void CreateDescriptorPool();
void HandleMouseEvents(float mousePosX, float mousePosY, size_t mouseEventsCount, ui::SMouseEvent const * mouseEvents) const;
void createFontSampler();
void createDescriptorPool();
void handleMouseEvents(float mousePosX, float mousePosY, size_t mouseEventsCount, ui::SMouseEvent const * mouseEvents) 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;
core::smart_refctd_ptr<video::IGPUSampler> m_fontSampler;
core::smart_refctd_ptr<video::IDescriptorPool> m_descriptorPool;
core::smart_refctd_ptr<video::IGPUDescriptorSet> m_gpuDescriptorSet;
Copy link
Member Author

Choose a reason for hiding this comment

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

these are super weird to belong to ImGUI

Copy link
Member

Choose a reason for hiding this comment

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

resolved


core::smart_refctd_ptr<video::IGPUGraphicsPipeline> pipeline;
core::smart_refctd_ptr<video::IGPUImageView> m_fontTexture;
core::smart_refctd_ptr<ui::IWindow> m_window;
std::vector<core::smart_refctd_ptr<video::IGPUBuffer>> m_vertexBuffers, m_indexBuffers;
bool hasFocus = false;
std::vector<core::smart_refctd_ptr<video::IGPUBuffer>> m_mdiBuffers;
const uint32_t maxFramesInFlight;

// TODO: Use a signal class instead like Signal<> UIRecordSignal{};
struct Subscriber {
struct Subscriber
{
int id = -1;
std::function<void()> listener = nullptr;
};
Expand Down
Loading