src/compiler/translator/RemovePow.cpp


Log

Author Commit Date CI Message
Olli Etuaho a223430c 2016-08-31T12:05:39 Promote unary nodes automatically Unary nodes now get their type set automatically based on the operation and operand. The operand should only be changed to another of the same type after the node is constructed. The operation can't be changed on unary and binary nodes after they've been constructed. BUG=angleproject:1490 TEST=angle_unittests Change-Id: Ib1ea3dcb1162261966c02d5f03d8091cf647fac1 Reviewed-on: https://chromium-review.googlesource.com/378935 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 63e1ec5c 2016-08-18T22:05:12 Move the rest of the validation out of TIntermBinary::promote TIntermBinary::promote now has a single purpose of determining the type resulting from a binary math operation. The TIntermBinary constructor taking the left and right nodes can now also call promote automatically, and promote is made into a private member of TIntermBinary. Validation of binary math operand types is done inside ParseContext. BUG=angleproject:952 TEST=angle_unittests Change-Id: I52a409f680c8d4120b757193972d03aed34c6895 Reviewed-on: https://chromium-review.googlesource.com/372624 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 1dded803 2016-08-18T18:13:13 Check multiplication validity in ParseContext This improves separation of responsibilities in the code: ParseContext should handle operand type validation, while TIntermBinary::promote should ideally only determine the type of the node based on the operation and operands. BUG=angleproject:952 TEST=angle_unittests Change-Id: I9a8d8ede21cdf35de631623a62194c0da5c604d2 Reviewed-on: https://chromium-review.googlesource.com/372622 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho 3fdec919 2016-08-18T15:08:06 Refactor binary node creation 1. Simplify code by using asserts instead of adding internal errors to log. 2. Add a TIntermBinary constructor that takes left and right operand nodes as parameters. 3. Remove TIntermediate functions with trivial functionality. BUG=angleproject:952 TEST=angle_unittests Change-Id: I2e0e52160c9377d8efcf15f14fd59f01cb41bd83 Reviewed-on: https://chromium-review.googlesource.com/372720 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 03d863c8 2016-07-27T18:15:53 translator: Refactor node replacement APIs. BUG=angleproject:851 Change-Id: I50c3b3a4f00b27fed85f09509738513a441c7b5b Reviewed-on: https://chromium-review.googlesource.com/363990 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 5c407bb7 2015-06-01T12:20:39 Work around pow() issue in NVIDIA 331.x drivers pow(x, y) when y is a certain kind of a constant vector can cause issues on NVIDIA 331 series drivers. Add an option to replace pow(x, y) with exp2(y * log2(x)) when y is a constant to work around this issue. This is done with an AST traverser instead of BuiltInFunctionEmulator, since there's no mechanism in BuiltInFunctionEmulator to apply the replacements only to calls where the second parameter is constant. TEST=WebGL conformance tests BUG=chromium:477306 Change-Id: Ifb327d72659fca36868439f24705203014b3ce53 Reviewed-on: https://chromium-review.googlesource.com/274279 Tested-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Zhenyao Mo <zmo@chromium.org>