Skip to content

Commit c91f2d7

Browse files
author
devsh
committed
correct typos, get stuff compiling
1 parent 2c9b860 commit c91f2d7

File tree

12 files changed

+71
-103
lines changed

12 files changed

+71
-103
lines changed

include/nbl/asset/IGeometry.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ class IGeometryBase : public virtual core::IReferenceCounted
7777
if (isFormatted())
7878
switch (format)
7979
{
80-
case EF_R8_SINT: [fallthrough];
81-
case EF_R8_UINT: [fallthrough];
82-
case EF_R16_SINT: [fallthrough];
83-
case EF_R16_UINT: [fallthrough];
84-
case EF_R32_SINT: [fallthrough];
85-
case EF_R32_UINT: [fallthrough];
86-
case EF_R64_SINT: [fallthrough];
80+
case EF_R8_SINT: [[fallthrough]];
81+
case EF_R8_UINT: [[fallthrough]];
82+
case EF_R16_SINT: [[fallthrough]];
83+
case EF_R16_UINT: [[fallthrough]];
84+
case EF_R32_SINT: [[fallthrough]];
85+
case EF_R32_UINT: [[fallthrough]];
86+
case EF_R64_SINT: [[fallthrough]];
8787
case EF_R64_UINT:
8888
return true;
8989
default:
@@ -104,7 +104,7 @@ class IGeometryBase : public virtual core::IReferenceCounted
104104
template<typename Visitor>
105105
inline void visitAABB(Visitor& visitor)
106106
{
107-
switch (newFormat)
107+
switch (format)
108108
{
109109
case EAABBFormat::F64:
110110
visitor(encodedDataRange.f64);
@@ -226,7 +226,7 @@ class NBL_API2 IGeometry : public IGeometryBase
226226
{
227227
if (!this->operator bool())
228228
return 0ull;
229-
const auto stride = getStride();
229+
const auto stride = composed.getStride();
230230
if (stride==0)
231231
return 0ull;
232232
return src.length/stride;
@@ -242,7 +242,7 @@ class NBL_API2 IGeometry : public IGeometryBase
242242
inline void* getPointer(const Index elIx=0)
243243
{
244244
if (*this)
245-
return reinterpret_cast<uint8_t*>(src.buffer->getPointer())+src.offset+elIx*getStride();
245+
return reinterpret_cast<uint8_t*>(src.buffer->getPointer())+src.offset+elIx*composed.getStride();
246246
return nullptr;
247247
}
248248

@@ -284,7 +284,7 @@ class NBL_API2 IGeometry : public IGeometryBase
284284
using traits = hlsl::vector_traits<V>;
285285
using code_t = std::conditional_t<hlsl::concepts::FloatingPointVector<V>,hlsl::float64_t,std::conditional_t<hlsl::concepts::SignedIntVector<V>,int64_t,uint64_t>>;
286286
code_t tmp[traits::Dimension];
287-
const auto range = composed.getRange<traits::Dimension,traits::scalar_type>>();
287+
const auto range = composed.getRange<traits::Dimension,traits::scalar_type>();
288288
for (auto i=0u; i<traits::Dimension; i++)
289289
{
290290
if (isNormalizedFormat(composed.format))
@@ -390,7 +390,7 @@ class NBL_API2 IIndexableGeometry : public IGeometry<BufferType>
390390
{
391391
if (!view || view.isFormattedScalarInteger())
392392
{
393-
m_indexView = std::move(strm);
393+
m_indexView = std::move(view);
394394
return true;
395395
}
396396
return false;

include/nbl/asset/IPolygonGeometry.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class NBL_API2 IPolygonGeometry : public IIndexableGeometry<BufferType>
1919
using base_t = IIndexableGeometry<BufferType>;
2020

2121
protected:
22+
using EPrimitiveType = base_t::EPrimitiveType;
2223
using BLASTriangles = IBottomLevelAccelerationStructure::Triangles<std::remove_const<BufferType>>;
2324

2425
public:
@@ -51,7 +52,7 @@ class NBL_API2 IPolygonGeometry : public IIndexableGeometry<BufferType>
5152
inline EPrimitiveType getPrimitiveType() const override final {return PrimitiveType;}
5253

5354
//
54-
inline const SAABBStorage& getAABB() const override final {return m_positionView.encodedDataRange;}
55+
inline const auto& getAABB() const override final {return m_positionView.encodedDataRange;}
5556

5657
//
5758
inline uint64_t getVertexReferenceCount() const {return getIndexView() ? getIndexCount():m_positionView.getElementCount();}

include/nbl/asset/asset.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
// importexport
6464
#include "nbl/asset/interchange/IAssetLoader.h"
6565
#include "nbl/asset/interchange/IImageLoader.h"
66+
#include "nbl/asset/interchange/IGeometryLoader.h"
6667
#include "nbl/asset/interchange/IAssetWriter.h"
6768
#include "nbl/asset/interchange/IImageWriter.h"
6869
#include "nbl/asset/metadata/COpenEXRMetadata.h"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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_GEOMETRY_LOADER_H_INCLUDED_
5+
#define _NBL_ASSET_I_GEOMETRY_LOADER_H_INCLUDED_
6+
7+
8+
#include "nbl/core/declarations.h"
9+
10+
#include "nbl/asset/ICPUPolygonGeometry.h"
11+
#include "nbl/asset/interchange/IAssetLoader.h"
12+
#include "nbl/asset/interchange/IImageAssetHandlerBase.h"
13+
14+
15+
namespace nbl::asset
16+
{
17+
18+
class IGeometryLoader : public IAssetLoader
19+
{
20+
public:
21+
virtual inline uint64_t getSupportedAssetTypesBitfield() const override {return IAsset::ET_GEOMETRY;}
22+
23+
protected:
24+
IGeometryLoader() {}
25+
virtual ~IGeometryLoader() = 0;
26+
27+
private:
28+
};
29+
30+
}
31+
32+
#endif

include/nbl/builtin/hlsl/shapes/aabb.hlsl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ struct AABB
3131
//
3232
void addPoint(const point_t pt)
3333
{
34-
minVx = min<point_t>(pt, minVx);
35-
maxVx = max<point_t>(pt, maxVx);
34+
minVx = min<point_t>(pt,minVx);
35+
maxVx = max<point_t>(pt,maxVx);
3636
}
3737
//
3838
point_t getExtent()
@@ -50,7 +50,7 @@ struct AABB
5050
// returns the corner of the AABB which has the most positive dot product
5151
point_t getFarthestPointInFront(const point_t planeNormal)
5252
{
53-
return hlsl::mix(maxVx, minVx, hlsl::lessThan(planeNormal,promote<point_t>(0.f)));
53+
return hlsl::mix(maxVx,minVx,planeNormal < promote<point_t>(0.f));
5454
}
5555

5656
point_t minVx;

include/nbl/builtin/hlsl/shapes/util.hlsl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ struct union_helper;
2525
}
2626

2727
template<typename T>
28-
T intersect(NBL_CONST_REF_ARG(T) lhs, NBL_CONST_REF_ARG(T) rhs) {return intersect_helper<T>::__call(lhs,rhs);}
28+
T intersect(NBL_CONST_REF_ARG(T) lhs, NBL_CONST_REF_ARG(T) rhs) {return impl::intersect_helper<T>::__call(lhs,rhs);}
29+
// union is a keyword in C++
2930
template<typename T>
30-
T union(NBL_CONST_REF_ARG(T) lhs, NBL_CONST_REF_ARG(T) rhs) {return union_helper<T>::__call(lhs,rhs);}
31+
T union_(NBL_CONST_REF_ARG(T) lhs, NBL_CONST_REF_ARG(T) rhs) {return impl::union_helper<T>::__call(lhs,rhs);}
3132

3233
}
3334
}

include/nbl/ext/MitsubaLoader/CSerializedLoader.h

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
1-
// Copyright (C) 2018-2020 - DevSH Graphics Programming Sp. z O.O.
1+
// Copyright (C) 2018-2025 - DevSH Graphics Programming Sp. z O.O.
22
// This file is part of the "Nabla Engine".
33
// For conditions of distribution and use, see copyright notice in nabla.h
4+
#ifndef _NBL_EXT_MITSUBA_C_SERIALIZED_LOADER_H_INCLUDED_
5+
#define _NBL_EXT_MITSUBA_C_SERIALIZED_LOADER_H_INCLUDED_
46

5-
#ifndef __C_SERIALIZED_LOADER_H_INCLUDED__
6-
#define __C_SERIALIZED_LOADER_H_INCLUDED__
7+
8+
#include "nbl/system/declarations.h"
79

810
#include "nbl/asset/asset.h"
911

10-
namespace nbl
11-
{
12-
namespace ext
13-
{
14-
namespace MitsubaLoader
12+
13+
namespace nbl::ext::MitsubaLoader
1514
{
1615

1716
//! Meshloader capable of loading obj meshes.
18-
class CSerializedLoader final : public asset::IRenderpassIndependentPipelineLoader
17+
class CSerializedLoader final : public asset::IGeometryLoader
1918
{
2019
protected:
2120
//! Destructor
2221
inline ~CSerializedLoader() {}
2322

2423
public:
2524
//! Constructor
26-
CSerializedLoader(asset::IAssetManager* _manager) : IRenderpassIndependentPipelineLoader(_manager) {}
25+
CSerializedLoader(asset::IAssetManager* _manager) : IGeometryLoader() {}
2726

2827
inline bool isALoadableFileFormat(system::IFile* _file, const system::logger_opt_ptr logger = nullptr) const override
2928
{
@@ -42,8 +41,6 @@ class CSerializedLoader final : public asset::IRenderpassIndependentPipelineLoad
4241
return ext;
4342
}
4443

45-
inline uint64_t getSupportedAssetTypesBitfield() const override { return asset::IAsset::ET_MESH; }
46-
4744
//! creates/loads an animated mesh from the file.
4845
asset::SAssetBundle loadAsset(system::IFile* _file, const asset::IAssetLoader::SAssetLoadParams& _params, asset::IAssetLoader::IAssetLoaderOverride* _override = nullptr, uint32_t _hierarchyLevel = 0u) override;
4946

@@ -71,8 +68,4 @@ class CSerializedLoader final : public asset::IRenderpassIndependentPipelineLoad
7168

7269

7370
}
74-
}
75-
}
76-
7771
#endif
78-

src/nbl/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ set(NBL_ASSET_SOURCES
158158
${NBL_ROOT_PATH}/src/nbl/asset/ICPUImage.cpp
159159
${NBL_ROOT_PATH}/src/nbl/asset/interchange/IAssetWriter.cpp
160160
${NBL_ROOT_PATH}/src/nbl/asset/interchange/IAssetLoader.cpp
161-
${NBL_ROOT_PATH}/src/nbl/asset/interchange/IRenderpassIndependentPipelineLoader.cpp
162161

163162
# Shaders
164163
${NBL_ROOT_PATH}/src/nbl/asset/utils/ISPIRVOptimizer.cpp

src/nbl/asset/IAssetManager.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@
8585

8686
#include "nbl/asset/interchange/CBufferLoaderBIN.h"
8787
#include "nbl/asset/utils/CGeometryCreator.h"
88-
#include "nbl/asset/utils/CMeshManipulator.h"
8988

9089

9190
using namespace nbl;

src/nbl/asset/interchange/CGraphicsPipelineLoaderMTL.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
// Copyright (C) 2018-2020 - DevSH Graphics Programming Sp. z O.O.
1+
// Copyright (C) 2018-2025 - DevSH Graphics Programming Sp. z O.O.
22
// This file is part of the "Nabla Engine".
33
// For conditions of distribution and use, see copyright notice in nabla.h
4+
#ifndef _NBL_ASSET_C_GRAPHICS_PIPELINE_LOADER_MTL_H_INCLUDED_
5+
#define _NBL_ASSET_C_GRAPHICS_PIPELINE_LOADER_MTL_H_INCLUDED_
46

5-
#ifndef __NBL_ASSET_C_GRAPHICS_PIPELINE_LOADER_MTL_H_INCLUDED__
6-
#define __NBL_ASSET_C_GRAPHICS_PIPELINE_LOADER_MTL_H_INCLUDED__
77

8-
#include "nbl/asset/interchange/IRenderpassIndependentPipelineLoader.h"
8+
#include "nbl/asset/interchange/IGeometryLoader.h"
99
#include "nbl/asset/metadata/CMTLMetadata.h"
1010

11+
1112
namespace nbl::asset
1213
{
1314

14-
class CGraphicsPipelineLoaderMTL final : public asset::IRenderpassIndependentPipelineLoader
15+
class CGraphicsPipelineLoaderMTL final : public IGeometryLoader
1516
{
1617
struct SMtl
1718
{

0 commit comments

Comments
 (0)