Skip to content

Commit 03fb95f

Browse files
author
devsh
committed
Merge branch 'master' of github.com:Devsh-Graphics-Programming/Nabla
2 parents 4375051 + a3827d6 commit 03fb95f

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/nbl/ext/ImGui/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ nbl_create_ext_library_project(
2424
target_link_libraries(${LIB_NAME} PUBLIC imtestengine)
2525

2626
# this should be standard for all extensions
27+
set(_ARCHIVE_ENTRY_KEY_ "ImGui/builtin/hlsl") # then each one has unique archive key
2728
get_filename_component(_ARCHIVE_ABSOLUTE_ENTRY_PATH_ "${NBL_EXT_INTERNAL_INCLUDE_DIR}/nbl/ext" ABSOLUTE)
2829
get_filename_component(_OUTPUT_DIRECTORY_SOURCE_ "${CMAKE_CURRENT_BINARY_DIR}/src" ABSOLUTE)
2930
get_filename_component(_OUTPUT_DIRECTORY_HEADER_ "${CMAKE_CURRENT_BINARY_DIR}/include" ABSOLUTE)
30-
set(_ARCHIVE_ENTRY_KEY_ "ImGui/builtin/hlsl") # then each one has unique archive key
3131

3232
target_compile_definitions(${LIB_NAME} PRIVATE _ARCHIVE_ABSOLUTE_ENTRY_PATH_="${_ARCHIVE_ABSOLUTE_ENTRY_PATH_}")
33+
target_compile_definitions(${LIB_NAME} PRIVATE _ARCHIVE_ENTRY_KEY_="${_ARCHIVE_ENTRY_KEY_}")
3334

3435
if(NBL_EMBED_BUILTIN_RESOURCES)
3536
# (*) -> I wish we could just take NSC, offline-precompile to SPIRV, embed into builtin resource library (as we did!) but then be smart & adjust at runtime OpDecorate of our resources according to wishes - unfortunately no linker yet we have and we are not going to make one ourselves so we compile imgui shaders at runtime

src/nbl/ext/ImGui/ImGui.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
#include "nbl/system/CStdoutLogger.h"
1010
#include "nbl/ext/ImGui/ImGui.h"
1111
#include "nbl/ext/ImGui/builtin/hlsl/common.hlsl"
12-
#include "nbl/ext/ImGui/builtin/builtinResources.h"
13-
#include "nbl/ext/ImGui/builtin/CArchive.h"
1412
#include "imgui/imgui.h"
1513
#include "imgui/misc/cpp/imgui_stdlib.h"
1614

15+
#ifdef NBL_EMBED_BUILTIN_RESOURCES
16+
#include "nbl/ext/ImGui/builtin/CArchive.h"
17+
#endif
18+
1719
using namespace nbl::video;
1820
using namespace nbl::core;
1921
using namespace nbl::asset;
@@ -113,7 +115,7 @@ smart_refctd_ptr<IGPUPipelineLayout> UI::createDefaultPipelineLayout(ILogicalDev
113115
}
114116

115117
// note we use archive entry explicitly for temporary compiler include search path & asset cwd to use keys directly
116-
constexpr std::string_view NBL_ARCHIVE_ENTRY = nbl::ext::imgui::builtin::pathPrefix;
118+
constexpr std::string_view NBL_ARCHIVE_ENTRY = _ARCHIVE_ENTRY_KEY_;
117119

118120
const smart_refctd_ptr<IFileArchive> UI::mount(smart_refctd_ptr<ILogger> logger, ISystem* system, const std::string_view archiveAlias)
119121
{
@@ -519,9 +521,7 @@ smart_refctd_ptr<IGPUImageView> UI::createFontAtlasTexture(const SCreationParame
519521
CAssetConverter::SConvertParams params = {};
520522
params.transfer = &transfer;
521523
params.utilities = creationParams.utilities.get();
522-
queue->startCapture();
523524
auto result = reservation.convert(params);
524-
queue->endCapture();
525525
// block immediately
526526
if (result.copy()!=IQueue::RESULT::SUCCESS)
527527
{

src/nbl/system/ISystem.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,8 @@ void ISystem::unmountBuiltins() {
344344
bool ISystem::areBuiltinsMounted() const
345345
{
346346
// TODO: we need to span our keys and reuse accross this cpp to not DRY
347-
for (const auto& it : { "nbl", "spirv", "boost" })
348-
if (m_cachedArchiveFiles.findRange(it).empty())
347+
for (const auto& it : { "nbl/builtin", "nbl/video", "spirv", "boost" })
348+
if (!isDirectory(path(it)))
349349
return false;
350350

351351
return true;

0 commit comments

Comments
 (0)