Skip to content

Commit 57827ad

Browse files
authored
Merge branch 'Devsh-Graphics-Programming:master' into hlsl
2 parents 4eb0cbe + 57a69bd commit 57827ad

File tree

13 files changed

+71
-16
lines changed

13 files changed

+71
-16
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,6 @@
8787
[submodule "3rdparty/imgui"]
8888
path = 3rdparty/imgui
8989
url = git@github.com:ocornut/imgui.git
90+
[submodule "3rdparty/implot"]
91+
path = 3rdparty/implot
92+
url = git@github.com:epezent/implot.git

3rdparty/CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,24 @@ if(NBL_BUILD_IMGUI)
250250
PUBLIC "imgui/backends"
251251
)
252252

253+
# ImPlot
254+
add_library(implot STATIC
255+
"implot/implot.h"
256+
"implot/implot_internal.h"
257+
"implot/implot.cpp"
258+
"implot/implot_items.cpp"
259+
)
260+
target_include_directories(implot
261+
PUBLIC "imgui"
262+
)
263+
target_link_libraries(implot PUBLIC imgui)
264+
target_compile_definitions(implot PUBLIC IMPLOT_DEBUG IMPLOT_DLL_EXPORT)
265+
set_property(TARGET implot PROPERTY CXX_STANDARD 11)
266+
if(MSVC)
267+
target_compile_options(implot PRIVATE /MT /W4 /WX /arch:AVX2 /fp:fast /permissive-)
268+
else()
269+
target_compile_options(implot PRIVATE -Wall -Wextra -pedantic -Werror -mavx2 -Ofast)
270+
endif()
253271
endif()
254272

255273
add_library(aesGladman OBJECT

3rdparty/implot

Submodule implot added at 18758e2

cmake/common.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,11 @@ macro(nbl_create_ext_library_project EXT_NAME LIB_HEADERS LIB_SOURCES LIB_INCLUD
238238
target_link_libraries(${LIB_NAME} PUBLIC Nabla)
239239
target_compile_options(${LIB_NAME} PUBLIC ${LIB_OPTIONS})
240240
target_compile_definitions(${LIB_NAME} PUBLIC ${DEF_OPTIONS})
241-
set_target_properties(${LIB_NAME} PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
241+
if(NBL_DYNAMIC_MSVC_RUNTIME)
242+
set_target_properties(${LIB_NAME} PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
243+
else()
244+
set_target_properties(${LIB_NAME} PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
245+
endif()
242246

243247
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
244248
add_compile_options(

include/nbl/ext/ImGui/ImGui.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#ifndef NBL_EXT_IMGUI_UI_H
22
#define NBL_EXT_IMGUI_UI_H
33

4-
#include <glm/vec3.hpp>
54

65
namespace nbl::ext::imgui
76
{
8-
class NBL_API2 UI final : public core::IReferenceCounted{
7+
class UI final : public core::IReferenceCounted{
98
public:
109

11-
explicit UI(
10+
UI(
1211
core::smart_refctd_ptr<video::ILogicalDevice> device,
1312
int maxFramesInFlight,
1413
core::smart_refctd_ptr<video::IGPURenderpass>& renderPass,
@@ -52,7 +51,7 @@ namespace nbl::ext::imgui
5251

5352
void InputFloat4(char const* label, float* value);
5453

55-
void InputFloat3(char const* label, glm::vec3& value);
54+
void InputFloat3(char const* label, nbl::core::vector3df& value);
5655

5756
bool Combo(
5857
char const* label,

include/nbl/system/CFileArchive.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class CInnerArchiveFile : public CFileView<T>
6868

6969

7070
//!
71-
class CFileArchive : public IFileArchive
71+
class NBL_API2 CFileArchive : public IFileArchive
7272
{
7373
static inline constexpr size_t SIZEOF_INNER_ARCHIVE_FILE = std::max(sizeof(CInnerArchiveFile<CPlainHeapAllocator>), sizeof(CInnerArchiveFile<VirtualMemoryAllocator>));
7474
static inline constexpr size_t ALIGNOF_INNER_ARCHIVE_FILE = std::max(alignof(CInnerArchiveFile<CPlainHeapAllocator>), alignof(CInnerArchiveFile<VirtualMemoryAllocator>));

include/nbl/system/atomic_state.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define _NBL_SYSTEM_ATOMIC_STATE_H_INCLUDED_
33

44
#include <atomic>
5+
#include "assert.h"
56

67
namespace nbl::system
78
{

src/nbl/builtin/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,6 @@ LIST_BUILTIN_RESOURCE(NBL_RESOURCES_TO_EMBED "nbl/builtin/hlsl/scanning_append.h
275275
LIST_BUILTIN_RESOURCE(NBL_RESOURCES_TO_EMBED "nbl/builtin/hlsl/shared_memory_accessor.hlsl")
276276

277277
macro(NBL_ADD_BUILTIN_RESOURCES _TARGET_) # internal & Nabla only, must be added with the macro to properly propagate scope
278-
ADD_CUSTOM_BUILTIN_RESOURCES("${_TARGET_}" NBL_RESOURCES_TO_EMBED "${NBL_ROOT_PATH}/include" "nbl/builtin" "nbl::builtin" "${NBL_ROOT_PATH_BINARY}/include" "${NBL_ROOT_PATH_BINARY}/src")
278+
ADD_CUSTOM_BUILTIN_RESOURCES("${_TARGET_}" NBL_RESOURCES_TO_EMBED "${NBL_ROOT_PATH}/include" "nbl/builtin" "nbl::builtin" "${NBL_ROOT_PATH_BINARY}/include" "${NBL_ROOT_PATH_BINARY}/src" "STATIC" "INTERNAL")
279279
endmacro()
280280

src/nbl/builtin/builtinHeaderGen.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@
2828

2929
outp.write("#ifndef _" + guardSuffix + "_BUILTINRESOURCEDATA_H_\n")
3030
outp.write("#define _" + guardSuffix + "_BUILTINRESOURCEDATA_H_\n")
31+
32+
outp.write("#ifdef __INTELLISENSE__\n")
33+
outp.write("#include <codeanalysis\warnings.h>\n")
34+
outp.write("#pragma warning( push )\n")
35+
outp.write("#pragma warning ( disable : ALL_CODE_ANALYSIS_WARNINGS )\n")
36+
outp.write("#endif // __INTELLISENSE__\n")
37+
3138
outp.write("#include <stdlib.h>\n")
3239
outp.write("#include <cstdint>\n")
3340
outp.write("#include <string>\n")
@@ -76,7 +83,12 @@
7683
else:
7784
outp.write('\n\t\ttemplate<> const std::pair<const uint8_t*, size_t> get_resource<NBL_CORE_UNIQUE_STRING_LITERAL_TYPE("%s")>();' % itemData[i].rstrip())
7885

79-
outp.write("\n\t}")
80-
outp.write("\n#endif // _" + guardSuffix + "_BUILTINRESOURCEDATA_H_")
86+
outp.write("\n\t}\n")
87+
88+
outp.write("#ifdef __INTELLISENSE__\n")
89+
outp.write("#pragma warning( pop )\n")
90+
outp.write("#endif // __INTELLISENSE__\n")
91+
92+
outp.write("#endif // _" + guardSuffix + "_BUILTINRESOURCEDATA_H_")
8193

8294
outp.close()

0 commit comments

Comments
 (0)