Set correct type on nodes created in precision emulation
The correct type needs to be set so that HLSL output will be able to
disambiguate user-defined function calls correctly based on argument
types. HLSL output support will be added to precision emulation in a
future patch, which will also have tests that verify this patch.
The lack of correct type on the nodes is not known to cause any bugs
in GLSL output.
BUG=angleproject:1437
Change-Id: I53200df066ece0ab4bd7d7a6aab699d6a1ecb659
Reviewed-on: https://chromium-review.googlesource.com/358470
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 4a7fa54..f4afdee 100644
--- a/src/compiler/translator/EmulatePrecision.cpp
+++ b/src/compiler/translator/EmulatePrecision.cpp
@@ -253,7 +253,9 @@
roundFunctionName = "angle_frm";
else
roundFunctionName = "angle_frl";
- return createInternalFunctionCallNode(roundFunctionName, roundedChild);
+ TIntermAggregate *callNode = createInternalFunctionCallNode(roundFunctionName, roundedChild);
+ callNode->setType(roundedChild->getType());
+ return callNode;
}
TIntermAggregate *createCompoundAssignmentFunctionCallNode(TIntermTyped *left, TIntermTyped *right, const char *opNameStr)