SPV: Fix extra operands when using the "struct" form of a built-in taking an 'out' param.

This commit is contained in:
John Kessenich
2015-12-06 19:29:11 -07:00
parent e721f49dbd
commit 2359bd0a1d
3 changed files with 7 additions and 5 deletions

View File

@@ -2892,9 +2892,11 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
}
spv::Id id = 0;
if (libCall >= 0)
if (libCall >= 0) {
while (consumedOperands < (int)operands.size())
operands.pop_back();
id = builder.createBuiltinCall(precision, typeId, stdBuiltins, libCall, operands);
else {
} else {
switch (consumedOperands) {
case 0:
// should all be handled by visitAggregate and createNoArgOperation