Skip to content

Commit d2503af

Browse files
author
kevyuu
committed
Add some assert in isAttributeValEqual and isAttributeDirEqual
1 parent 1257d4d commit d2503af

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

include/nbl/asset/utils/CVertexWelder.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ class CVertexWelder {
5555

5656
static inline bool isAttributeValEqual(const ICPUPolygonGeometry::SDataView& view, uint32_t index1, uint32_t index2, float epsilon)
5757
{
58-
if (!view) return true;
58+
assert(view);
59+
assert(view.composed.isFormatted());
60+
assert(IGeometryBase::getMatchingAABBFormat(view.composed.format) == view.composed.rangeFormat);
5961
const auto channelCount = getFormatChannelCount(view.composed.format);
60-
// TODO: use memcmp to compare for integral equality
61-
const auto byteSize = getTexelOrBlockBytesize(view.composed.format);
6262
switch (view.composed.rangeFormat)
6363
{
6464
case IGeometryBase::EAABBFormat::U64:
@@ -78,7 +78,9 @@ class CVertexWelder {
7878

7979
static inline bool isAttributeDirEqual(const ICPUPolygonGeometry::SDataView& view, uint32_t index1, uint32_t index2, float epsilon)
8080
{
81-
if (!view) return true;
81+
assert(view);
82+
assert(view.composed.isFormatted());
83+
assert(IGeometryBase::getMatchingAABBFormat(view.composed.format) == view.composed.rangeFormat);
8284
const auto channelCount = getFormatChannelCount(view.composed.format);
8385
switch (view.composed.rangeFormat)
8486
{

0 commit comments

Comments
 (0)