Skip to content

Commit 0c13db5

Browse files
author
devsh
committed
we'll do Normal Quantization and cache load/store in another example
1 parent 0cbb83e commit 0c13db5

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

12_MeshLoaders/main.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
#include "../3rdparty/portable-file-dialogs/portable-file-dialogs.h"
77

8+
#ifdef _NBL_COMPILE_WITH_MITSUBA_SERIALIZED_LOADER_
9+
#include "nbl/ext/MitsubaLoader/CSerializedLoader.h"
10+
#endif
811

912
class MeshLoadersApp final : public MonoWindowApplication, public BuiltinResourcesApplication
1013
{
@@ -20,6 +23,9 @@ class MeshLoadersApp final : public MonoWindowApplication, public BuiltinResourc
2023
{
2124
if (!asset_base_t::onAppInitialized(smart_refctd_ptr(system)))
2225
return false;
26+
#ifdef _NBL_COMPILE_WITH_MITSUBA_SERIALIZED_LOADER_
27+
m_assetMgr->addAssetLoader(make_smart_refctd_ptr<ext::MitsubaLoader::CSerializedLoader>());
28+
#endif
2329
if (!device_base_t::onAppInitialized(smart_refctd_ptr(system)))
2430
return false;
2531

@@ -36,9 +42,6 @@ class MeshLoadersApp final : public MonoWindowApplication, public BuiltinResourc
3642
return logFail("Couldn't create Command Buffer!");
3743
}
3844

39-
//! cache results -- speeds up mesh generation on second run
40-
m_qnc = make_smart_refctd_ptr<CQuantNormalCache>();
41-
m_qnc->loadCacheFromFile<EF_R8G8B8_SNORM>(m_system.get(),sharedOutputCWD/"../../tmp/normalCache888.sse");
4245

4346
auto scRes = static_cast<CDefaultSwapchainFramebuffers*>(m_surface->getSwapchainResources());
4447
m_renderer = CSimpleDebugRenderer::create(m_assetMgr.get(),scRes->getRenderpass(),0,{});
@@ -246,7 +249,6 @@ class MeshLoadersApp final : public MonoWindowApplication, public BuiltinResourc
246249
//! load the geometry
247250
IAssetLoader::SAssetLoadParams params = {};
248251
params.logger = m_logger.get();
249-
params.meshManipulatorOverride = nullptr; // TODO
250252
auto bundle = m_assetMgr->getAsset(m_modelPath,params);
251253
if (bundle.getContents().empty())
252254
return false;
@@ -266,9 +268,6 @@ class MeshLoadersApp final : public MonoWindowApplication, public BuiltinResourc
266268
}
267269
if (geometries.empty())
268270
return false;
269-
270-
//! cache results -- speeds up mesh generation on second run
271-
m_qnc->saveCacheToFile<EF_R8G8B8_SNORM>(m_system.get(),sharedOutputCWD/"../../tmp/normalCache888.sse");
272271

273272
auto bound = hlsl::shapes::AABB<3,double>::create();
274273
// convert the geometries
@@ -395,7 +394,6 @@ class MeshLoadersApp final : public MonoWindowApplication, public BuiltinResourc
395394
// Maximum frames which can be simultaneously submitted, used to cycle through our per-frame resources like command buffers
396395
constexpr static inline uint32_t MaxFramesInFlight = 3u;
397396
//
398-
smart_refctd_ptr<CQuantNormalCache> m_qnc;
399397
smart_refctd_ptr<CSimpleDebugRenderer> m_renderer;
400398
//
401399
smart_refctd_ptr<ISemaphore> m_semaphore;

0 commit comments

Comments
 (0)