Skip to content

Commit 60baa48

Browse files
author
kevyuu
committed
Fix SContext index size parameter.
1 parent 9b09a91 commit 60baa48

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

include/nbl/asset/utils/CPolygonGeometryManipulator.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ class NBL_API2 CPolygonGeometryManipulator
8888
if (indexing->degree() != 3) return nullptr;
8989

9090
const auto originalView = geo->getIndexView();
91+
const auto originalIndexSize = originalView ? originalView.composed.stride : 0;
9192
const auto primCount = geo->getPrimitiveCount();
9293
const auto maxIndex = geo->getPositionView().getElementCount() - 1;
9394
const uint8_t indexSize = maxIndex <= std::numeric_limits<uint16_t>::max() ? sizeof(uint16_t) : sizeof(uint32_t);
@@ -122,7 +123,7 @@ class NBL_API2 CPolygonGeometryManipulator
122123
{
123124
IPolygonGeometryBase::IIndexingCallback::SContext<uint16_t> context{
124125
.indexBuffer = geo->getIndexView().getPointer(),
125-
.indexSize = indexSize,
126+
.indexSize = originalIndexSize,
126127
.beginPrimitive = 0,
127128
.endPrimitive = primCount,
128129
.out = indexBufferPtr,
@@ -139,7 +140,7 @@ class NBL_API2 CPolygonGeometryManipulator
139140
{
140141
IPolygonGeometryBase::IIndexingCallback::SContext<uint32_t> context{
141142
.indexBuffer = geo->getIndexView().getPointer(),
142-
.indexSize = indexSize,
143+
.indexSize = originalIndexSize,
143144
.beginPrimitive = 0,
144145
.endPrimitive = primCount,
145146
.out = indexBufferPtr,

0 commit comments

Comments
 (0)