Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
f523ef3
initial examples_tests submodule change
May 27, 2025
87e11e5
clean up the `nbl::hlsl::shapes` namespace a bit
May 28, 2025
0824014
new classes to replace IMeshBuffer and IMesh
May 28, 2025
3cf9d25
add a general polygon geometry
May 28, 2025
3c5e81f
correct typos and allow different geometries in a collection
May 28, 2025
7f65993
add a set transform callback to `exportForBLAS` this lets us know the…
May 28, 2025
65e9b72
add important methods and metadata for the `SDataViewBase::encodedDat…
May 28, 2025
f37cca7
add all missing data streams from ICPUMeshBuffer to IPolygonGeometry
May 28, 2025
4c7fcb7
Move the requirement for the Position View to be formatted from `IGeo…
May 28, 2025
30adb9c
correct header name to `ICPUPolygonGeometry` and implement `IAsset` m…
May 28, 2025
a0a006c
implement visitor properly
May 28, 2025
30e3bed
add the element encode/decode functions for `IGeometry::SDataView`
May 28, 2025
57f8905
excise Mesh and MeshBuffer from the asset namespace, reassign Asset T…
May 28, 2025
3001e24
correct a slight encapsulation leak
May 28, 2025
07e7176
get rid of now useless metadata classes
May 28, 2025
c9e8ca8
start cleaning up the mesh manipulator into a geometry manipulator
May 28, 2025
6a64ede
remove the renderpass independent pipeline from nbl::asset::
May 28, 2025
fef2ebc
Mesh Packers don't make much sense anymore with programmable vertex p…
May 28, 2025
7f1302c
add ICPUGeometryCollection
May 29, 2025
18adf44
hoist most of the BLAS geometry export out of IGeometryCollection
May 29, 2025
40a8df3
implement ICPUMorphTargets
May 29, 2025
2c9b860
start removing unnecessary things from PolygonGeometryManipulator
May 29, 2025
c91f2d7
correct typos, get stuff compiling
May 29, 2025
0a37d24
fight for more compilation
May 29, 2025
fd87ce7
outline some ideas about dealing with indexing schemes
May 29, 2025
144299d
finalize my indexing abstraction logic
May 31, 2025
0215b88
cauterize more stuff, start working on the Geometry Creator
May 31, 2025
b5830e7
correct a bunch of typos
May 31, 2025
c077d6e
get one step closer to compiling
Jun 3, 2025
e217665
OBJ should really be a scene loader in the future (just no lights)
Jun 3, 2025
8f1564a
in thre interest of thread safety we should not have default manipula…
Jun 3, 2025
c0dffe3
get Nabla compiling
Jun 3, 2025
cb6d148
update submodule pointer
Jun 3, 2025
7077a04
remove last remnanst, and turn off STL /PLY writers for now to let CI…
Jun 3, 2025
99efe2a
fix include bug of beziers.hlsl tested with CAD playground example
Jun 3, 2025
1f51c33
Merge pull request #885 from Devsh-Graphics-Programming/master
devshgraphicsprogramming Jun 3, 2025
2aa2395
a cry for help to @AnastaZIuk
Jun 4, 2025
7f85f18
on road to rework examples PCH and cleaning build system a bit, updat…
AnastaZIuk Jun 11, 2025
2227505
wipe _NBL_APP_NAME_ define reference from nbl/application_templates/M…
AnastaZIuk Jun 11, 2025
afac36d
update examples_tests submodule
AnastaZIuk Jun 11, 2025
ef0f206
add missing EXCLUDE_FROM_ALL for examples_tests
AnastaZIuk Jun 11, 2025
c18c8ae
create NBL_ADJUST_FOLDERS and use for a few namespaces to group targe…
AnastaZIuk Jun 11, 2025
c02e5b1
add `Container – Build Examples` step to .github/workflows/build-nabl…
AnastaZIuk Jun 11, 2025
4dedfd6
EXCLUDE_FROM_ALL nite, correct building examples and installing targets
AnastaZIuk Jun 12, 2025
30eff84
implement cube geometry creation
Jun 16, 2025
d654a25
get stuff to compile
Jun 16, 2025
aae0623
remove cruft
Jun 16, 2025
bb6f9e5
add conversion operator from SBufferRange to SBufferBinding
Jun 16, 2025
fa02163
implement `fast_affine.hlsl`
Jun 16, 2025
5b066f8
get stuff to compile
Jun 16, 2025
16b7c53
fix geometry memory issues
Jun 16, 2025
8ed377a
implement rectangle and disk
Jun 16, 2025
65c2047
fix bad (reverse) implementation of checking validity of `SDataView`
Jun 16, 2025
569839e
add `IGPUPolygonGeometry` and attempt AssetConverter implementation f…
Jun 17, 2025
1403f33
improve `CAssetConverter` to take into account that not every `asset_…
Jun 17, 2025
4eef9f9
get assetConverter to work on `IGPUPolygonGeometry`
Jun 17, 2025
2798fba
sync validation TODO
Jun 17, 2025
f143d0b
add explicit constructors to `hlsl::matrix` which can cast between ma…
Jun 18, 2025
ad27a61
Implement allPreviousStages and allLaterStages
Jun 18, 2025
776fb12
Merge remote-tracking branch 'remotes/origin/master' into mesh_loaders
Jun 18, 2025
1f52d2f
bring new Assets in line with Stageless Shaders API change
Jun 18, 2025
b8c42b2
get as many examples working as possible after the merge
Jun 18, 2025
5462fe3
Ready for Arek to work his magic
Jun 19, 2025
3fa43e2
something should be on screen but my `fast_affine.hlsl` is busted
Jun 19, 2025
4c8c47b
Merge branch 'mesh_loaders' of github.com:Devsh-Graphics-Programming/…
Jun 19, 2025
1dc258e
Add itself as next stage and previous stage for all pipeline stages
Jun 19, 2025
c42afec
pull Matt and resolve conflicts
AnastaZIuk Jun 19, 2025
961cbdf
update examples_tests submodule
AnastaZIuk Jun 19, 2025
f2f5d01
Add -1 to maxVertex
Jun 20, 2025
1d9658e
fix bugs in geometry creator and Indexing callback for triangle Fan
Jun 20, 2025
3c75ba5
turns out `CGLSLCompiler::preprocessShader` didn't quite work right f…
Jun 21, 2025
101ffbc
Merge remote-tracking branch 'remotes/origin/mlBuildUpdates' into mes…
Jun 21, 2025
68bd6a9
document the `MonoAssetManagerAndBuiltinResourceApplication.hpp` conu…
Jun 21, 2025
7b0e90d
Split `MonoAssetManagerAndBuiltinResourceApplication.hpp` in two, add…
Jun 21, 2025
380fefd
update submodule pointer
Jun 21, 2025
aae6cd9
@yasinvolved can start testing now
Jun 22, 2025
2922244
update examples_tests submodule
Jun 23, 2025
5ba8711
add some more invalid usage validation so we don't crash as often
Jun 23, 2025
3357c41
get 61 kinda working again
Jun 23, 2025
b6be78f
fix phmap_deserialization.h and phmap_serialization.h after API chang…
Jun 25, 2025
5ad312c
make patch default constructors `constexpr`
Jun 25, 2025
b1efc69
save work before doing format validation on PLY
Jun 26, 2025
ab95861
just handling the vertex loading on PLY left
Jun 26, 2025
84eafc0
correct parsing mistakes
Jun 30, 2025
9186edc
Get vertex attributes and indices loading in PLy loader.
Jun 30, 2025
898b259
AABB recomputation function
Jun 30, 2025
210cca4
implement more AABB utilities
Jul 1, 2025
ebfa0a5
remove redundant builtin assets
Jul 1, 2025
92d4ea8
update submodules pre-merge
Jul 1, 2025
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
176 changes: 176 additions & 0 deletions include/nbl/asset/ICPUPolygonGeometry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
// Copyright (C) 2025-2025 - DevSH Graphics Programming Sp. z O.O.
// This file is part of the "Nabla Engine".
// For conditions of distribution and use, see copyright notice in nabla.h
#ifndef _NBL_ASSET_I_CPU_POLYGON_GEOMETRY_H_INCLUDED_
#define _NBL_ASSET_I_CPU_POLYGON_GEOMETRY_H_INCLUDED_


#include "nbl/asset/IPolygonGeometry.h"


namespace nbl::asset
{
//
class NBL_API2 ICPUPolygonGeometry : public IAsset, public IPolygonGeometry<ICPUBuffer>
{
using base_t = IPolygonGeometry<ICPUBuffer>;

public:
inline ICPUPolygonGeometry() = default;

constexpr static inline auto AssetType = ET_GEOMETRY;
inline E_TYPE getAssetType() const override {return AssetType;}

inline core::smart_refctd_ptr<IAsset> clone(uint32_t _depth=~0u) const
{
const auto nextDepth = _depth ? (_depth-1):0;
auto retval = core::smart_refctd_ptr<ICPUPolygonGeometry>();
retval->m_positionView = m_positionView.clone(nextDepth);
retval->m_jointOBBView = m_jointOBBView.clone(nextDepth);
retval->m_indexView = m_indexView.clone(nextDepth);
retval->m_jointWeightViews.reserve(m_jointWeightViews.size());
for (const auto& pair : m_jointWeightViews)
retval->m_jointWeightViews.push_back({
.indices = pair.indices.clone(nextDepth),
.weights = pair.weights.clone(nextDepth)
});
retval->m_auxAttributeViews.reserve(m_auxAttributeViews.size());
for (const auto& view : m_auxAttributeViews)
retval->m_auxAttributeViews.push_back(view.clone(nextDepth));
retval->m_normalView = m_normalView.clone(nextDepth);
retval->m_jointCount = m_jointCount;
retval->m_verticesForFirst = m_verticesForFirst;
retval->m_verticesPerSupplementary = m_verticesPerSupplementary;
return retval;
}

// TODO: remove after https://github.com/Devsh-Graphics-Programming/Nabla/pull/871 merge
inline size_t getDependantCount() const override
{
size_t count = 0;
visitDependents([&current](const IAsset* dep)->bool
{
count++;
return true;
}
);
return count;
}

// needs to be hidden because of mutability checking
inline bool setPositionView(SDataView&& view)
{
if (isMutable() && view.composed.isFormatted())
return base_t::setPositionView(std::move(view));
return false;
}

//
inline bool setJointOBBView(SDataView&& view)
{
if (isMutable())
return base_t::setJointOBBView(std::move(view));
return false;
}

// Needs to be hidden because ICPU base class shall check mutability
inline bool setIndexView(SDataView&& view)
{
if (isMutable())
return base_t::setIndexView(std::move(view));
return false;
}

//
inline bool setVerticesForFirst(const uint16_t count)
{
if (isMutable())
{
m_verticesForFirst = count;
return true;
}
return false;
}

//
inline bool setVerticesPerSupplementary(const uint16_t count)
{
if (isMutable())
{
m_verticesPerSupplementary = count;
return true;
}
return false;
}

//
inline void setNormalView(SDataView&& view)
{
if (isMutable())
{
m_normalView = std::move(view);
return true;
}
return false;
}

//
inline bool setJointCount(const uint32_t count)
{
if (isMutable())
{
m_jointCount = count;
return true;
}
return false;
}

//
inline const core::vector<SJointWeight>* getJointWeightViews()
{
if (isMutable())
return m_jointWeightViews;
return nullptr;
}

//
inline const core::vector<SJointWeight>* getAuxAttributeViews()
{
if (isMutable())
return m_auxAttributeViews;
return nullptr;
}

protected:
//
inline void visitDependents(std::function<bool(const IAsset*)>& visit) const //override
{
if (!visit(m_positionView.src.buffer.get())) return;
if (!visit(m_jointOBBView.src.buffer.get())) return;
if (!visit(m_indexView.src.buffer.get())) return;
for (const auto& pair : m_jointWeightViews)
{
if (!visit(pair.indices.src.buffer.get())) return;
if (!visit(pair.weights.src.buffer.get())) return;
}
for (const auto& view : m_auxAttributeViews)
if (!visit(view.src.buffer.get())) return;
if (!visit(m_normalView.src.buffer.get())) return;
}
// TODO: remove after https://github.com/Devsh-Graphics-Programming/Nabla/pull/871 merge
inline IAsset* getDependant_impl(const size_t ix) override
{
const IAsset* retval = nullptr;
size_t current = 0;
visitDependents([&current](const IAsset* dep)->bool
{
retval = dep;
return ix<current++;
}
);
return const_cast<IAsset*>(retval);
}
};

}
#endif
Loading
Loading