Skip to content

Commit e93fdee

Browse files
committed
address uint32_t instead of uint16_t
1 parent b499364 commit e93fdee

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

include/nbl/builtin/glsl/virtual_geometry/descriptors.glsl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,14 @@ layout(set = _NBL_VG_SSBO_DESCRIPTOR_SET, binding = _NBL_VG_SSBO_UVEC4_BINDING,
106106
#ifdef _NBL_VG_USE_SSBO_INDEX
107107
layout(set = _NBL_VG_SSBO_DESCRIPTOR_SET, binding = _NBL_VG_SSBO_INDEX_BINDING, std430) readonly buffer TrianglePackedData
108108
{
109-
uint16_t indices[];
109+
uint indices[];
110110
} trianglePackedData;
111111
uint nbl_glsl_VG_fetchTriangleVertexIndex(in uint baseVertex, in uint triangleVx)
112112
{
113-
return uint(trianglePackedData.indices[baseVertex+triangleVx]);
113+
uint realIndex = baseVertex + triangleVx;
114+
uint packedData = trianglePackedData.indices[realIndex>>1u];
115+
uint extractedData = uint(bitfieldExtract(packedData, bool(realIndex&0x1u) ? 16 : 0, 16));
116+
return extractedData;
114117
}
115118
#endif
116119

0 commit comments

Comments
 (0)