@@ -88,6 +88,7 @@ class NBL_API2 CPolygonGeometryManipulator
88
88
if (indexing->degree () != 3 ) return nullptr ;
89
89
90
90
const auto originalView = geo->getIndexView ();
91
+ const auto originalIndexSize = originalView ? originalView.composed .stride : 0 ;
91
92
const auto primCount = geo->getPrimitiveCount ();
92
93
const auto maxIndex = geo->getPositionView ().getElementCount () - 1 ;
93
94
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
122
123
{
123
124
IPolygonGeometryBase::IIndexingCallback::SContext<uint16_t > context{
124
125
.indexBuffer = geo->getIndexView ().getPointer (),
125
- .indexSize = indexSize ,
126
+ .indexSize = originalIndexSize ,
126
127
.beginPrimitive = 0 ,
127
128
.endPrimitive = primCount,
128
129
.out = indexBufferPtr,
@@ -139,7 +140,7 @@ class NBL_API2 CPolygonGeometryManipulator
139
140
{
140
141
IPolygonGeometryBase::IIndexingCallback::SContext<uint32_t > context{
141
142
.indexBuffer = geo->getIndexView ().getPointer (),
142
- .indexSize = indexSize ,
143
+ .indexSize = originalIndexSize ,
143
144
.beginPrimitive = 0 ,
144
145
.endPrimitive = primCount,
145
146
.out = indexBufferPtr,
0 commit comments