@@ -33,7 +33,7 @@ class NBL_API ICPUBuffer : public asset::IBuffer, public asset::IAsset
33
33
}
34
34
35
35
// ! Non-allocating constructor for CCustormAllocatorCPUBuffer derivative
36
- ICPUBuffer (size_t sizeInBytes, void * dat) : asset::IBuffer({dat ? sizeInBytes: 0 ,EUF_TRANSFER_DST_BIT}), data(dat) {}
36
+ ICPUBuffer (size_t sizeInBytes, void * dat) : asset::IBuffer({ dat ? sizeInBytes : 0 ,EUF_TRANSFER_DST_BIT }), data(dat) {}
37
37
public:
38
38
// ! Constructor. TODO: remove, alloc can fail, should be a static create method instead!
39
39
/* * @param sizeInBytes Size in bytes. If `dat` argument is present, it denotes size of data pointed by `dat`, otherwise - size of data to be allocated.
@@ -56,7 +56,7 @@ class NBL_API ICPUBuffer : public asset::IBuffer, public asset::IAsset
56
56
return cp;
57
57
}
58
58
59
- virtual void convertToDummyObject (uint32_t referenceLevelsBelowToConvert= 0u ) override
59
+ virtual void convertToDummyObject (uint32_t referenceLevelsBelowToConvert = 0u ) override
60
60
{
61
61
if (!canBeConvertedToDummy ())
62
62
return ;
@@ -79,7 +79,7 @@ class NBL_API ICPUBuffer : public asset::IBuffer, public asset::IAsset
79
79
virtual void * getPointer ()
80
80
{
81
81
assert (!isImmutable_debug ());
82
- return data;
82
+ return data;
83
83
}
84
84
85
85
bool canBeRestoredFrom (const IAsset* _other) const override
@@ -115,15 +115,15 @@ class NBL_API ICPUBuffer : public asset::IBuffer, public asset::IAsset
115
115
if (willBeRestoredFrom (_other))
116
116
std::swap (data, other->data );
117
117
}
118
-
118
+
119
119
void * data;
120
- };
120
+ };
121
121
122
- template <
123
- typename Allocator = _NBL_DEFAULT_ALLOCATOR_METATYPE<uint8_t >,
124
- bool = std::is_same<Allocator, core::null_allocator<typename Allocator::value_type> >::value
125
- >
126
- class NBL_API CCustomAllocatorCPUBuffer;
122
+ template <
123
+ typename Allocator = _NBL_DEFAULT_ALLOCATOR_METATYPE<uint8_t >,
124
+ bool = std::is_same<Allocator, core::null_allocator<typename Allocator::value_type> >::value
125
+ >
126
+ class NBL_API CCustomAllocatorCPUBuffer;
127
127
128
128
using CDummyCPUBuffer = CCustomAllocatorCPUBuffer<core::null_allocator<uint8_t >, true >;
129
129
@@ -133,11 +133,11 @@ using CDummyCPUBuffer = CCustomAllocatorCPUBuffer<core::null_allocator<uint8_t>,
133
133
passing an object type for allocation and a pointer to allocated
134
134
data for it's storage by ICPUBuffer.
135
135
136
- So the need for the class existence is for common following tricks - among others creating an
137
- \bICPUBuffer\b over an already existing \bvoid*\b array without any \imemcpy\i or \itaking over the memory ownership\i.
138
- You can use it with a \bnull_allocator\b that adopts memory (it is a bit counter intuitive because \badopt = take\b ownership,
139
- but a \inull allocator\i doesn't do anything, even free the memory, so you're all good).
140
- */
136
+ So the need for the class existence is for common following tricks - among others creating an
137
+ \bICPUBuffer\b over an already existing \bvoid*\b array without any \imemcpy\i or \itaking over the memory ownership\i.
138
+ You can use it with a \bnull_allocator\b that adopts memory (it is a bit counter intuitive because \badopt = take\b ownership,
139
+ but a \inull allocator\i doesn't do anything, even free the memory, so you're all good).
140
+ */
141
141
142
142
template <typename Allocator>
143
143
class NBL_API CCustomAllocatorCPUBuffer<Allocator, true > : public ICPUBuffer
0 commit comments