Skip to content

Commit

Permalink
mesh shader: fix implicit index-array size calculation for lines and …
Browse files Browse the repository at this point in the history
…triangles

#fixed KhronosGroup#3041
  • Loading branch information
Try committed Oct 16, 2022
1 parent 5755de4 commit a21b8d8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions glslang/MachineIndependent/ParseHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -836,12 +836,16 @@ int TParseContext::getIoArrayImplicitSize(const TQualifier &qualifier, TString *
} else if (language == EShLangMesh) {
unsigned int maxPrimitives =
intermediate.getPrimitives() != TQualifier::layoutNotSet ? intermediate.getPrimitives() : 0;
if (qualifier.builtIn == EbvPrimitiveIndicesNV || qualifier.builtIn == EbvPrimitiveTriangleIndicesEXT ||
qualifier.builtIn == EbvPrimitiveLineIndicesEXT || qualifier.builtIn == EbvPrimitivePointIndicesEXT) {
if (qualifier.builtIn == EbvPrimitiveIndicesNV) {
expectedSize = maxPrimitives * TQualifier::mapGeometryToSize(intermediate.getOutputPrimitive());
str = "max_primitives*";
str += TQualifier::getGeometryString(intermediate.getOutputPrimitive());
}
else if (qualifier.builtIn == EbvPrimitiveTriangleIndicesEXT || qualifier.builtIn == EbvPrimitiveLineIndicesEXT ||
qualifier.builtIn == EbvPrimitivePointIndicesEXT) {
expectedSize = maxPrimitives;
str = "max_primitives";
}
else if (qualifier.isPerPrimitive()) {
expectedSize = maxPrimitives;
str = "max_primitives";
Expand Down

0 comments on commit a21b8d8

Please sign in to comment.