Skip to content

Commit b3e7e8c

Browse files
committed
Convert HLSL array subscript operator operand to int
1 parent d89c09e commit b3e7e8c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

vendor/hlslparser/src/GLSLGenerator.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,9 +887,11 @@ void GLSLGenerator::OutputExpression(HLSLExpression* expression, const HLSLType*
887887
}
888888
else
889889
{
890+
// Array subscript operator in GLSL requires an explicit int parameter
891+
const HLSLType& intType = HLSLType(HLSLBaseType_Int);
890892
OutputExpression(arrayAccess->array);
891893
m_writer.Write("[");
892-
OutputExpression(arrayAccess->index);
894+
OutputExpression(arrayAccess->index, &intType);
893895
m_writer.Write("]");
894896
}
895897

0 commit comments

Comments
 (0)