Skip to content
Open
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
624184f
Reduce Wave preprocess overhead and update DXC pointer
AnastaZIuk Mar 22, 2026
555684d
Advance DXC to latest unroll-devshFixes
AnastaZIuk Mar 22, 2026
03ad12b
Restore default include search path for builtin HLSL
AnastaZIuk Mar 23, 2026
ac0289d
Advance DXC to latest unroll-devshFixes
AnastaZIuk Mar 23, 2026
8e3c301
Promote NSC channel ac0289dda98b1046000873b0b3ffedb06356be53 (#1028)
github-actions[bot] Mar 23, 2026
fe4a528
Update examples_tests to local unroll
AnastaZIuk Mar 23, 2026
441dcb2
Merge remote-tracking branch 'origin/master' into unroll-local-sync
AnastaZIuk Mar 23, 2026
f195565
Update EX31 examples pointer
AnastaZIuk Mar 23, 2026
697cfcf
Wire path tracer pipeline cache
AnastaZIuk Mar 23, 2026
fad9d56
Update path tracer examples pointer
AnastaZIuk Mar 23, 2026
a0b65da
Add SPIR-V trimmer fast path
AnastaZIuk Mar 23, 2026
9515bdd
Update path tracer examples pointer
AnastaZIuk Mar 23, 2026
939de4f
Update path tracer examples pointer
AnastaZIuk Mar 24, 2026
dd5180b
Update path tracer examples pointer
AnastaZIuk Mar 24, 2026
8d3e66d
Trim manifest whitespace and update examples pointer
AnastaZIuk Mar 24, 2026
cba6113
Clean up shader review leftovers
AnastaZIuk Mar 24, 2026
476a5bf
Update path tracer examples pointer
AnastaZIuk Mar 24, 2026
d986945
Cache validated SPIR-V hashes
AnastaZIuk Mar 24, 2026
5ecde9a
Update path tracer examples pointer
AnastaZIuk Mar 24, 2026
1ede3de
Tighten final shader cleanup
AnastaZIuk Mar 24, 2026
758f7c8
Update path tracer examples pointer
AnastaZIuk Mar 24, 2026
8745660
Update path tracer examples pointer
AnastaZIuk Mar 24, 2026
94a501f
Mark generated NSC headers correctly
AnastaZIuk Mar 24, 2026
b1f28c0
Update path tracer examples pointer
AnastaZIuk Mar 24, 2026
4b444b6
Revert "Mark generated NSC headers correctly"
AnastaZIuk Mar 24, 2026
f4b0aed
Update path tracer examples pointer
AnastaZIuk Mar 24, 2026
01794c5
Update path tracer examples pointer
AnastaZIuk Mar 24, 2026
4a0c2e2
Update path tracer examples pointer
AnastaZIuk Mar 24, 2026
02f04db
Update path tracer examples pointer
AnastaZIuk Mar 24, 2026
3ae2b26
Update path tracer examples pointer
AnastaZIuk Mar 24, 2026
fcae991
Update path tracer examples pointer
AnastaZIuk Mar 25, 2026
c8af81b
Update path tracer examples pointer
AnastaZIuk Mar 25, 2026
3541a9d
Update path tracer examples pointer
AnastaZIuk Mar 25, 2026
8723771
Validate SPIR-V once per blob
AnastaZIuk Mar 25, 2026
52ae40b
Update EX31 examples pointer
AnastaZIuk Mar 25, 2026
6476500
Update EX31 examples pointer
AnastaZIuk Mar 25, 2026
f5f036e
Update EX31 examples pointer
AnastaZIuk Mar 25, 2026
e545d37
Update EX31 examples pointer
AnastaZIuk Mar 25, 2026
5aa95f1
Address shader compiler review feedback locally
AnastaZIuk Mar 26, 2026
40e1e1e
Checkpoint local EX31 review state
AnastaZIuk Mar 26, 2026
daf1fe3
Add include session cache plumbing
AnastaZIuk Mar 26, 2026
9912390
Update EX31 examples pointer locally
AnastaZIuk Mar 26, 2026
a75f581
Update EX31 examples pointer locally
AnastaZIuk Mar 26, 2026
4aa78fd
Classify toolchain include roots
AnastaZIuk Mar 26, 2026
15b80eb
Split include session cache reads and writes
AnastaZIuk Mar 26, 2026
cfaac9c
Stop exporting generated keys header as source
AnastaZIuk Mar 26, 2026
3cf364b
Promote NSC channel cfaac9c36e0d169e44dc75d4a774703b3c94782d
github-actions[bot] Mar 26, 2026
8b1f77d
Merge pull request #1030 from Devsh-Graphics-Programming/ci/nsc-promo…
AnastaZIuk Mar 26, 2026
54153e6
Merge remote-tracking branch 'origin/master' into unroll-local-sync
AnastaZIuk Mar 26, 2026
6dc6485
Update examples_tests after master merge
AnastaZIuk Mar 26, 2026
262a8b7
Merge remote-tracking branch 'origin/master' into unroll-local-sync
AnastaZIuk Mar 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 3rdparty/dxc/dxc
Submodule dxc updated 353 files
11 changes: 6 additions & 5 deletions cmake/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1259,10 +1259,10 @@ struct DeviceConfigCaps
if(NOT NBL_EMBED_BUILTIN_RESOURCES)
list(APPEND REQUIRED_OPTIONS
-no-nbl-builtins
-I "${NBL_ROOT_PATH}/include"
-I "${NBL_ROOT_PATH}/3rdparty/dxc/dxc/external/SPIRV-Headers/include"
-I "${NBL_ROOT_PATH}/3rdparty/boost/superproject/libs/preprocessor/include"
-I "${NBL_ROOT_PATH_BINARY}/src/nbl/device/include"
-isystem "${NBL_ROOT_PATH}/include"
-isystem "${NBL_ROOT_PATH}/3rdparty/dxc/dxc/external/SPIRV-Headers/include"
-isystem "${NBL_ROOT_PATH}/3rdparty/boost/superproject/libs/preprocessor/include"
-isystem "${NBL_ROOT_PATH_BINARY}/src/nbl/device/include"
)
endif()

Expand Down Expand Up @@ -1307,7 +1307,8 @@ struct DeviceConfigCaps
)

target_sources(${IMPL_TARGET} PUBLIC ${INCLUDE_FILE})
set_source_files_properties(${INCLUDE_FILE} PROPERTIES
set_source_files_properties(${INCLUDE_FILE} PROPERTIES
GENERATED TRUE
HEADER_FILE_ONLY ON
VS_TOOL_OVERRIDE None
)
Expand Down
2 changes: 1 addition & 1 deletion examples_tests
Submodule examples_tests updated 38 files
+75 −22 31_HLSLPathTracer/CMakeLists.txt
+62 −0 31_HLSLPathTracer/app_resources/hlsl/compute.render.common.hlsl
+21 −0 31_HLSLPathTracer/app_resources/hlsl/compute.render.linear.entrypoints.hlsl
+21 −0 31_HLSLPathTracer/app_resources/hlsl/compute.render.persistent.entrypoints.hlsl
+158 −0 31_HLSLPathTracer/app_resources/hlsl/compute_render_scene_impl.hlsl
+9 −0 31_HLSLPathTracer/app_resources/hlsl/imgui.unified.hlsl
+30 −15 31_HLSLPathTracer/app_resources/hlsl/next_event_estimator.hlsl
+3 −4 31_HLSLPathTracer/app_resources/hlsl/present.frag.hlsl
+0 −222 31_HLSLPathTracer/app_resources/hlsl/render.comp.hlsl
+1 −0 31_HLSLPathTracer/app_resources/hlsl/render_rwmc_common.hlsl
+2 −1 31_HLSLPathTracer/app_resources/hlsl/resolve.comp.hlsl
+1 −2 31_HLSLPathTracer/app_resources/hlsl/resolve_common.hlsl
+8 −0 31_HLSLPathTracer/app_resources/hlsl/rwmc_common.hlsl
+10 −3 31_HLSLPathTracer/app_resources/hlsl/scene_base.hlsl
+1 −0 31_HLSLPathTracer/app_resources/hlsl/spirv/pt.compute.rectangle.proxy.hlsl
+1 −0 31_HLSLPathTracer/app_resources/hlsl/spirv/pt.compute.rectangle.rwmc.linear.proxy.hlsl
+1 −0 31_HLSLPathTracer/app_resources/hlsl/spirv/pt.compute.rectangle.rwmc.persistent.proxy.hlsl
+1 −0 31_HLSLPathTracer/app_resources/hlsl/spirv/pt.compute.sphere.proxy.hlsl
+1 −0 31_HLSLPathTracer/app_resources/hlsl/spirv/pt.compute.sphere.rwmc.proxy.hlsl
+1 −0 31_HLSLPathTracer/app_resources/hlsl/spirv/pt.compute.triangle.linear.proxy.hlsl
+71 −0 31_HLSLPathTracer/app_resources/hlsl/spirv/pt.compute.triangle.methods.shared.hlsl
+1 −0 31_HLSLPathTracer/app_resources/hlsl/spirv/pt.compute.triangle.persistent.proxy.hlsl
+1 −0 31_HLSLPathTracer/app_resources/hlsl/spirv/pt.compute.triangle.rwmc.linear.proxy.hlsl
+1 −0 31_HLSLPathTracer/app_resources/hlsl/spirv/pt.compute.triangle.rwmc.persistent.proxy.hlsl
+72 −0 31_HLSLPathTracer/app_resources/hlsl/spirv/pt.compute.variant.shared.hlsl
+5 −0 31_HLSLPathTracer/app_resources/hlsl/spirv/pt.misc.proxy.hlsl
+26 −0 31_HLSLPathTracer/include/nbl/this_example/path_tracer_pipeline_state.hpp
+137 −0 31_HLSLPathTracer/include/nbl/this_example/path_tracer_ui.hpp
+40 −0 31_HLSLPathTracer/include/nbl/this_example/render_variant_config.hlsl
+28 −0 31_HLSLPathTracer/include/nbl/this_example/render_variant_enums.hlsl
+46 −0 31_HLSLPathTracer/include/nbl/this_example/render_variant_info.hpp
+98 −0 31_HLSLPathTracer/include/nbl/this_example/render_variant_strings.hpp
+1,409 −300 31_HLSLPathTracer/main.cpp
+3 −0 31_HLSLPathTracer/path_tracer.runtime.json.in
+35 −0 31_HLSLPathTracer/pt.cmake
+6 −0 31_HLSLPathTracer/pt.variant_ids.cmake
+1 −1 50.IESViewer/CMakeLists.txt
+278 −0 common/include/nbl/examples/common/CachedPipelineState.hpp
8 changes: 7 additions & 1 deletion include/nbl/asset/utils/ISPIRVEntryPointTrimmer.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@

#include "nbl/system/ILogger.h"

#include <mutex>

namespace nbl::asset
{

class ISPIRVEntryPointTrimmer final : public core::IReferenceCounted
class NBL_API2 ISPIRVEntryPointTrimmer final : public core::IReferenceCounted
{
public:
ISPIRVEntryPointTrimmer();
Expand Down Expand Up @@ -46,6 +48,8 @@ class ISPIRVEntryPointTrimmer final : public core::IReferenceCounted
};

Result trim(const ICPUBuffer* spirvBuffer, const core::set<EntryPoint>& entryPoints, system::logger_opt_ptr logger = nullptr) const;
bool ensureValidated(const ICPUBuffer* spirvBuffer, system::logger_opt_ptr logger = nullptr) const;
void markValidated(const ICPUBuffer* spirvBuffer) const;

inline core::smart_refctd_ptr<const IShader> trim(const IShader* shader, const core::set<EntryPoint>& entryPoints, system::logger_opt_ptr logger = nullptr) const
{
Expand All @@ -72,6 +76,8 @@ class ISPIRVEntryPointTrimmer final : public core::IReferenceCounted

private:
core::smart_refctd_ptr<ISPIRVOptimizer> m_optimizer;
mutable std::mutex m_validationCacheMutex;
mutable core::unordered_set<core::blake3_hash_t> m_validatedSpirvHashes;
};

}
Expand Down
80 changes: 72 additions & 8 deletions include/nbl/asset/utils/IShaderCompiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include "nbl/builtin/hlsl/enums.hlsl"

#include <functional>
#include <mutex>
#include <unordered_set>

namespace nbl::asset
{
Expand All @@ -26,6 +28,25 @@ class NBL_API2 IShaderCompiler : public core::IReferenceCounted
public:
IShaderCompiler(core::smart_refctd_ptr<system::ISystem>&& system);

enum class IncludeRootOrigin : uint8_t
{
User,
Builtin,
Generated
};

enum class HeaderClass : uint8_t
{
User,
System
};

struct IncludeClassification
{
IncludeRootOrigin origin = IncludeRootOrigin::User;
HeaderClass headerClass = HeaderClass::User;
};

class NBL_API2 IIncludeLoader : public core::IReferenceCounted
{
public:
Expand All @@ -34,12 +55,13 @@ class NBL_API2 IShaderCompiler : public core::IReferenceCounted
system::path absolutePath = {};
std::string contents = {};
core::blake3_hash_t hash = {}; // TODO: we're not yet using IFile::getPrecomputedHash(), so for builtins we can maybe use that in the future
IncludeClassification classification = {};
// Could be used in the future for early rejection of cache hit
//nbl::system::IFileBase::time_point_t lastWriteTime = {};

explicit inline operator bool() const {return !absolutePath.empty();}
};
virtual found_t getInclude(const system::path& searchPath, const std::string& includeName) const = 0;
virtual found_t getInclude(const system::path& searchPath, const std::string& includeName, bool needHash = true) const = 0;
};

class NBL_API2 IIncludeGenerator : public core::IReferenceCounted
Expand All @@ -65,7 +87,7 @@ class NBL_API2 IShaderCompiler : public core::IReferenceCounted
public:
CFileSystemIncludeLoader(core::smart_refctd_ptr<system::ISystem>&& system);

IIncludeLoader::found_t getInclude(const system::path& searchPath, const std::string& includeName) const override;
IIncludeLoader::found_t getInclude(const system::path& searchPath, const std::string& includeName, bool needHash = true) const override;

protected:
core::smart_refctd_ptr<system::ISystem> m_system;
Expand All @@ -74,37 +96,77 @@ class NBL_API2 IShaderCompiler : public core::IReferenceCounted
class NBL_API2 CIncludeFinder : public core::IReferenceCounted
{
public:
struct SSessionCache
{
enum class LookupResult : uint8_t
{
Miss,
Missing,
Found
};

explicit SSessionCache(const bool threadSafe = false) : threadSafe(threadSafe) {}

void clear();
LookupResult lookup(const std::string& key, IIncludeLoader::found_t& result) const;
void store(const std::string& key, IIncludeLoader::found_t result);

bool threadSafe = false;

mutable std::mutex mutex;
core::unordered_map<std::string, IIncludeLoader::found_t> found;
core::unordered_set<std::string> missing;
};

CIncludeFinder(core::smart_refctd_ptr<system::ISystem>&& system);

// ! includes within <>
// @param requestingSourceDir: the directory where the incude was requested
// @param includeName: the string within <> of the include preprocessing directive
IIncludeLoader::found_t getIncludeStandard(const system::path& requestingSourceDir, const std::string& includeName) const;
IIncludeLoader::found_t getIncludeStandard(const system::path& requestingSourceDir, const std::string& includeName, bool needHash = true, SSessionCache* sessionCache = nullptr) const;

// ! includes within ""
// @param requestingSourceDir: the directory where the incude was requested
// @param includeName: the string within "" of the include preprocessing directive
IIncludeLoader::found_t getIncludeRelative(const system::path& requestingSourceDir, const std::string& includeName) const;
IIncludeLoader::found_t getIncludeRelative(const system::path& requestingSourceDir, const std::string& includeName, bool needHash = true, SSessionCache* sessionCache = nullptr) const;

inline core::smart_refctd_ptr<CFileSystemIncludeLoader> getDefaultFileSystemLoader() const { return m_defaultFileSystemLoader; }

void addSearchPath(const std::string& searchPath, const core::smart_refctd_ptr<IIncludeLoader>& loader);
void addSearchPath(const std::string& searchPath, const core::smart_refctd_ptr<IIncludeLoader>& loader, IncludeClassification classification = {});

void addGenerator(const core::smart_refctd_ptr<IIncludeGenerator>& generator, IncludeClassification classification = {IncludeRootOrigin::Generated,HeaderClass::System});

void addGenerator(const core::smart_refctd_ptr<IIncludeGenerator>& generator);
bool isKnownGlobalInclude(std::string_view includeName) const;
IIncludeLoader::found_t classifyFound(IIncludeLoader::found_t found) const;

protected:
IIncludeLoader::found_t trySearchPaths(const std::string& includeName) const;
IIncludeLoader::found_t trySearchPaths(const std::string& includeName, bool needHash) const;

IIncludeLoader::found_t tryIncludeGenerators(const std::string& includeName) const;
void registerHeaderRoot(std::string rootPath, IncludeClassification classification);

struct LoaderSearchPath
{
core::smart_refctd_ptr<IIncludeLoader> loader = nullptr;
std::string searchPath = {};
IncludeClassification classification = {};
};

struct GeneratorEntry
{
core::smart_refctd_ptr<IIncludeGenerator> generator = nullptr;
IncludeClassification classification = {IncludeRootOrigin::Generated,HeaderClass::System};
};

struct HeaderRoot
{
std::string path = {};
IncludeClassification classification = {};
};

std::vector<LoaderSearchPath> m_loaders;
std::vector<core::smart_refctd_ptr<IIncludeGenerator>> m_generators;
std::vector<GeneratorEntry> m_generators;
std::vector<HeaderRoot> m_headerRoots;
core::smart_refctd_ptr<CFileSystemIncludeLoader> m_defaultFileSystemLoader;
};

Expand Down Expand Up @@ -134,9 +196,11 @@ class NBL_API2 IShaderCompiler : public core::IReferenceCounted
std::string_view sourceIdentifier = "";
system::logger_opt_ptr logger = nullptr;
const CIncludeFinder* includeFinder = nullptr;
mutable CIncludeFinder::SSessionCache* includeSessionCache = nullptr;
std::span<const SMacroDefinition> extraDefines = {};
E_SPIRV_VERSION targetSpirvVersion = E_SPIRV_VERSION::ESV_1_6;
bool depfile = false;
bool preserveComments = false;
system::path depfilePath = {};
std::function<void(std::string_view)> onPartialOutputOnFailure = {};
};
Expand Down
2 changes: 0 additions & 2 deletions include/nbl/builtin/hlsl/bxdf/reflection/beckmann.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
#ifndef _NBL_BUILTIN_HLSL_BXDF_REFLECTION_BECKMANN_INCLUDED_
#define _NBL_BUILTIN_HLSL_BXDF_REFLECTION_BECKMANN_INCLUDED_

#include "nbl/builtin/hlsl/bxdf/common.hlsl"
#include "nbl/builtin/hlsl/bxdf/bxdf_traits.hlsl"
#include "nbl/builtin/hlsl/sampling/cos_weighted_spheres.hlsl"
#include "nbl/builtin/hlsl/bxdf/ndf/beckmann.hlsl"
#include "nbl/builtin/hlsl/bxdf/base/cook_torrance_base.hlsl"

Expand Down
2 changes: 0 additions & 2 deletions include/nbl/builtin/hlsl/bxdf/reflection/ggx.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
#ifndef _NBL_BUILTIN_HLSL_BXDF_REFLECTION_GGX_INCLUDED_
#define _NBL_BUILTIN_HLSL_BXDF_REFLECTION_GGX_INCLUDED_

#include "nbl/builtin/hlsl/bxdf/common.hlsl"
#include "nbl/builtin/hlsl/bxdf/bxdf_traits.hlsl"
#include "nbl/builtin/hlsl/sampling/cos_weighted_spheres.hlsl"
#include "nbl/builtin/hlsl/bxdf/ndf/ggx.hlsl"
#include "nbl/builtin/hlsl/bxdf/base/cook_torrance_base.hlsl"

Expand Down
4 changes: 1 addition & 3 deletions include/nbl/builtin/hlsl/bxdf/transmission/beckmann.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
#ifndef _NBL_BUILTIN_HLSL_BXDF_TRANSMISSION_BECKMANN_INCLUDED_
#define _NBL_BUILTIN_HLSL_BXDF_TRANSMISSION_BECKMANN_INCLUDED_

#include "nbl/builtin/hlsl/bxdf/common.hlsl"
#include "nbl/builtin/hlsl/bxdf/bxdf_traits.hlsl"
#include "nbl/builtin/hlsl/sampling/cos_weighted_spheres.hlsl"
#include "nbl/builtin/hlsl/bxdf/reflection.hlsl"
#include "nbl/builtin/hlsl/bxdf/ndf/beckmann.hlsl"
#include "nbl/builtin/hlsl/bxdf/base/cook_torrance_base.hlsl"

namespace nbl
Expand Down
3 changes: 0 additions & 3 deletions include/nbl/builtin/hlsl/bxdf/transmission/ggx.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
#ifndef _NBL_BUILTIN_HLSL_BXDF_TRANSMISSION_GGX_INCLUDED_
#define _NBL_BUILTIN_HLSL_BXDF_TRANSMISSION_GGX_INCLUDED_

#include "nbl/builtin/hlsl/bxdf/common.hlsl"
#include "nbl/builtin/hlsl/bxdf/bxdf_traits.hlsl"
#include "nbl/builtin/hlsl/sampling/cos_weighted_spheres.hlsl"
#include "nbl/builtin/hlsl/bxdf/reflection.hlsl"
#include "nbl/builtin/hlsl/bxdf/base/cook_torrance_base.hlsl"

namespace nbl
Expand Down
1 change: 0 additions & 1 deletion include/nbl/builtin/hlsl/emulated/float64_t.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define _NBL_BUILTIN_HLSL_EMULATED_FLOAT64_T_HLSL_INCLUDED_

#include <nbl/builtin/hlsl/emulated/float64_t_impl.hlsl>
#include <nbl/builtin/hlsl/concepts/core.hlsl>

namespace nbl
{
Expand Down
7 changes: 5 additions & 2 deletions include/nbl/builtin/hlsl/member_test_macros.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
#define _NBL_BUILTIN_HLSL_MEMBER_TEST_MACROS_INCLUDED_

#include <nbl/builtin/hlsl/utility.hlsl>
#include <boost/preprocessor.hpp>
#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/comparison/not_equal.hpp>
#include <boost/preprocessor/punctuation/comma_if.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>

#ifdef __HLSL_VERSION

Expand Down Expand Up @@ -123,4 +126,4 @@ GENERATE_METHOD_TESTER(set)


#endif
#endif
#endif
37 changes: 34 additions & 3 deletions include/nbl/builtin/hlsl/path_tracing/concepts.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#define _NBL_BUILTIN_HLSL_PATH_TRACING_CONCEPTS_INCLUDED_

#include <nbl/builtin/hlsl/concepts.hlsl>
#include <nbl/builtin/hlsl/bxdf/common.hlsl>

namespace nbl
{
Expand All @@ -15,6 +14,17 @@ namespace path_tracing
{
namespace concepts
{
namespace impl
{
template<typename Vector3>
struct DummyRayInteraction
{
using vector3_type = Vector3;

vector3_type getN() NBL_CONST_MEMBER_FUNC;
bool isMaterialBSDF() NBL_CONST_MEMBER_FUNC;
};
}

#define NBL_CONCEPT_NAME RandGenerator
#define NBL_CONCEPT_TPLT_PRM_KINDS (typename)
Expand All @@ -38,7 +48,7 @@ NBL_CONCEPT_END(
#define NBL_CONCEPT_TPLT_PRM_NAMES (T)
#define NBL_CONCEPT_PARAM_0 (ray, T)
#define NBL_CONCEPT_PARAM_1 (v, typename T::vector3_type)
#define NBL_CONCEPT_PARAM_2 (interaction, bxdf::surface_interactions::SIsotropic<bxdf::ray_dir_info::SBasic<float>, typename T::spectral_type>)
#define NBL_CONCEPT_PARAM_2 (interaction, impl::DummyRayInteraction<typename T::vector3_type>)
#define NBL_CONCEPT_PARAM_3 (scalar, typename T::scalar_type)
#define NBL_CONCEPT_PARAM_4 (color, typename T::spectral_type)
NBL_CONCEPT_BEGIN(5)
Expand All @@ -52,7 +62,7 @@ NBL_CONCEPT_END(
((NBL_CONCEPT_REQ_TYPE)(T::vector3_type))
((NBL_CONCEPT_REQ_TYPE)(T::spectral_type))
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.init(v/*origin*/, v/*direction*/)), ::nbl::hlsl::is_same_v, void))
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.template setInteraction<bxdf::surface_interactions::SIsotropic<bxdf::ray_dir_info::SBasic<float>, typename T::spectral_type> >(interaction)), ::nbl::hlsl::is_same_v, void))
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.setInteraction(interaction)), ::nbl::hlsl::is_same_v, void))
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.initPayload()), ::nbl::hlsl::is_same_v, void))
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.shouldDoMIS()), ::nbl::hlsl::is_same_v, bool))
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.foundEmissiveMIS(scalar)), ::nbl::hlsl::is_same_v, typename T::scalar_type))
Expand Down Expand Up @@ -124,6 +134,7 @@ NBL_CONCEPT_END(
((NBL_CONCEPT_REQ_TYPE)(T::scene_type))
((NBL_CONCEPT_REQ_TYPE)(T::ray_type))
((NBL_CONCEPT_REQ_TYPE)(T::object_handle_type))
((NBL_CONCEPT_REQ_TYPE)(T::anisotropic_interaction_type))
((NBL_CONCEPT_REQ_TYPE)(T::closest_hit_type))
((NBL_CONCEPT_REQ_TYPE_ALIAS_CONCEPT)(IntersectorClosestHit, typename T::closest_hit_type))
((NBL_CONCEPT_REQ_TYPE_ALIAS_CONCEPT)(Ray, typename T::ray_type))
Expand All @@ -136,6 +147,26 @@ NBL_CONCEPT_END(
#undef intersect
#include <nbl/builtin/hlsl/concepts/__end.hlsl>

#define NBL_CONCEPT_NAME UnidirectionalInteractionContract
#define NBL_CONCEPT_TPLT_PRM_KINDS (typename)(typename)(typename)
#define NBL_CONCEPT_TPLT_PRM_NAMES (RayT)(IntersectorT)(MaterialSystemT)
#define NBL_CONCEPT_PARAM_0 (ray, RayT)
#define NBL_CONCEPT_PARAM_1 (hit, typename IntersectorT::closest_hit_type)
#define NBL_CONCEPT_PARAM_2 (interaction, typename MaterialSystemT::anisotropic_interaction_type)
NBL_CONCEPT_BEGIN(3)
#define ray NBL_CONCEPT_PARAM_T NBL_CONCEPT_PARAM_0
#define hit NBL_CONCEPT_PARAM_T NBL_CONCEPT_PARAM_1
#define interaction NBL_CONCEPT_PARAM_T NBL_CONCEPT_PARAM_2
NBL_CONCEPT_END(
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((hit.getInteraction()), ::nbl::hlsl::is_same_v, typename IntersectorT::anisotropic_interaction_type))
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((hit.getInteraction()), ::nbl::hlsl::is_same_v, typename MaterialSystemT::anisotropic_interaction_type))
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.setInteraction(interaction)), ::nbl::hlsl::is_same_v, void))
);
#undef interaction
#undef hit
#undef ray
#include <nbl/builtin/hlsl/concepts/__end.hlsl>

#define NBL_CONCEPT_NAME BxdfNode
#define NBL_CONCEPT_TPLT_PRM_KINDS (typename)
#define NBL_CONCEPT_TPLT_PRM_NAMES (T)
Expand Down
4 changes: 1 addition & 3 deletions include/nbl/builtin/hlsl/path_tracing/unidirectional.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
#define _NBL_BUILTIN_HLSL_PATH_TRACING_UNIDIRECTIONAL_INCLUDED_

#include <nbl/builtin/hlsl/colorspace/EOTF.hlsl>
#include <nbl/builtin/hlsl/colorspace/encodeCIEXYZ.hlsl>
#include <nbl/builtin/hlsl/math/functions.hlsl>
#include <nbl/builtin/hlsl/sampling/basic.hlsl>
#include <nbl/builtin/hlsl/bxdf/bxdf_traits.hlsl>
#include <nbl/builtin/hlsl/vector_utils/vector_traits.hlsl>
#include <nbl/builtin/hlsl/path_tracing/concepts.hlsl>

namespace nbl
Expand All @@ -22,6 +19,7 @@ namespace path_tracing
template<class RandGen, class Ray, class Intersector, class MaterialSystem, /* class PathGuider, */ class NextEventEstimator, class Accumulator, class Scene
NBL_PRIMARY_REQUIRES(concepts::RandGenerator<RandGen> && concepts::Ray<Ray> &&
concepts::Intersector<Intersector> && concepts::MaterialSystem<MaterialSystem> &&
concepts::UnidirectionalInteractionContract<Ray, Intersector, MaterialSystem> &&
concepts::NextEventEstimator<NextEventEstimator> && concepts::Accumulator<Accumulator> &&
concepts::Scene<Scene>)
struct Unidirectional
Expand Down
4 changes: 0 additions & 4 deletions include/nbl/builtin/hlsl/tgmath.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@
#include <nbl/builtin/hlsl/spirv_intrinsics/glsl.std.450.hlsl>
#include <nbl/builtin/hlsl/tgmath/impl.hlsl>
#include <nbl/builtin/hlsl/type_traits.hlsl>
#include <nbl/builtin/hlsl/vector_utils/vector_traits.hlsl>
#include <nbl/builtin/hlsl/cpp_compat.hlsl>
#include <nbl/builtin/hlsl/ieee754.hlsl>
#include <nbl/builtin/hlsl/spirv_intrinsics/core.hlsl>
#include <nbl/builtin/hlsl/concepts/core.hlsl>
#include <nbl/builtin/hlsl/concepts/vector.hlsl>
#include <nbl/builtin/hlsl/cpp_compat/intrinsics.hlsl>

// C++ headers
Expand Down
Loading
Loading