Skip to content

Commit 29f120c

Browse files
committed
Fix a few compile errors to make sure it works with clang
1 parent 289a3ef commit 29f120c

File tree

5 files changed

+33
-28
lines changed

5 files changed

+33
-28
lines changed

examples_tests/06.MeshLoaders/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
using namespace nbl;
1515
using namespace core;
16+
using namespace ui;
1617
/*
1718
Uncomment for more detailed logging
1819
*/

include/nbl/asset/IAccelerationStructure.h

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -99,30 +99,34 @@ class IAccelerationStructure : public IDescriptor
9999
std::memmove(this, &copy, sizeof(GeometryData));
100100
return *this;
101101
}
102+
103+
struct Triangles
104+
{
105+
E_FORMAT vertexFormat;
106+
AddressType vertexData;
107+
uint64_t vertexStride;
108+
uint32_t maxVertex;
109+
E_INDEX_TYPE indexType;
110+
AddressType indexData;
111+
AddressType transformData;
112+
};
113+
114+
struct AABBs
115+
{
116+
AddressType data;
117+
size_t stride;
118+
};
102119

120+
struct Instances
121+
{
122+
AddressType data;
123+
};
124+
103125
union
104126
{
105-
struct Triangles
106-
{
107-
E_FORMAT vertexFormat;
108-
AddressType vertexData;
109-
uint64_t vertexStride;
110-
uint32_t maxVertex;
111-
E_INDEX_TYPE indexType;
112-
AddressType indexData;
113-
AddressType transformData;
114-
} triangles;
115-
116-
struct AABBs
117-
{
118-
AddressType data;
119-
size_t stride;
120-
} aabbs;
121-
122-
struct Instances
123-
{
124-
AddressType data;
125-
} instances;
127+
Triangles triangles;
128+
AABBs aabbs;
129+
Instances instances;
126130
};
127131
};
128132

include/nbl/core/SRange.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
#include "stddef.h"
1111
#include <type_traits>
12+
#include <utility>
13+
#include <iterator>
1214

1315
/*! \file SRange.h
1416
\brief File containing SRange utility struct for C++11 range loops
@@ -36,10 +38,9 @@ struct SRange
3638
template<class Q=ConstIteratorType>
3739
inline typename std::enable_if<!std::is_same<Q,IteratorType>::value,ConstIteratorType>::type end() const { return m_end; }
3840

39-
_NBL_STATIC_INLINE_CONSTEXPR bool is_const = std::is_const<T>::value;
40-
inline const T& operator[](size_t ix) const noexcept { return begin()[ix]; }
41-
template<typename U=T, typename = typename std::enable_if<!is_const>::type>
42-
inline T& operator[](size_t ix) noexcept { return begin()[ix]; }
41+
inline const T& operator[](size_t ix) const noexcept { return begin()[ix]; }
42+
template<typename Q=T>
43+
inline typename std::enable_if<!std::is_const_v<Q>,T&>::type operator[](size_t ix) noexcept { return begin()[ix]; }
4344

4445
inline size_t size() const {return std::distance(m_begin,m_end);}
4546

include/nbl/core/containers/CMemoryPool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class CMemoryPool : public Uncopyable
1616
{
1717
public:
1818
using addr_allocator_type = AddressAllocator;
19-
using allocator_type = std::conditional<isThreadSafe,
19+
using allocator_type = typename std::conditional<isThreadSafe,
2020
SimpleBlockBasedAllocatorMT<AddressAllocator,DataAllocator, std::recursive_mutex, Args...>,
2121
SimpleBlockBasedAllocatorST<AddressAllocator,DataAllocator, Args...>>::type;
2222
using size_type = typename core::address_allocator_traits<addr_allocator_type>::size_type;

include/nbl/video/CVulkanConnection.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define __NBL_C_VULKAN_CONNECTION_H_INCLUDED__
33

44
#include "nbl/video/IAPIConnection.h"
5+
#include "nbl/video/debug/CVulkanDebugCallback.h"
56

67
#if defined(_NBL_PLATFORM_WINDOWS_)
78
# include "nbl/ui/IWindowWin32.h"
@@ -11,8 +12,6 @@
1112

1213
namespace nbl::video
1314
{
14-
class CVulkanDebugCallback;
15-
1615
class CVulkanConnection final : public IAPIConnection
1716
{
1817
public:

0 commit comments

Comments
 (0)