Fix compound assignment precision emulation
Precision emulation for compound assignment used to set the wrong type
for the compound assignment nodes, which could cause an assert to
trigger. The wrong rounding function was also being called in the lowp
rounded compound assignment function.
BUG=chromium:699479
TEST=angle_unittests
Change-Id: I60b4cb3bf1830e8249511c13037348bb2423e5b9
Reviewed-on: https://chromium-review.googlesource.com/514045
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/EmulatePrecision.cpp b/src/compiler/translator/EmulatePrecision.cpp
index aebcce6..4662929 100644
--- a/src/compiler/translator/EmulatePrecision.cpp
+++ b/src/compiler/translator/EmulatePrecision.cpp
@@ -157,7 +157,7 @@
"}\n";
sink <<
lTypeStr << " angle_compound_" << opNameStr << "_frl(inout " << lTypeStr << " x, in " << rTypeStr << " y) {\n"
- " x = angle_frl(angle_frm(x) " << opStr << " y);\n"
+ " x = angle_frl(angle_frl(x) " << opStr << " y);\n"
" return x;\n"
"}\n";
// clang-format on
@@ -464,7 +464,7 @@
TIntermSequence *arguments = new TIntermSequence();
arguments->push_back(left);
arguments->push_back(right);
- return createInternalFunctionCallNode(TType(EbtVoid), functionName, arguments);
+ return createInternalFunctionCallNode(left->getType(), functionName, arguments);
}
bool ParentUsesResult(TIntermNode *parent, TIntermTyped *node)