Skip to content

Mesh loaders #197

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

Open
wants to merge 44 commits into
base: master
Choose a base branch
from
Open

Mesh loaders #197

wants to merge 44 commits into from

Conversation

devshgraphicsprogramming
Copy link
Member

No description provided.

devsh and others added 18 commits May 27, 2025 10:51
…ek's help

Yes geometry creator scene default SPIR-V shaders are gone
… tmp trick

#include "nbl/examples/common/SimpleWindowedApplication.hpp"
#include "nbl/examples/common/InputSystem.hpp"
#include "nbl/examples/common/CEventCallback.hpp"
#include "nbl/examples/cameras/CCamera.hpp"
…ncluded in PCH now though the example doesn't compile anyway (misses imgui link and more)
Comment on lines +4 to +5
// TODO: @AnastaZIuk do we even make that explicit?
#include "nbl/examples/PCH.hpp"
Copy link
Member Author

Choose a reason for hiding this comment

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

examples/examples

Comment on lines -16 to +19
nbl_create_executable_project("${NBL_EXTRA_SOURCES}" "" "${NBL_INCLUDE_SERACH_DIRECTORIES}" "${NBL_LIBRARIES}" "${NBL_EXECUTABLE_PROJECT_CREATION_PCH_TARGET}")
LINK_BUILTIN_RESOURCES_TO_TARGET(${EXECUTABLE_NAME} geometryCreatorSpirvBRD)

# TODO; Arek I removed `NBL_EXECUTABLE_PROJECT_CREATION_PCH_TARGET` from the last parameter here, doesn't this macro have 4 arguments anyway !?
nbl_create_executable_project("${NBL_EXTRA_SOURCES}" "" "${NBL_INCLUDE_SERACH_DIRECTORIES}" "${NBL_LIBRARIES}")
# TODO: Arek temporarily disabled cause I haven't figured out how to make this target yet
# LINK_BUILTIN_RESOURCES_TO_TARGET(${EXECUTABLE_NAME} nblExamplesGeometrySpirvBRD)
Copy link
Member Author

Choose a reason for hiding this comment

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

touch up in #196

Comment on lines +5 to +8
nbl_create_executable_project("" "" "${NBL_INCLUDE_SERACH_DIRECTORIES}" "" "")
# TODO: Arek temporarily disabled cause I haven't figured out how to make this target yet
# LINK_BUILTIN_RESOURCES_TO_TARGET(${EXECUTABLE_NAME} nblExamplesGeometrySpirvBRD)
Copy link
Member Author

Choose a reason for hiding this comment

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

@AnastaZIuk touch up #196

@@ -1 +0,0 @@
add_subdirectory(creator EXCLUDE_FROM_ALL)
Copy link
Member Author

Choose a reason for hiding this comment

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

@AnastaZIuk use n4ce tool here

Comment on lines 1 to 7
# header only currently

#set(NBL_EXAMPLES_CAMERA_LIB_SOURCES
# "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
#)

#nbl_create_ext_library_project(ExampleCameras "" "${NBL_EXAMPLES_CAMERA_LIB_SOURCES}" "" "" "")
Copy link
Member Author

Choose a reason for hiding this comment

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

@AnastaZIuk write example code how to deal with this

I'd add sources to PARENT_SCOPE Common target not make new static libs, to avoid 1GB PCH per lib.

Comment on lines 48 to 60
struct ObjectDrawHookCpu
{
nbl::core::matrix3x4SIMD model;
ObjectMeta meta;
};

struct ReferenceObjectCpu
{
ObjectMeta meta;
core::smart_refctd_ptr<ICPUPolygonGeometry> data;
Material material;
core::matrix3x4SIMD transform;
};
Copy link
Member Author

Choose a reason for hiding this comment

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

that stuff is old and disgusting clean up a bit

devsh added 6 commits June 20, 2025 16:54
… the examples which are WIP on this branch
…les_tests w.r.t. the question of `MonoAssetManagerAndBuiltinResourceApplication.hpp`

There really isn't a usecase for:
- embedding Nabla resources but not embedding example (there's no harm in Nabla resources not being embedded)
- even more strangely, not embedding Nabla resources, but embedding example.
#include "../../common/include/WorkgroupDataAccessors.hlsl"
#include "nbl/examples/workgroup/DataAccessors.hlsl"
Copy link
Member Author

Choose a reason for hiding this comment

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

@AnastaZIuk I need help here, the NblExamples project also needs to have its own builtins thing for HLSL headers

Comment on lines +81 to +85
add_subdirectory(67_RayQueryGeometry EXCLUDE_FROM_ALL) # TODO: resurrect before `mesh_loaders` merge
add_subdirectory(68_JpegLoading)

add_subdirectory(70_FLIPFluids EXCLUDE_FROM_ALL)
add_subdirectory(71_RayTracingPipeline EXCLUDE_FROM_ALL)
add_subdirectory(70_FLIPFluids)
add_subdirectory(71_RayTracingPipeline EXCLUDE_FROM_ALL) # TODO: resurrect before `mesh_loaders` merge
Copy link
Member Author

Choose a reason for hiding this comment

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

@kevyuu in your PR with fixes for 67 and 71, you need to remove those EXCLUDE_FROM_ALL

Comment on lines +8 to +10
// TODO: Arek bring back
//#include "nbl/examples/geometry/spirv/builtin/CArchive.h"
//#include "nbl/examples/geometry/spirv/builtin/builtinResources.h"
Copy link
Member Author

Choose a reason for hiding this comment

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

there could just be one general builtin archive for nbl/examples

Comment on lines +100 to +102
const auto bundle = assMan->getAsset("nbl/examples/geometry/shaders/unified.hlsl",{});
// TODO: Arek
//const auto bundle = assMan->getAsset("nbl/examples/geometry/shaders/unified.spv",{});
Copy link
Member Author

Choose a reason for hiding this comment

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

@AnastaZIuk n4ce tool in 2 configs:

  • read spir-v from disk (build directory of example, but mounted)
  • read spir-v from builtin

but we always use nsc.exe to do a build step to produce the spirv

Comment on lines 62 to 64
// TODO: this is plain wrong Arek
m_system->mount(make_smart_refctd_ptr<system::CMountDirectoryArchive>(localInputCWD/"../common/include/nbl/examples",smart_refctd_ptr(m_logger),m_system.get()),"nbl/examples");
m_system->mount(make_smart_refctd_ptr<system::CMountDirectoryArchive>(localInputCWD/"../common/src/nbl/examples",smart_refctd_ptr(m_logger),m_system.get()),"nbl/examples");
Copy link
Member Author

Choose a reason for hiding this comment

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

@AnastaZIuk I think I'll handle this in MonoAssetManagerAndBuiltinResourceApplication

Copy link
Member Author

Choose a reason for hiding this comment

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

btw when embed resources is OFF, these should be mounted AND corresponding build dir which I guess will be just src/nbl/examples but somewhere in build dir (if there's for example SPIR-V being made with NSC from stuff in src/nbl/examples

Comment on lines +15 to +16
// TODO: make the `this_example` optional, only if the example has builtins
#include "nbl/this_example/builtin/CArchive.h"
Copy link
Member Author

Choose a reason for hiding this comment

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

@YasInvolved I think this can be done with __has_include https://en.cppreference.com/w/cpp/preprocessor/include

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants