Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
2b4d34c
start the True IR
devshgraphicsprogramming Apr 21, 2026
d73be34
more prose in the comments
devshgraphicsprogramming Apr 21, 2026
bc077bc
advance the TrueIR
devshgraphicsprogramming Apr 24, 2026
c7fe341
ok seems I needed to add corellated layering to the material compiler
devshgraphicsprogramming Apr 24, 2026
c3515c4
figure out we messed up, but add blake3_hasher specializations for `S…
devshgraphicsprogramming Apr 24, 2026
7c6fca7
enforce some more validation
devshgraphicsprogramming Apr 25, 2026
0e51eb6
finally get an idea of how to rewrite the AST into the IR
devshgraphicsprogramming Apr 25, 2026
f61fad6
add ability to reciprocate and copy AST trees into another forest/pool
devshgraphicsprogramming Apr 28, 2026
3626831
I had the whole design backwards, IR shouldn't know about the differe…
devshgraphicsprogramming Apr 28, 2026
e46724d
Move `CFrontendIR::SParameterSet` and `CFrontendIR::SBasicNDFParams` …
devshgraphicsprogramming Apr 28, 2026
4edfbd8
do most of the CTrueIR node hashing
devshgraphicsprogramming Apr 29, 2026
533fe89
fix some asserts
devshgraphicsprogramming Apr 29, 2026
7411f77
resolve crash from not copying debug infos across pools
devshgraphicsprogramming Apr 29, 2026
b7cb389
Move stuff only relevant to TrueIR and the blessed FrontendIR from `C…
devshgraphicsprogramming Apr 29, 2026
bf7d846
make a `CtrueIR::ISpectralVariable` and move the semantics enum there…
devshgraphicsprogramming Apr 29, 2026
bc2295b
make things compile nicely and differentiate BTDF and BRDF
devshgraphicsprogramming May 1, 2026
11aed54
reciprocation fixes, move more stuff into the session, add enum for C…
devshgraphicsprogramming May 1, 2026
83a66bc
rearrange the code in `CFrontendIR.cpp` so it reads linearly in-order…
devshgraphicsprogramming May 1, 2026
5be57c2
fix one copy op
devshgraphicsprogramming May 1, 2026
0b28b76
adjust the MitsubaLoader to changes in the Frontend, CI should pass now
devshgraphicsprogramming May 1, 2026
edb8750
starting making the factor (SpectralVariable from CTrueIR by CFronten…
devshgraphicsprogramming May 1, 2026
1477269
Refactor and unify the SpectralVariable in the IR and AST, I'm please…
devshgraphicsprogramming May 2, 2026
e8c79aa
final touches
devshgraphicsprogramming May 2, 2026
07f8886
fix crash stack overflow from recursion, also spot invalid iterator a…
devshgraphicsprogramming May 4, 2026
b0c2de5
I went off the deep end with the templates
devshgraphicsprogramming May 4, 2026
14a3bf7
handle exit due to RGB masking each other to 0
devshgraphicsprogramming May 4, 2026
ccf4a6c
dont hash emitter's sampler and image view state when IES profile is …
devshgraphicsprogramming May 4, 2026
adc9948
separate out the oriented material metadata from the root layer, star…
devshgraphicsprogramming May 5, 2026
2c8ee90
refactor the ISampler usage in CTrueIR::SParameter
devshgraphicsprogramming May 5, 2026
47f15f7
properly account for mulchains not going all the way back to the root…
devshgraphicsprogramming May 5, 2026
53d0f9d
Take into account that ADD nodes can sit below non-ADD and non-MUL no…
devshgraphicsprogramming May 5, 2026
0a98657
update submodule pointer
devshgraphicsprogramming May 6, 2026
905a992
basic printing of TrueIR
keptsecret May 11, 2026
692c8e7
some more labels for trueir graph
keptsecret May 11, 2026
69f61b2
reduced duplicate code in printing children
keptsecret May 11, 2026
7c767be
completely rewrote the AST -> IR
devshgraphicsprogramming May 11, 2026
5e46638
handle coated and next in correlated transmission node
keptsecret May 11, 2026
20ffad9
Merge pull request #1068 from Devsh-Graphics-Programming/ir_dot3_print
devshgraphicsprogramming May 11, 2026
c9cd3f4
it compiles but crashes on printing cook torrance
devshgraphicsprogramming May 11, 2026
9558afe
remove all the ugly code
devshgraphicsprogramming May 11, 2026
1985f37
fix my typo
devshgraphicsprogramming May 11, 2026
f96c0c4
fix more egregious bugs, add the negation nodes
devshgraphicsprogramming May 11, 2026
7e34073
base64 encoded blake3 print of CTrueIR nodes, correct the hash initia…
devshgraphicsprogramming May 12, 2026
5dd0ad2
commonalize the node copying code
devshgraphicsprogramming May 12, 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
3 changes: 3 additions & 0 deletions include/nbl/asset/asset.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
#include "nbl/asset/utils/CGLSLCompiler.h"
#include "nbl/asset/utils/CSPIRVIntrospector.h"

// material compiler
#include "nbl/asset/material_compiler3/CFrontendIR.h"

// pipelines

// skinning
Expand Down
641 changes: 287 additions & 354 deletions include/nbl/asset/material_compiler3/CFrontendIR.h

Large diffs are not rendered by default.

40 changes: 39 additions & 1 deletion include/nbl/asset/material_compiler3/CNodePool.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@ class CNodePool : public core::IReferenceCounted
};

public:
template<typename T, uint16_t N, uint16_t M>
static inline void printMatrix(std::ostringstream& sstr, const hlsl::matrix<T,N,M>& m)
{
for (uint16_t i=0; i<N; i++)
{
if (i)
sstr << "\\n";
for (uint16_t j=0; j<M; j++)
{
if (j)
sstr << ",";
sstr << std::to_string(m[i][j]);
}
}
}

//
using obj_pool_type = nbl::core::CObjectPool<Config>;

Expand Down Expand Up @@ -79,7 +95,18 @@ class CNodePool : public core::IReferenceCounted
protected:
const uint32_t m_size;
};
// copy the debug nodes between pools
inline typed_pointer_type<CDebugInfo> copyDebugInfo(const typed_pointer_type<const CDebugInfo> orig, const CNodePool* pSource)
{
assert(pSource);
if (!orig)
return {};
const auto span = pSource->getObjectPool().deref(orig)->data();
const auto oldView = std::string_view(reinterpret_cast<const char*>(span.data()),span.size()-1);
return getObjectPool().emplace<CDebugInfo>(oldView);
}

//
template<typename T>
inline const std::string_view getTypeName(const typed_pointer_type<T> h) const
{
Expand All @@ -91,9 +118,20 @@ class CNodePool : public core::IReferenceCounted
protected:
inline CNodePool(typename obj_pool_type::creation_params_type&& params) : m_composed(std::move(params)) {}

// does a shallow copy (no need to deref any of the children/deeper references), the pool itself must have a `deepCopy` method for that
template<typename T> requires std::is_copy_assignable_v<T>
static typed_pointer_type<T> copyNode(const T* src, CNodePool* dstPool)
{
assert(src);
auto& pool = dstPool->getObjectPool();
const auto copyH = pool.emplace<T>();
if (auto* const copy=pool.deref(copyH); copyH)
*copy = *src;
return copyH;
}

obj_pool_type m_composed;
};


} // namespace nbl::asset::material_compiler3
#endif
Loading
Loading