Skip to content

Commit 80c842c

Browse files
committed
Merge branch 'master' into minor_adjustments_to_bxdf_and_path_tracing_stuff
2 parents 3354e6a + 29fdaa1 commit 80c842c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3589
-4625
lines changed

.github/workflows/build-nabla.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,12 @@ jobs:
146146
github-token: ${{ secrets.GITHUB_TOKEN }}
147147
result-encoding: string
148148
script: |
149+
const headSha = context.payload.pull_request ? context.payload.pull_request.head.sha : context.sha;
149150
const response = await github.rest.checks.create({
150151
owner: context.repo.owner,
151152
repo: context.repo.repo,
152153
name: `Examples (${{ matrix.os }}, ${{ matrix.vendor }}-${{ matrix.tag }}, ${{ matrix.config }})`,
153-
head_sha: context.sha,
154+
head_sha: headSha,
154155
status: 'in_progress'
155156
});
156157
return response.data.id;

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ option(NBL_BUILD_DPL "Enable DPL (Dynamic Parallelism Library)" OFF)
173173
option(NBL_PCH "Enable pre-compiled header" ON)
174174
option(NBL_FAST_MATH "Enable fast low-precision math" OFF) # the reason OFF is by default now is the var controling it at build time was set AFTER BuildConfigOptions was generated - resulting in the feature being always OFF regardless the value xD - so just for sanity, keeping the same behaviour by default
175175
option(NBL_BUILD_EXAMPLES "Enable building examples" ON)
176-
option(NBL_BUILD_MITSUBA_LOADER "Enable nbl::ext::MitsubaLoader?" OFF) # TODO: once it compies turn this ON by default!
176+
option(NBL_BUILD_MITSUBA_LOADER "Enable nbl::ext::MitsubaLoader?" ON)
177177
option(NBL_BUILD_IMGUI "Enable nbl::ext::ImGui?" ON)
178178
option(NBL_BUILD_DEBUG_DRAW "Enable Nabla Debug Draw extension?" ON)
179179

CMakePresets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"NBL_UPDATE_GIT_SUBMODULE": "OFF",
1616
"NBL_COMPILE_WITH_CUDA": "OFF",
1717
"NBL_BUILD_OPTIX": "OFF",
18-
"NBL_BUILD_MITSUBA_LOADER": "OFF",
18+
"NBL_BUILD_MITSUBA_LOADER": "ON",
1919
"NBL_BUILD_RADEON_RAYS": "OFF",
2020
"_NBL_COMPILE_WITH_OPEN_EXR_": "ON",
2121
"NBL_EXPLICIT_MODULE_LOAD_LOG": "ON",

cmake/common.cmake

Lines changed: 35 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -350,13 +350,6 @@ function(nbl_install_media _FILE)
350350
nbl_install_lib_spec("${_FILE}" "")
351351
endfunction()
352352

353-
function(nbl_install_builtin_resources _TARGET_)
354-
get_target_property(_BUILTIN_RESOURCES_INCLUDE_SEARCH_DIRECTORY_ ${_TARGET_} BUILTIN_RESOURCES_INCLUDE_SEARCH_DIRECTORY)
355-
get_target_property(_BUILTIN_RESOURCES_HEADERS_ ${_TARGET_} BUILTIN_RESOURCES_HEADERS)
356-
357-
nbl_install_headers_spec("${_BUILTIN_RESOURCES_HEADERS_}" "${_BUILTIN_RESOURCES_INCLUDE_SEARCH_DIRECTORY_}")
358-
endfunction()
359-
360353
function(NBL_TEST_MODULE_INSTALL_FILE _NBL_FILEPATH_)
361354
file(RELATIVE_PATH _NBL_REL_INSTALL_DEST_ "${NBL_ROOT_PATH}" "${_NBL_FILEPATH_}")
362355
cmake_path(GET _NBL_REL_INSTALL_DEST_ PARENT_PATH _NBL_REL_INSTALL_DEST_)
@@ -1484,42 +1477,41 @@ namespace @IMPL_NAMESPACE@ {
14841477
file(WRITE "${CONFIG_FILE}" "${CONFIG_CONTENT}")
14851478

14861479
# generate keys and commands for compiling shaders
1487-
foreach(BUILD_CONFIGURATION ${CMAKE_CONFIGURATION_TYPES})
1488-
set(FINAL_KEY_REL_PATH "${BUILD_CONFIGURATION}/${FINAL_KEY}")
1489-
set(TARGET_OUTPUT "${IMPL_BINARY_DIR}/${FINAL_KEY_REL_PATH}")
1490-
1491-
set(NBL_NSC_COMPILE_COMMAND
1492-
"$<TARGET_FILE:nsc>"
1493-
-Fc "${TARGET_OUTPUT}"
1494-
${COMPILE_OPTIONS} ${REQUIRED_OPTIONS} ${IMPL_COMMON_OPTIONS}
1495-
"${CONFIG_FILE}"
1496-
)
1497-
1498-
add_custom_command(OUTPUT "${TARGET_OUTPUT}"
1499-
COMMAND ${NBL_NSC_COMPILE_COMMAND}
1500-
DEPENDS ${DEPENDS_ON}
1501-
COMMENT "Creating \"${TARGET_OUTPUT}\""
1502-
VERBATIM
1503-
COMMAND_EXPAND_LISTS
1504-
)
1505-
1506-
set(HEADER_ONLY_LIKE "${CONFIG_FILE}" "${TARGET_INPUT}" "${TARGET_OUTPUT}")
1507-
target_sources(${IMPL_TARGET} PRIVATE ${HEADER_ONLY_LIKE})
1508-
1509-
set_source_files_properties(${HEADER_ONLY_LIKE} PROPERTIES
1510-
HEADER_FILE_ONLY ON
1511-
VS_TOOL_OVERRIDE None
1512-
)
1513-
1514-
set_source_files_properties("${TARGET_OUTPUT}" PROPERTIES
1515-
NBL_SPIRV_REGISTERED_INPUT "${TARGET_INPUT}"
1516-
NBL_SPIRV_PERMUTATION_CONFIG "${CONFIG_FILE}"
1517-
NBL_SPIRV_BINARY_DIR "${IMPL_BINARY_DIR}"
1518-
NBL_SPIRV_ACCESS_KEY "${FINAL_KEY_REL_PATH}"
1519-
)
1520-
1521-
set_property(TARGET ${IMPL_TARGET} APPEND PROPERTY NBL_SPIRV_OUTPUTS "${TARGET_OUTPUT}")
1522-
endforeach()
1480+
set(FINAL_KEY_REL_PATH "$<CONFIG>/${FINAL_KEY}")
1481+
set(TARGET_OUTPUT "${IMPL_BINARY_DIR}/${FINAL_KEY_REL_PATH}")
1482+
1483+
set(NBL_NSC_COMPILE_COMMAND
1484+
"$<TARGET_FILE:nsc>"
1485+
-Fc "${TARGET_OUTPUT}"
1486+
${COMPILE_OPTIONS} ${REQUIRED_OPTIONS} ${IMPL_COMMON_OPTIONS}
1487+
"${CONFIG_FILE}"
1488+
)
1489+
1490+
add_custom_command(OUTPUT "${TARGET_OUTPUT}"
1491+
COMMAND ${NBL_NSC_COMPILE_COMMAND}
1492+
DEPENDS ${DEPENDS_ON}
1493+
COMMENT "Creating \"${TARGET_OUTPUT}\""
1494+
VERBATIM
1495+
COMMAND_EXPAND_LISTS
1496+
)
1497+
set_source_files_properties("${TARGET_OUTPUT}" PROPERTIES GENERATED TRUE)
1498+
1499+
set(HEADER_ONLY_LIKE "${CONFIG_FILE}" "${TARGET_INPUT}" "${TARGET_OUTPUT}")
1500+
target_sources(${IMPL_TARGET} PRIVATE ${HEADER_ONLY_LIKE})
1501+
1502+
set_source_files_properties(${HEADER_ONLY_LIKE} PROPERTIES
1503+
HEADER_FILE_ONLY ON
1504+
VS_TOOL_OVERRIDE None
1505+
)
1506+
1507+
set_source_files_properties("${TARGET_OUTPUT}" PROPERTIES
1508+
NBL_SPIRV_REGISTERED_INPUT "${TARGET_INPUT}"
1509+
NBL_SPIRV_PERMUTATION_CONFIG "${CONFIG_FILE}"
1510+
NBL_SPIRV_BINARY_DIR "${IMPL_BINARY_DIR}"
1511+
NBL_SPIRV_ACCESS_KEY "${FINAL_KEY_REL_PATH}"
1512+
)
1513+
1514+
set_property(TARGET ${IMPL_TARGET} APPEND PROPERTY NBL_SPIRV_OUTPUTS "${TARGET_OUTPUT}")
15231515
return()
15241516
endif()
15251517

include/nbl/asset/IAsset.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -156,24 +156,24 @@ class IAsset : virtual public core::IReferenceCounted
156156
//!
157157
inline bool isMutable() const {return m_mutable;}
158158

159-
inline void visitDependents(std::function<bool(const IAsset*)> visit) const
160-
{
161-
visitDependents_impl([&visit](const IAsset* dep)->bool
162-
{
163-
if (dep)
164-
return visit(dep);
165-
return true;
166-
});
167-
}
168-
169-
inline void visitDependents(std::function<bool(IAsset*)> visit)
170-
{
171-
assert(isMutable());
172-
visitDependents([&](const IAsset* dependent) -> bool
173-
{
174-
return visit(const_cast<IAsset*>(dependent));
175-
});
176-
}
159+
inline void visitDependents(std::function<bool(const IAsset*)> visit) const
160+
{
161+
visitDependents_impl([&visit](const IAsset* dep)->bool
162+
{
163+
if (dep)
164+
return visit(dep);
165+
return true;
166+
});
167+
}
168+
169+
inline void visitDependents(std::function<bool(IAsset*)> visit)
170+
{
171+
assert(isMutable());
172+
visitDependents([&](const IAsset* dependent) -> bool
173+
{
174+
return visit(const_cast<IAsset*>(dependent));
175+
});
176+
}
177177

178178
virtual bool valid() const = 0;
179179

include/nbl/asset/ICPUMorphTargets.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class NBL_API2 ICPUMorphTargets : public IAsset, public IMorphTargets<ICPUGeomet
2323
inline E_TYPE getAssetType() const override {return AssetType;}
2424

2525
//
26-
inline bool valid() const //override
26+
inline bool valid() const override
2727
{
2828
for (const auto& target : m_targets)
2929
if (!target || !target.geoCollection->valid())
@@ -55,7 +55,7 @@ class NBL_API2 ICPUMorphTargets : public IAsset, public IMorphTargets<ICPUGeomet
5555

5656
protected:
5757
//
58-
inline void visitDependents_impl(std::function<bool(const IAsset*)> visit) const //override
58+
inline void visitDependents_impl(std::function<bool(const IAsset*)> visit) const override
5959
{
6060
auto nonNullOnly = [&visit](const IAsset* dep)->bool
6161
{

include/nbl/asset/ICPUScene.h

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// Copyright (C) 2025-2025 - DevSH Graphics Programming Sp. z O.O.
2+
// This file is part of the "Nabla Engine".
3+
// For conditions of distribution and use, see copyright notice in nabla.h
4+
#ifndef _NBL_ASSET_I_CPU_SCENE_H_INCLUDED_
5+
#define _NBL_ASSET_I_CPU_SCENE_H_INCLUDED_
6+
7+
8+
#include "nbl/asset/IScene.h"
9+
// TODO: change to true IR later
10+
#include "nbl/asset/material_compiler3/CFrontendIR.h"
11+
12+
13+
namespace nbl::asset
14+
{
15+
//
16+
class NBL_API2 ICPUScene : public IAsset, public IScene
17+
{
18+
using base_t = IScene;
19+
20+
public:
21+
inline ICPUScene() = default;
22+
23+
constexpr static inline auto AssetType = ET_SCENE;
24+
inline E_TYPE getAssetType() const override { return AssetType; }
25+
26+
inline bool valid() const override
27+
{
28+
return true;
29+
}
30+
31+
inline core::smart_refctd_ptr<IAsset> clone(uint32_t _depth=~0u) const
32+
{
33+
const auto nextDepth = _depth ? (_depth-1):0;
34+
auto retval = core::smart_refctd_ptr<ICPUScene>();
35+
return retval;
36+
}
37+
38+
protected:
39+
//
40+
inline void visitDependents_impl(std::function<bool(const IAsset*)> visit) const override
41+
{
42+
}
43+
44+
45+
// suggested contents:
46+
// - morph target list
47+
// - material table
48+
// - instance list (morph target, keyframed transforms, material table indexings, FUTURE: reference skeleton)
49+
// - area light list (OBB decompositions, material table indexings)
50+
// - envlight data
51+
};
52+
}
53+
54+
#endif

include/nbl/asset/IScene.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright (C) 2025-2025 - DevSH Graphics Programming Sp. z O.O.
2+
// This file is part of the "Nabla Engine".
3+
// For conditions of distribution and use, see copyright notice in nabla.h
4+
#ifndef _NBL_ASSET_I_SCENE_H_INCLUDED_
5+
#define _NBL_ASSET_I_SCENE_H_INCLUDED_
6+
7+
8+
#include "nbl/asset/IMorphTargets.h"
9+
10+
11+
namespace nbl::asset
12+
{
13+
// This is incredibly temporary, lots of things are going to change
14+
class NBL_API2 IScene : public virtual core::IReferenceCounted
15+
{
16+
public:
17+
18+
protected:
19+
virtual ~IScene() = default;
20+
};
21+
}
22+
23+
#endif

include/nbl/asset/asset.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
#include "nbl/asset/interchange/IAssetLoader.h"
6262
#include "nbl/asset/interchange/IImageLoader.h"
6363
#include "nbl/asset/interchange/IGeometryLoader.h"
64+
#include "nbl/asset/interchange/ISceneLoader.h"
6465
#include "nbl/asset/interchange/IAssetWriter.h"
6566
#include "nbl/asset/interchange/IImageWriter.h"
6667
#include "nbl/asset/metadata/COpenEXRMetadata.h"

0 commit comments

Comments
 (0)