Skip to content

Commit a30ef6f

Browse files
author
kevyuu
committed
Change type of index in SSNGVertexData
1 parent 509b359 commit a30ef6f

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

include/nbl/asset/utils/CPolygonGeometryManipulator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class NBL_API2 CPolygonGeometryManipulator
2121

2222
struct SSNGVertexData
2323
{
24-
uint64_t index; //offset of the vertex into index buffer
24+
uint32_t index; //offset of the vertex into index buffer
2525
// TODO: check whether separating hash and position into its own vector or even rehash the position everytime we need will result in VertexHashGrid become faster.
2626
uint32_t hash;
2727
hlsl::float32_t3 weightedNormal;

include/nbl/asset/utils/CVertexWelder.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ class CVertexWelder {
1818
auto outPolygon = core::move_and_static_cast<ICPUPolygonGeometry>(polygon->clone(0u));
1919
outPolygon->setIndexing(IPolygonGeometryBase::TriangleList());
2020

21-
core::vector<uint64_t> vertexIndexToAsIndex(as.getVertexCount());
21+
core::vector<uint32_t> vertexIndexToAsIndex(as.getVertexCount());
2222

23-
for (uint64_t vertexData_i = 0u; vertexData_i < as.getVertexCount(); vertexData_i++)
23+
for (uint32_t vertexData_i = 0u; vertexData_i < as.getVertexCount(); vertexData_i++)
2424
{
2525
const auto& vertexData = as.vertices()[vertexData_i];
2626
vertexIndexToAsIndex[vertexData.index] = vertexData.index;
2727
}
2828

29-
static constexpr auto INVALID_INDEX = std::numeric_limits<uint64_t>::max();
30-
core::vector<uint64_t> remappedVertexIndexes(as.getVertexCount());
29+
static constexpr auto INVALID_INDEX = std::numeric_limits<uint32_t>::max();
30+
core::vector<uint32_t> remappedVertexIndexes(as.getVertexCount());
3131
std::fill(remappedVertexIndexes.begin(), remappedVertexIndexes.end(), INVALID_INDEX);
3232

33-
uint64_t maxRemappedIndex = 0;
33+
uint32_t maxRemappedIndex = 0;
3434
// iterate by index, so that we always use the smallest index when multiple vertexes can be welded together
35-
for (uint64_t index = 0; index < as.getVertexCount(); index++)
35+
for (uint32_t index = 0; index < as.getVertexCount(); index++)
3636
{
3737
const auto asIndex = vertexIndexToAsIndex[index];
3838
const auto& vertexData = as.vertices()[asIndex];

src/nbl/asset/utils/CSmoothNormalGenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ CSmoothNormalGenerator::VertexHashMap CSmoothNormalGenerator::setupData(const as
4444
const auto cellCount = std::max<uint32_t>(core::roundUpToPoT<uint32_t>((idxCount + 31) >> 5), 4);
4545
VertexHashMap vertices(idxCount, std::min(16u * 1024u, cellCount), epsilon == 0.0f ? 0.00001f : epsilon * 2.f);
4646

47-
for (uint64_t i = 0; i < idxCount; i += 3)
47+
for (uint32_t i = 0; i < idxCount; i += 3)
4848
{
4949
//calculate face normal of parent triangle
5050
hlsl::float32_t3 v1, v2, v3;

0 commit comments

Comments
 (0)