|
40d9edf1
|
2015-11-12T17:30:34
|
|
Fix structure comparison constant folding
objectSize() will return the size of all data in the structure, and
simply iterating over the data will work for determining whether two
structures are equal. The earlier complex and broken approach where the
structure was traversed recursively is not needed.
BUG=angleproject:1211
TEST=angle_unittests
Change-Id: I0e5c5ccbb767d44ef6acb0f1f25f27dfc42866e1
Reviewed-on: https://chromium-review.googlesource.com/312490
Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
5c0e023c
|
2015-11-11T15:55:59
|
|
Qualify stored constant union data with const
This prevents accidentally changing data that may be shared between
multiple TIntermConstantUnion nodes.
Besides making the code less prone to bugs in general, this will make it
easier to implement constant folding of array constructors.
BUG=541551
TEST=angle_unittests, WebGL conformance tests
Change-Id: I4f3059f70b841d9dd0cf20fea4d37684da9cd47e
Reviewed-on: https://chromium-review.googlesource.com/312440
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tryjob-Request: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
3fed4306
|
2015-11-02T12:26:02
|
|
Unfold short-circuiting operators in loop conditions correctly
Sometimes short-circuiting operators need to be unfolded to if
statements. If the unfolded operator is inside a loop condition or
expression, it needs to be evaluated repeatedly inside the loop. Add
logic to UnfoldShortCircuitToIf that can move or copy the unfolded part
of loop conditions or expressions to inside the loop.
The exact changes that need to be done depend on the type of the loop.
For loops may require also moving the initializer to outside the loop.
The unfolded expression inside a loop condition or expression is moved
or copied to inside the loop on the first traversal of the loop node,
and unfolding to if is deferred until a second traversal. This keeps the
code relatively simple.
BUG=angleproject:1167
TEST=WebGL 2 conformance tests,
dEQP-GLES2.functional.shaders.*select_iteration_count*
Change-Id: Ieffc0ea858186054378d387dca9aa64a5fa95137
Reviewed-on: https://chromium-review.googlesource.com/310230
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
1d122789
|
2015-11-06T15:35:17
|
|
Fix constructor constant folding
The previous solution for constant folding constructors was significantly
overengineered and partially incorrect. Switch to a much simpler
constructor folding function that does not use an AST traverser, but
simply iterates over the constant folded parameters of the constructor
and doesn't do any unnecessary checks. It also reuses some code for
constant folding other built-in functions.
This fixes issues with initializing constant matrices with only a single
parameter. Instead of copying the first component of the constructor
parameter all over the matrix, passing a vec4 or matrix argument now
assigns the values correctly.
BUG=angleproject:1193
TEST=angle_unittests, WebGL conformance tests
Change-Id: I50b10721ea30cb15843fba892c1b1a211f1d72e5
Reviewed-on: https://chromium-review.googlesource.com/311191
Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
7c3848e5
|
2015-11-04T13:19:17
|
|
Allow constant folding some non-constant expressions
This requires removing the assumption that constant folding implies
constness in the constant expression sense from various places in the
code.
This particularly benefits ternary operators, which can now be simplified
if just the condition is a compile-time constant.
In the future, the groundwork that is laid here could be used to implement
more aggressive constant folding of user-defined functions for example.
TEST=angle_unittests
BUG=angleproject:851
Change-Id: I0eede806570d56746c3dad1e01aa89a91d66013d
Reviewed-on: https://chromium-review.googlesource.com/310750
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
b1edc4f5
|
2015-11-02T17:20:03
|
|
Accept const array initialization in shader parsing
Array constructors are not folded, unlike all other constant expressions.
Change initializer parsing path so that it accepts constant initializers
whether they are folded or not.
Some parts need to be adapted to work with expressions that are qualified
as constant but that are not necessarily folded:
1. Identifier parsing
2. Indexing parsing
3. Field selection parsing
4. HLSL output for variable declarations
5. Determining unary operator result type
6. Determining binary operator result type
7. Determining built-in function call result type
8. Determining ternary operator result type
Corner cases that are not supported yet:
1. Using array constructors inside case labels
2. Using array constructors inside array size expressions
3. Detecting when a negative constant expression containing an array
constructor is used to index an array
In these cases being able to constant fold the expression is essential to
validating that the code is correct, so they require a more sophisticated
solution. For now we keep the old code that rejects the shader if ANGLE
hasn't been able to constant fold the case label or array size. In case of
indexing an array with a negative constant expression containing an array
constructor, ANGLE will simply treat it as a non-constant expression.
BUG=541551
BUG=angleproject:1094
TEST=dEQP-GLES3.functional.shaders.constant_expressions.* (all pass),
angle_unittests
Change-Id: I0cbc47afd1651a4dece3d68acf7ec72a01fdf047
Reviewed-on: https://chromium-review.googlesource.com/310231
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
5d91dda9
|
2015-06-18T15:47:46
|
|
Remove dynamic indexing of matrices and vectors in HLSL
Re-re-relanding after clang warning fix.
Re-re-landing with fix to setting qualifiers on generated nodes. The
previous version failed when a uniform was indexed, because it would
set the uniform qualifier on some of the generated nodes and that
interfered with the operation of UniformsHLSL.
Re-landing after fixing D3D9 specific issues.
HLSL doesn't support dynamic indexing of matrices and vectors, so replace
that with helper functions that unroll dynamic indexing into switch/case
and static indexing.
Both the indexed vector/matrix expression and the index may have side
effects, and these will be evaluated correctly. If necessary, index
expressions that have side effects will be written to a temporary
variable that will replace the index.
Besides dEQP tests, this change is tested by a WebGL 2 conformance test.
In the case that a dynamic index is out-of-range, the base ESSL 3.00 spec
allows undefined behavior. KHR_robust_buffer_access_behavior adds the
requirement that program termination should not occur and that
out-of-range reads must return either a value from the active program's
memory or zero, and out-of-range writes should only affect the active
program's memory or do nothing. This patch clamps out-of-range indices so
that either the first or last item of the matrix/vector is accessed.
The code is not transformed in case the it fits within the limited subset
of ESSL 1.00 given in Appendix A of the spec. If the code isn't within
the restricted subset, even ESSL 1.00 shaders may require this
workaround.
BUG=angleproject:1116
TEST=dEQP-GLES3.functional.shaders.indexing.* (all pass after change)
WebGL 2 conformance tests (glsl3/vector-dynamic-indexing.html)
Change-Id: I9f6d7c7ecda8ac4dc3c30b39e15a9a0b5381c5a8
Reviewed-on: https://chromium-review.googlesource.com/310010
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
|
|
a5f64de7
|
2015-10-30T12:31:00
|
|
Revert "Remove dynamic indexing of matrices and vectors in HLSL"
Failing build on Clang-win:
..\..\third_party\angle\src\compiler\translator\RemoveDynamicIndexing.cpp(128,43) : error: expected '(' for function-style cast or type construction
fieldType.setPrimarySize(unsigned char(indexedType.getRows()));
~~~~~~~~ ^
BUG=angleproject:1116
This reverts commit 7535b761dd4740c8e76b888d7c58c7cbeefd2083.
Change-Id: I7b502e3dcd45e17b7ed88fec18be702614d9ac65
Reviewed-on: https://chromium-review.googlesource.com/309772
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
7535b761
|
2015-06-18T15:47:46
|
|
Remove dynamic indexing of matrices and vectors in HLSL
Re-re-landing with fix to setting qualifiers on generated nodes. The
previous version failed when a uniform was indexed, because it would
set the uniform qualifier on some of the generated nodes and that
interfered with the operation of UniformsHLSL.
Re-landing after fixing D3D9 specific issues.
HLSL doesn't support dynamic indexing of matrices and vectors, so replace
that with helper functions that unroll dynamic indexing into switch/case
and static indexing.
Both the indexed vector/matrix expression and the index may have side
effects, and these will be evaluated correctly. If necessary, index
expressions that have side effects will be written to a temporary
variable that will replace the index.
Besides dEQP tests, this change is tested by a WebGL 2 conformance test.
In the case that a dynamic index is out-of-range, the base ESSL 3.00 spec
allows undefined behavior. KHR_robust_buffer_access_behavior adds the
requirement that program termination should not occur and that
out-of-range reads must return either a value from the active program's
memory or zero, and out-of-range writes should only affect the active
program's memory or do nothing. This patch clamps out-of-range indices so
that either the first or last item of the matrix/vector is accessed.
The code is not transformed in case the it fits within the limited subset
of ESSL 1.00 given in Appendix A of the spec. If the code isn't within
the restricted subset, even ESSL 1.00 shaders may require this
workaround.
BUG=angleproject:1116
TEST=dEQP-GLES3.functional.shaders.indexing.* (all pass after change)
WebGL 2 conformance tests (glsl3/vector-dynamic-indexing.html)
Change-Id: I16119f9092360fb72798f9550a6f4d3cfffdc92f
Reviewed-on: https://chromium-review.googlesource.com/308790
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Zhenyao Mo <zmo@chromium.org>
|
|
b066669d
|
2015-10-26T10:38:18
|
|
Revert "Remove dynamic indexing of matrices and vectors in HLSL"
This reverts commit 3766a40d6fda7e7190514ab7838a3f37169d863f.
This CL was causing crashes in UniformHLSL.cpp, where an internal
uniform "base" was attempted to be declared in HLSL. Was crashing
on an external WebGL 3D canvas page (http://www.taccgl.org/?dbg=t).
BUG=546686
Original commit message:
Re-landing after fixing D3D9 specific issues.
HLSL doesn't support dynamic indexing of matrices and vectors, so replace
that with helper functions that unroll dynamic indexing into switch/case
and static indexing.
Both the indexed vector/matrix expression and the index may have side
effects, and these will be evaluated correctly. If necessary, index
expressions that have side effects will be written to a temporary
variable that will replace the index.
Besides dEQP tests, this change is tested by a WebGL 2 conformance test.
In the case that a dynamic index is out-of-range, the base ESSL 3.00 spec
allows undefined behavior. KHR_robust_buffer_access_behavior adds the
requirement that program termination should not occur and that
out-of-range reads must return either a value from the active program's
memory or zero, and out-of-range writes should only affect the active
program's memory or do nothing. This patch clamps out-of-range indices so
that either the first or last item of the matrix/vector is accessed.
The code is not transformed in case the it fits within the limited subset
of ESSL 1.00 given in Appendix A of the spec. If the code isn't within
the restricted subset, even ESSL 1.00 shaders may require this
workaround.
BUG=angleproject:1116
TEST=dEQP-GLES3.functional.shaders.indexing.* (all pass after change)
WebGL 2 conformance tests (glsl3/vector-dynamic-indexing.html)
Change-Id: I1d4b2e3888e91af7d5eebf743d12778698b6b903
Reviewed-on: https://chromium-review.googlesource.com/308770
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
3766a40d
|
2015-06-18T15:47:46
|
|
Remove dynamic indexing of matrices and vectors in HLSL
Re-landing after fixing D3D9 specific issues.
HLSL doesn't support dynamic indexing of matrices and vectors, so replace
that with helper functions that unroll dynamic indexing into switch/case
and static indexing.
Both the indexed vector/matrix expression and the index may have side
effects, and these will be evaluated correctly. If necessary, index
expressions that have side effects will be written to a temporary
variable that will replace the index.
Besides dEQP tests, this change is tested by a WebGL 2 conformance test.
In the case that a dynamic index is out-of-range, the base ESSL 3.00 spec
allows undefined behavior. KHR_robust_buffer_access_behavior adds the
requirement that program termination should not occur and that
out-of-range reads must return either a value from the active program's
memory or zero, and out-of-range writes should only affect the active
program's memory or do nothing. This patch clamps out-of-range indices so
that either the first or last item of the matrix/vector is accessed.
The code is not transformed in case the it fits within the limited subset
of ESSL 1.00 given in Appendix A of the spec. If the code isn't within
the restricted subset, even ESSL 1.00 shaders may require this
workaround.
BUG=angleproject:1116
TEST=dEQP-GLES3.functional.shaders.indexing.* (all pass after change)
WebGL 2 conformance tests (glsl3/vector-dynamic-indexing.html)
Change-Id: I66a5e5a8d7f4267da0045f1cc2ba6b0dc7eb3f5d
Reviewed-on: https://chromium-review.googlesource.com/296671
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tryjob-Request: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
80ecac9e
|
2015-08-25T15:37:48
|
|
Remove unused mOptimize/mDebug flags from TIntermAggregate
These flags were written but they were never read.
TEST=compile
BUG=angleproject:1116
Change-Id: I41e3e89f13861ebda4828c76c753ca17c74c4358
Reviewed-on: https://chromium-review.googlesource.com/294931
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
3c192a78
|
2015-08-26T20:32:53
|
|
Revert "Remove dynamic indexing of matrices and vectors in HLSL"
Seems to be failing a WebGL/ES2 CTS test in D3D9:
conformance/ogles/GL/mat3/mat3_001_to_006
BUG=angleproject:1116
BUG=525188
This reverts commit 83f3411da456faac8570892e3dd7d76edf4095e5.
Change-Id: Ic186f51240dbdd96ccab3f5470329cdc9727c618
Reviewed-on: https://chromium-review.googlesource.com/295730
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
83f3411d
|
2015-06-18T15:47:46
|
|
Remove dynamic indexing of matrices and vectors in HLSL
HLSL doesn't support dynamic indexing of matrices and vectors, so replace
that with helper functions that unroll dynamic indexing into switch/case
and static indexing.
Both the indexed vector/matrix expression and the index may have side
effects, and these will be evaluated correctly. If necessary, index
expressions that have side effects will be written to a temporary
variable that will replace the index.
Besides dEQP tests, this change is tested by a WebGL 2 conformance test.
In the case that a dynamic index is out-of-range, the base ESSL 3.00 spec
allows undefined behavior. KHR_robust_buffer_access_behavior adds the
requirement that program termination should not occur and that
out-of-range reads must return either a value from the active program's
memory or zero, and out-of-range writes should only affect the active
program's memory or do nothing. This patch clamps out-of-range indices so
that either the first or last item of the matrix/vector is accessed.
The code is not transformed in case the it fits within the limited subset
of ESSL 1.00 given in Appendix A of the spec. If the code isn't within
the restricted subset, even ESSL 1.00 shaders may require this
workaround.
BUG=angleproject:1116
TEST=dEQP-GLES3.functional.shaders.indexing.* (all pass after change)
WebGL 2 conformance tests (glsl3/vector-dynamic-indexing.html)
Change-Id: I024722ef4ca1e14d5ad47fdc540397e18858bed6
Reviewed-on: https://chromium-review.googlesource.com/290515
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
d7a25243
|
2015-08-18T13:49:45
|
|
Add deep copying support for typed AST nodes
Resubmit with inconsistent override warnings fixed.
Removing dynamic indexing of vectors and matrices will require copying
the indexed nodes in case they are written. Any type of l-value node that
doesn't have side effects may need to be copied. Add a copying function
for all typed node classes so that this copying can be performed.
Private copy constructors are used to implement the deepCopy function in
order to make maintenance easier. With copy constructors, each subclass
only needs to take care of copying its own members, and not the base
class members, which reduces the possibility of errors. Copy constructors
are disabled for all node classes that don't support deep copying by
inheriting TIntermNode from angle::NonCopyable.
Assignment operator is disabled for all node classes through inheriting
angle::NonCopyable. This applies also to classes that now get the private
copy constructor.
Explicit copy constructor and assignment operator declarations are added
to some classes which show up in node member variables to make code
clearer.
BUG=angleproject:1116
TEST=angle_unittests
Change-Id: I7964976f5dac7dfd745b8c6612ca06fb01d271c4
Reviewed-on: https://chromium-review.googlesource.com/295080
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
b5d61dac
|
2015-08-20T13:43:02
|
|
Revert "Add deep copying support for typed AST nodes"
This reverts commit d0d59aa4cbce2da92deaa0f4021dfed8885e8d01 and commit
760379532b02ae039790f1e8f1c89e03481aab4b
To be fixed will be the newline at the end of IntermNode_tests.cpp and
the -Winconsistent-missing-override
BUG=
Change-Id: I57693bdff01f9e3f03b2fbb5dc53fa21e68c2789
Reviewed-on: https://chromium-review.googlesource.com/294820
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
|
|
d0d59aa4
|
2015-08-18T13:49:45
|
|
Add deep copying support for typed AST nodes
Removing dynamic indexing of vectors and matrices will require copying
the indexed nodes in case they are written. Any type of l-value node that
doesn't have side effects may need to be copied. Add a copying function
for all typed node classes so that this copying can be performed.
Private copy constructors are used to implement the deepCopy function in
order to make maintenance easier. With copy constructors, each subclass
only needs to take care of copying its own members, and not the base
class members, which reduces the possibility of errors. Copy constructors
are disabled for all node classes that don't support deep copying by
inheriting TIntermNode from angle::NonCopyable.
Assignment operator is disabled for all node classes through inheriting
angle::NonCopyable. This applies also to classes that now get the private
copy constructor.
Explicit copy constructor and assignment operator declarations are added
to some classes which show up in node member variables to make code
clearer.
BUG=angleproject:1116
TEST=angle_unittests
Change-Id: Ia757b69397837f8309f0e7511c0cd24ca2c7a721
Reviewed-on: https://chromium-review.googlesource.com/293931
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
59f9a641
|
2015-08-06T20:38:26
|
|
Remove EOpInternalFunctionCall
It's cleaner to mark internal functions by using the TName class,
similarly to TIntermSymbol.
TEST=angle_unittests
BUG=angleproject:1116
Change-Id: I12a03a3dea42b3fc571fa25a1b11d0161f24de72
Reviewed-on: https://chromium-review.googlesource.com/291621
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
4d61f7ed
|
2015-08-12T10:56:50
|
|
Reland Fixed compiler warning C4267 'conversion from 'size_t' to 'type', possible loss of data'
Additional warnings found with more testing and added C4267 warning disable only for angle_libpng
BUG=angleproject:1120
Change-Id: Ic403dcff5a8018056fa51a8c408e64207f3362eb
Reviewed-on: https://chromium-review.googlesource.com/293028
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
|
|
b195643c
|
2015-08-12T17:35:20
|
|
Revert "Fixed compiler warning C4267 'conversion from 'size_t' to 'type', possible loss of data'"
Seems to have quite a few warnings in 64-bit on my machine.
BUG=angleproject:1120
This reverts commit c5cf9bc47d0ee028adbbf9e9f94ca567eec601dc.
Change-Id: I86768b900aeba52e7a2242d9ae8949f93f1a5ba9
Reviewed-on: https://chromium-review.googlesource.com/293280
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
c5cf9bc4
|
2015-08-06T10:46:48
|
|
Fixed compiler warning C4267 'conversion from 'size_t' to 'type', possible loss of data'
BUG=angleproject:1120
Change-Id: I01ef10bea7f487c2b394d030c76628f38d2ea645
Reviewed-on: https://chromium-review.googlesource.com/292780
Tested-by: Cooper Partin <coopp@microsoft.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
07e57df7
|
2015-06-16T16:55:52
|
|
Added non square matrix construction
Added new construction operations for
non square matrices, along with the
required changes to the related
translation functions.
Change-Id: I04ae7d4b2d1bb363b35d088cea45c0e7c4bc8a13
Reviewed-on: https://chromium-review.googlesource.com/277729
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
|
|
0c5409f8
|
2015-07-08T15:17:53
|
|
Support constant folding of fragment processing built-ins
This change adds constant folding support for following derivative
functions:
- dFdx, dFdy and fwidth.
As per spec, derivatives of constant arguments should be 0, so this
change just sets result components to zero when the above operations
are performed on constant argument.
BUG=angleproject:913
TEST=dEQP Tests
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.
fragment_processing.*
(All 12 tests started passing with this change.)
Change-Id: I67b7c5abd970b740e15e3bd1ee56721e81bbecc4
Reviewed-on: https://chromium-review.googlesource.com/283759
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
551279e5
|
2015-07-07T18:18:23
|
|
Support constant folding of more common built-ins
This change adds const folding support for below mentioned common
built-ins:
- isnan, ininf, floatBitsToInt, floatBitsToUint,
intBitsToFloat and uintBitsToFloat
BUG=angleproject:913
TEST=angle_unittests(new: MathUtilTest.isNan/inInf), dEQP Tests
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.common.*
(20 more tests started passing with this change)
Change-Id: Ifdedb251cd8b183b4999314c0f5de857bc20702f
Reviewed-on: https://chromium-review.googlesource.com/283767
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
ab2b9a23
|
2015-07-06T18:27:56
|
|
Refactor unary operation constant folding code
This change splits TIntermConstantUnion::foldUnary into two
functions:
- foldUnaryWithDifferentReturnType:
- Handles constant folding of operations where the return
type has a different number of components compared to the
operand type.
- foldUnaryWithSameReturnType:
- Handles constant folding of unary operations where the
return type is the same as operand type.
BUG=angleproject:913
TEST=angle_unittests, dEQP Tests
(dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.*)
Change-Id: I675891138d4e17fd2390c03e9f710e0be0b7c7b6
Reviewed-on: https://chromium-review.googlesource.com/283464
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
cdfa8f50
|
2015-06-30T17:48:25
|
|
Constant fold float pack/unpack functions
This change adds constant folding support for following floating
point pack and unpack functions:
- packSnorm2x16, unpackSnorm2x16, packUnorm2x16, unpackUnorm2x16,
packHalf2x16, and unpackHalf2x16.
BUG=angleproject:913
TEST=angle_unittests(new: MathUtilTest.packAndUnpack*), dEQP Tests
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.float_pack_unpack.*
(all 10 tests started passing with this change)
Change-Id: I2b69faebee4127e5e13900b3a9485b7145950277
Reviewed-on: https://chromium-review.googlesource.com/282683
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
7fa3355f
|
2015-06-10T15:15:18
|
|
Add constant folding support for matrix built-ins
This change adds constant folding support for following matrix
built-ins:
- matrixCompMult, outerProduct, transpose, determinant and
inverse.
BUG=angleproject:913
TEST=angle_unittests(new: MatrixUtilsTest, ConstantFoldingTest.*Matrix*),
dEQP Tests:
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.matrix.*
(All 54 tests started passing with this change)
Change-Id: I7b9bf04b9a2cbff72c48216cab04df58c5f008d6
Reviewed-on: https://chromium-review.googlesource.com/276574
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
a4aa4e30
|
2015-06-04T15:54:30
|
|
Record precision of constant variables when needed
Add a traverser that checks precision qualifiers of folded constants and
hoists them to separate precision qualified variables if needed.
Fixes sdk/tests/conformance/glsl/bugs/constant-precision-qualifier.html
TEST=WebGL conformance tests, angle_unittests
BUG=angleproject:817
Change-Id: I1639595e0e49470736be93274f0af07ee732e1fe
Reviewed-on: https://chromium-review.googlesource.com/275095
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
b43846ee
|
2015-06-02T18:18:57
|
|
Unify aggregate operator folding with other constant folding
Setting the type for folded aggregate nodes should work in a similar way
as other constant folding. Common functionality between the different
folding functions is refactored into a single function.
TEST=dEQP-GLES3.functional.shaders.constant_expressions.*
BUG=angleproject:817
Change-Id: Ie0be561f4a30e52e52d570ff0b2bdb426f6e4f7a
Reviewed-on: https://chromium-review.googlesource.com/275186
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
95310b00
|
2015-06-02T17:43:38
|
|
Unify unary operator folding with binary operator folding
Implement unary operator folding in a similar way to binary operator
folding, so that the code is easier to understand.
TEST=dEQP-GLES3.functional.shaders.constant_expressions.*
BUG=angleproject:817
Change-Id: I069bdb38f965e1badb3e8f3f954386b205b7bb00
Reviewed-on: https://chromium-review.googlesource.com/275185
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
2c4b746c
|
2015-06-08T11:30:31
|
|
Revert "Revert "Make sure type gets set consistently in folded binary operations""
This patch was originally reverted only because a dependency patch failed a
buggy Chromium test.
This reverts commit aebd002d00d39858819c58bad1970df121b78e1b.
TEST=dEQP-GLES3.functional.shaders.constant_expressions.*
BUG=angleproject:817
Change-Id: Ia5acf15518ea89717c0cfe1398cb18ea27be5b19
Reviewed-on: https://chromium-review.googlesource.com/275811
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
1155ddd2
|
2015-06-05T18:04:36
|
|
Revert "Revert "Add constant folding support for geometric built-ins""
Revert of revert as the issue is with the failing test itself.
This reverts commit b3da45c12d3eecdd319c0feb4d2b933e144f816a.
Change-Id: Ie2003c78527f87cad7f8ead0d87fee75ce032379
Reviewed-on: https://chromium-review.googlesource.com/275487
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
b3da45c1
|
2015-06-04T19:38:22
|
|
Revert "Add constant folding support for geometric built-ins"
This is failing gpu_unittests on Mac:
ShaderTranslatorTest.BuiltInFunctionEmulation:
../../gpu/command_buffer/service/shader_translator_unittest.cc:314: Failure
Value of: strstr(translated_source.c_str(), "webgl_dot_emu") != NULL
Actual: false
Expected: true
Reverting until we can fix the overly-narrow test.
BUG=angleproject:913
This reverts commit b50788d11dec046415565af1cc7da334e2979577.
Change-Id: I5bd9df83704e771e419339745eceaa43a20bd1e6
Reviewed-on: https://chromium-review.googlesource.com/275320
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
aebd002d
|
2015-06-04T19:43:44
|
|
Revert "Make sure type gets set consistently in folded binary operations"
This is blocking the revert of the geometric constant folding
patch, which is breaking gpu_unittests and blocking the roll.
BUG=angleproject:817
This reverts commit b07aba0798d3bba3118dac78933e73b3f08a601b.
Change-Id: Ia00fc45b1ddd9d3c079742dea0627aa12304f93b
Reviewed-on: https://chromium-review.googlesource.com/275321
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
b07aba07
|
2015-05-29T12:19:19
|
|
Make sure type gets set consistently in folded binary operations
Add a wrapper function that handles creating the folded node and setting the
right parameters on it, so that the folding function handles only
calculating the folded values.
This will fix the precision set to constant folded values in some cases.
Previously the precision was always set to be equal to one of the operands
to the binary operation, but now both operands are taken into account.
Folding binary operations is now in a separate function from folding unary
operations.
TEST=dEQP-GLES3.functional.shaders.constant_expressions.*
BUG=angleproject:817
Change-Id: Id97e765173c6110f49607e21c3fb90019b1ebac7
Reviewed-on: https://chromium-review.googlesource.com/274001
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
b50788d1
|
2015-05-25T19:20:26
|
|
Add constant folding support for geometric built-ins
* re-land after mac compilation fix (unsupported c++11 initializer) *
This change adds constant folding support for following geometric
built-ins:
- length, distance, dot, cross, normalize, faceforward,
reflect and refract.
BUG=angleproject:913
TEST=angle_unittests, dEQP Tests
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.geometric.*
(56 tests started passing with this change)
Change-Id: I236fc0c1af47a63f359564500c711e6bedf1c808
Reviewed-on: https://chromium-review.googlesource.com/274789
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
8f76bcc4
|
2015-06-02T13:54:20
|
|
Add unit test for RemovePow
Add two versions of the test - one with a single pow(), and another with
a nested pow().
TEST=angle_unittests
BUG=477306
Change-Id: Idb38e57a4b2522b7794996d6ea0f0456b349abf7
Reviewed-on: https://chromium-review.googlesource.com/274736
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
2f4823bf
|
2015-06-03T12:39:22
|
|
Revert "Add constant folding support for geometric built-ins"
Breaks Mac build because of C++11 init syntax:
FAILED: /b/build/goma/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/third_party/angle/src/tests/compiler_tests/angle_unittests.ConstantFolding_test.o.d -DV8_DEPRECATION_WARNINGS -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=238013-3 -DCOMPONENT_BUILD -DTOOLKIT_VIEWS=1 -DUSE_LIBJPEG_TURBO=1 -DENABLE_ONE_CLICK_SIGNIN -DENABLE_PRE_SYNC_BACKUP -DENABLE_REMOTING=1 -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DUSE_PROPRIETARY_CODECS -DENABLE_PEPPER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_NOTIFICATIONS -DENABLE_HIDPI=1 -DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE -DDONT_EMBED_BUILD_METADATA -DDCHECK_ALWAYS_ON=1 -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PLUGIN_INSTALLATION=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_BACKGROUND=1 -DENABLE_GOOGLE_NOW=1 -DCLD_VERSION=2 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_SERVICE_DISCOVERY=1 -DENABLE_WIFI_BOOTSTRAPPING=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DSAFE_BROWSING_SERVICE -DGTEST_HAS_POSIX_RE=0 -DGTEST_LANG_CXX11=0 -DGL_APICALL= -DGL_GLEXT_PROTOTYPES= -DEGLAPI= '-DANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ "d3dcompiler_47.dll", "d3dcompiler_46.dll", "d3dcompiler_43.dll" }' -DANGLE_TRANSLATOR_STATIC -DUSE_LIBPCI=1 -DUSE_OPENSSL=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -Igen -I../.. -I../../third_party/angle/include -I../../third_party/angle/src -I../../third_party/angle/src/compiler/preprocessor -I../../third_party/angle/src/tests -Igen/angle -I../../testing/gmock/include -I../../testing/gtest/include -isysroot /Applications/Xcode5.1.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -O0 -gdwarf-2 -fvisibility=hidden -Werror -Wnewline-eof -mmacosx-version-min=10.6 -arch x86_64 -Wall -Wendif-labels -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-selector-type-mismatch -Wpartial-availability -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -std=c++11 -fno-rtti -fno-exceptions -fvisibility-inlines-hidden -fno-threadsafe-statics -Xclang -load -Xclang /b/build/slave/GPU_Mac_Builder__dbg_/build/src/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-templates -fcolor-diagnostics -fno-strict-aliasing -fstack-protector-all -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -c ../../third_party/angle/src/tests/compiler_tests/ConstantFolding_test.cpp -o obj/third_party/angle/src/tests/compiler_tests/angle_unittests.ConstantFolding_test.o
../../third_party/angle/src/tests/compiler_tests/ConstantFolding_test.cpp:210:43: error: no matching constructor for initialization of 'std::vector<float>'
ASSERT_FALSE(constantVectorFoundInAST(std::vector<float>{1.0f, 1.0f, 1.0f}));
^ ~~~~~~~~~~~~~~~~~~
BUG=angleproject:913
This reverts commit 2decb4b1557a57a5a74e3ab98d8b25f9fc0f8557.
Change-Id: Iaf3c61a0c0ed591c17f50f2e3eafe2debf588c95
Reviewed-on: https://chromium-review.googlesource.com/274917
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
2decb4b1
|
2015-05-25T19:20:26
|
|
Add constant folding support for geometric built-ins
This change adds constant folding support for following geometric
built-ins:
- length, distance, dot, cross, normalize, faceforward,
reflect and refract.
BUG=angleproject:913
TEST=angle_unittests, dEQP Tests
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.geometric.*
(56 tests started passing with this change)
Change-Id: I973689554bb8c30ee3ebdf71f1b8a051ceb5e0cf
Reviewed-on: https://chromium-review.googlesource.com/273097
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
9d0b1f9b
|
2015-05-20T14:27:17
|
|
Constant fold vector relational built-ins
This change adds constant folding support for vector relational
built-ins.
BUG=angleproject:913
TEST=dEQP Tests
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.vector_relational*
(Fixes all 138 tests)
Change-Id: I291e332f2afb3ce3d6596e634f509995dbf35164
Reviewed-on: https://chromium-review.googlesource.com/272344
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
081c3f2e
|
2015-05-25T15:43:35
|
|
Report warning whenever constant folding results are undefined
With recent constant folding changes, we are reporting warnings
whenever constant folding results are undefined for values passed in,
this change adds that warning at all the places where it was missing.
BUG=angleproject:913
TEST=dEQP Tests, angle_unittests
Change-Id: Ief8380488e2a4807c91ddac06d342cb172433b9d
Reviewed-on: https://chromium-review.googlesource.com/272879
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
d4f303ee
|
2015-05-20T17:09:06
|
|
Refactoring: Make creating temporary symbols in AST traversal reusable
Temporary symbols will also be needed to store temporary arrays when complex
array expressions are unfolded.
Also clear tree update related structures at the end of updateTree(), so that
the traverser can be reused for several rounds of replacement more easily, and
remove unnecessary InVisit step from UnfoldShortCircuitToIf.
BUG=angleproject:971
TEST=angle_end2end_tests, WebGL conformance tests
Change-Id: Iecdd3008d43f01b02fe344ccde8614f70e6c0c65
Reviewed-on: https://chromium-review.googlesource.com/272121
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
bf790420
|
2015-05-18T17:53:04
|
|
Add constant folding support for more built-ins
This change adds constant folding support for following built-ins:
- atan(two arguments), pow, mod, mix, step and smoothstep.
BUG=angleproject:913
TEST=dEQP tests
Following 80 tests from dEQP-GLES3.functional.shaders.constant_expressions
started passing with this change:
- builtin_functions.angle_and_trigonometry.atan_separate*
- builtin_functions.exponential.pow_*
- builtin_functions.common.mod_*
- builtin_functions.common.mix_*
- builtin_functions.common.step_*
- builtin_functions.common.smoothstep_*
Change-Id: I70f0a8837a82c480da8cff3f1382c6252a486fe4
Reviewed-on: https://chromium-review.googlesource.com/271753
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
274f0709
|
2015-05-05T13:33:30
|
|
Add constant folding support for min,max and clamp
This change adds necessary mechanism to support constant folding of
built-ins that take more than one parameter and also adds constant
folding support for min, max and clamp built-ins.
BUG=angleproject:913
TESTS=dEQP tests
(126 tests started passing with this change)
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.common.min_*
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.common.max_*
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.common.clamp_*
Change-Id: Iccc9bf503a536f2e3c144627e64572f2f95db9db
Reviewed-on: https://chromium-review.googlesource.com/271251
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
a6f22096
|
2015-05-08T18:31:10
|
|
Make UnfoldShortCircuit to change AST instead of writing output
This is needed to make way for further AST transformations to handle array
expressions that need to work correctly together with unfolding short-
circuiting operators. This also improves the maintainability of HLSL output
by isolating the unfolding into a separate compilation step.
The new version of UnfoldShortCircuit traverser will traverse the tree until
an expression that needs to be unfolded is encountered. It then unfolds it and
gets reset. The traverser will be run repeatedly until no more operations to
unfold are found. This helps with keeping the traverser's design relatively
simple.
All declarations are separated to single declarations before short-circuit
unfolding is run. Previously OutputHLSL already output every declaration
separately.
BUG=angleproject:960
TEST=WebGL conformance tests, angle_unittests, angle_end2end_tests
Change-Id: Id769be396adbd4c0223e418980dc464dd855f019
Reviewed-on: https://chromium-review.googlesource.com/270460
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
95d34aaf
|
2015-05-13T19:44:31
|
|
Revert "Add constant folding support for min,max and clamp"
This reverts commit 1137a2a6b4a68fe3f7497bb9289975b030576372.
Change-Id: I1493c2706e5f08a9f0001835e663a147be85a303
Reviewed-on: https://chromium-review.googlesource.com/270782
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
|
|
1137a2a6
|
2015-05-05T13:33:30
|
|
Add constant folding support for min,max and clamp
This change adds necessary mechanism to support constant folding of
built-ins that take more than one parameter and also adds constant
folding support for min, max and clamp built-ins.
BUG=angleproject:913
TESTS=dEQP tests
(126 tests started passing with this change)
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.common.min_*
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.common.max_*
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.common.clamp_*
Change-Id: I5d3e96ef2062116cbf164a7a42cba096bd4d5389
Reviewed-on: https://chromium-review.googlesource.com/269317
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
b11e2483
|
2015-05-04T14:21:22
|
|
translator: Fix validation sometimes modifying builtins.
When validating some shaders with out-of-bounds array indexes,
we would write the sanitized index into the global symbol table.
We would then overwrite a wrong value for the builtin. This
fixes the WebGL test extensions/webgl-draw-buffers-max-draw-buffers.
Also mark const on as many uses ConstantUnion as we can.
BUG=angleproject:993
Change-Id: I110efaf1b7b0158b08b704277e3bc2472437902c
Reviewed-on: https://chromium-review.googlesource.com/268962
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
6ba6eadc
|
2015-05-04T14:21:21
|
|
Rename ConstantUnion to TConstantUnion.
This clarified that we're using the Pool allocator/deallocator for
this type.
BUG=angleproject:993
Change-Id: If8c95f6054d07291e7014be0d4e35766ba2e943b
Reviewed-on: https://chromium-review.googlesource.com/269131
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
d57e0db3
|
2015-04-24T15:05:08
|
|
Remove separate compilerdebug.h in favor of debug.h
This unifies the behavior across the compiler and rest of ANGLE - for
example, one can use #define ANGLE_TEST_CONFIG to disable UNIMPLEMENTED
asserts in both the compiler and the rest of ANGLE. Compiler traces from
asserts also go to the same TRACE_OUTPUT_FILE as other traces instead of
being directed through ParseContext.
The compiler build already includes the common sources, so no changes to
build config are needed.
The original version of this change was reverted due to release mode
build issues. This version adds UNUSED_ASSERTION_VARIABLE where needed.
TEST=angle_unittests, angle_end2end_tests,
dEQP-GLES3.functional.shaders.*
BUG=angleproject:983
Change-Id: I36929020a04251b8bc834fbb3c069e10128c3082
Reviewed-on: https://chromium-review.googlesource.com/267411
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
2cb7b835
|
2015-04-23T20:27:44
|
|
Clean up binary operation constant folding code
Fix mixed up comments, remove unnecessary type conversions, clarify
variable names and improve formatting in a few places.
TEST=angle_unittests, WebGL conformance tests
BUG=angleproject:913
Change-Id: Ice8fe3682d8e97f42747752302a1fba116132df4
Reviewed-on: https://chromium-review.googlesource.com/266843
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
8fee0ab8
|
2015-04-23T14:52:46
|
|
Fix build regression on Linux
Chromium's Linux toolchain doesn't implement the return value of
std::vector::insert correctly, causing a build failure. Remove an
unnecessary assignment of the return value to fix this build regression.
The regression was caused by the commit:
"Put each array declarator into a separate declaration in HLSL output"
TEST=angle_unittests
Change-Id: I2959122d28e4c7e6d6a4d842a97a8f1fd4f27ca1
Reviewed-on: https://chromium-review.googlesource.com/266990
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
fc0e2bc0
|
2015-04-16T13:39:56
|
|
Put each array declarator into a separate declaration in HLSL output
Since HLSL doesn't support arrays as l-values, HLSL output needs to split
declarators that initialize arrays to variable declaration and assignment
implemented via a function call. To prepare for this, it is necessary that each
declarator has its own declaration.
BUG=angleproject:941
TEST=angle_end2end_tests, WebGL conformance tests
Change-Id: I43dee487578561c01dbde90c2f55a93dda2f057a
Reviewed-on: https://chromium-review.googlesource.com/266001
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
28eb65e3
|
2015-04-06T17:29:48
|
|
Support constant folding of exponential built-ins
This change adds constant folding support for unary exponential
built-ins - exp, log, exp2, log2, sqrt and inversesqrt.
BUG=angleproject:913
TEST= dEQP tests
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.exponential*
(48 out of 56 tests started passing with this change)
Change-Id: I4b98782c4c4b72dd7d60dfc4f18ba6961526ec41
Reviewed-on: https://chromium-review.googlesource.com/266797
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
fddc211a
|
2015-04-22T13:28:10
|
|
Revert "Revert "Use nullptr consistently in TIntermConstantUnion::fold""
Revert of revert as the new changes that use nullptr in fold function
are already in.
This reverts commit b775778a050739c4d802da8db7edb8c865602950.
Change-Id: Ifbdb35264132c66e5d1f2379932839b99291c54a
Reviewed-on: https://chromium-review.googlesource.com/266803
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
97dc22e0
|
2015-04-06T17:35:38
|
|
Support constant folding of common built-ins
This change adds constant folding support for unary common built-ins:
abs, sign, floor, trunc, round, roundEven, ceil and fract.
BUG=angleproject:913
TEST= dEQP tests
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.common*
(80 out of 210 tests started passing with this change)
Change-Id: I46312fec43084601d4fca8195ddaaa5292f1c02a
Reviewed-on: https://chromium-review.googlesource.com/265967
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
8d95b741
|
2015-04-17T18:44:13
|
|
Revert "Support constant folding of exponential built-ins"
Causing compile errors on Android:
../../third_party/angle/src/compiler/translator/IntermNode.cpp:1309:62: error: use of undeclared identifier 'log2f'
else if (!foldFloatTypeUnary(unionArray[i], &log2f, infoSink, &tempConstArray[i]))
This reverts commit 1623a1b90f24cd1afd8839c0726ad276a887fbda.
Change-Id: If9c45aea85801eb11e7d1513b4183ec11289d2f3
Reviewed-on: https://chromium-review.googlesource.com/266154
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
1623a1b9
|
2015-04-06T17:29:48
|
|
Support constant folding of exponential built-ins
This change adds constant folding support for unary exponential
built-ins - exp, log, exp2, log2, sqrt and inversesqrt.
BUG=angleproject:913
TEST= dEQP tests
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.exponential*
(48 out of 56 tests started passing with this change)
Change-Id: I63133ee8c04c4a8d6cb30da5788e9227c05d4cbe
Reviewed-on: https://chromium-review.googlesource.com/266071
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
9dea48f3
|
2015-04-02T11:45:09
|
|
Support constant folding of trigonometry built-ins
This change adds constant folding support for trigonometry built-in
functions. Constant folding for these functions also fixes constant
expression issues where constant initializer is a built-in trignometry
function whose arguments are all constant expressions.
BUG=angleproject:913
TEST= dEQP tests
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.angle_and_trigonometry*
(112 out of 120 tests pass with this change)
Change-Id: I2b7a61320819dcd095827faa1fd16e835f4688b4
Reviewed-on: https://chromium-review.googlesource.com/265819
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
cd94ef96
|
2015-04-16T19:18:10
|
|
Fix style issues in updateTree()
"entry" is an old C keyword, so it's better not to use it as a variable name.
Also fix a few other minor style issues in the code.
TEST=angle_unittests
BUG=angleproject:941
Change-Id: I59470555227985262b3e914ff6ca11e88d15fd8c
Reviewed-on: https://chromium-review.googlesource.com/265647
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
bc709339
|
2015-04-14T15:32:19
|
|
Revert "Support constant folding of trigonometry built-ins"
Part of a chain causing compile errors on Mac. Example:
../../third_party/angle/src/compiler/translator/IntermNode.cpp:1216:89: error: no member named 'sin' in namespace 'std'; did you mean 'sinf'?
http://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Linux%20Builder/builds/33747
This reverts commit 1767e6b4f9148a6aa462d23e3838810c0080ce78.
Change-Id: Ie39b1bf9a08da61aa0b16e219b34d1ba0b6f6c0f
Reviewed-on: https://chromium-review.googlesource.com/265587
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
3c772f36
|
2015-04-14T15:30:45
|
|
Revert "Support constant folding of exponential built-ins"
Part of a chain causing compile errors on Mac. Example:
../../third_party/angle/src/compiler/translator/IntermNode.cpp:1216:89: error: no member named 'sin' in namespace 'std'; did you mean 'sinf'?
http://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Linux%20Builder/builds/33747
This reverts commit 62e2c8d2bc55c41db4e6095eac012b8861131585.
Change-Id: Id20f7f4efbc3df7756161b192d4858caeeb0572f
Reviewed-on: https://chromium-review.googlesource.com/265627
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
d1e9a0f4
|
2015-04-14T15:30:16
|
|
Revert "Support constant folding of common built-ins"
Part of a chain causing compile errors on Mac. Example:
../../third_party/angle/src/compiler/translator/IntermNode.cpp:1216:89: error: no member named 'sin' in namespace 'std'; did you mean 'sinf'?
http://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Linux%20Builder/builds/33747
This reverts commit 2b1da6ed1dbe5960bed8c1b2fa3d33cb00c6c116.
Change-Id: I5d48932a6254d6d1e78966bb3891913d9450e08e
Reviewed-on: https://chromium-review.googlesource.com/265612
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
b775778a
|
2015-04-14T15:29:29
|
|
Revert "Use nullptr consistently in TIntermConstantUnion::fold"
Part of a chain causing compile errors on Mac. Example:
../../third_party/angle/src/compiler/translator/IntermNode.cpp:1216:89: error: no member named 'sin' in namespace 'std'; did you mean 'sinf'?
http://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Linux%20Builder/builds/33747
This reverts commit 72ed20d4bb5a5c55d9909d6cc9b7a0e89e4a81a2.
Change-Id: Ia6119f6081b3184deef3deef25b9e3f43ff2e2a6
Reviewed-on: https://chromium-review.googlesource.com/265586
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
72ed20d4
|
2015-04-08T14:26:25
|
|
Use nullptr consistently in TIntermConstantUnion::fold
Newly added code in TIntermConstantUnion::fold uses nullptr where as
remaining part of the function uses NULL. This change removes NULL and
consistently uses nullptr in complete function.
Change-Id: I600dcf11b686d8d72b2bcdac88b7158288c68105
Reviewed-on: https://chromium-review.googlesource.com/265395
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
2b1da6ed
|
2015-04-06T17:35:38
|
|
Support constant folding of common built-ins
This change adds constant folding support for unary common built-ins:
abs, sign, floor, trunc, round, roundEven, ceil and fract.
BUG=angleproject:913
TEST= dEQP tests
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.common*
(80 out of 210 tests started passing with this change)
Change-Id: I06800ed0e03764c0f7aab6bcd45c4f122de5a3c1
Reviewed-on: https://chromium-review.googlesource.com/265394
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
62e2c8d2
|
2015-04-06T17:29:48
|
|
Support constant folding of exponential built-ins
This change adds constant folding support for unary exponential
built-ins - exp, log, exp2, log2, sqrt and inversesqrt.
BUG=angleproject:913
TEST= dEQP tests
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.exponential*
(48 out of 56 tests started passing with this change)
Change-Id: Ie7808cd57d6ed7598c642a9a0940b8f5bd293741
Reviewed-on: https://chromium-review.googlesource.com/265393
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
1767e6b4
|
2015-04-02T11:45:09
|
|
Support constant folding of trigonometry built-ins
This change adds constant folding support for trigonometry built-in
functions. Constant folding for these functions also fixes constant
expression issues where constant initializer is a built-in trignometry
function whose arguments are all constant expressions.
BUG=angleproject:913
TEST= dEQP tests
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.angle_and_trigonometry*
(112 out of 120 tests pass with this change)
Change-Id: I66275b2ae9faecef63d76763d21a9b67d9bb68fa
Reviewed-on: https://chromium-review.googlesource.com/265392
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
b4a058bb
|
2015-04-10T14:50:51
|
|
Revert "Support constant folding of trigonometry built-ins"
Part of a chain breaking the clang build:
http://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Linux%20Builder/builds/33588
This reverts commit af930db15010cacfcdc74bee630372b8f6eb3eeb.
Change-Id: Ic0bf09b4088a1ee285fed0fbd77dfc4c682fcd12
Reviewed-on: https://chromium-review.googlesource.com/265144
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
50b7178d
|
2015-04-10T14:50:15
|
|
Revert "Support constant folding of exponential built-ins"
Part of a chain breaking the clang build:
http://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Linux%20Builder/builds/33588
This reverts commit 1c89caef47a27c63a7d0f988e74816692a9b9b39.
Change-Id: I36e080d8f64d4d4ca5de04bebbd119db83956d0e
Reviewed-on: https://chromium-review.googlesource.com/265185
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
3cf271fe
|
2015-04-10T14:49:36
|
|
Revert "Support constant folding of common built-ins"
Part of a chain breaking the clang build:
http://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Linux%20Builder/builds/33588
This reverts commit 0273c68c507a10af3e45c6e4a52a44adcd0cf742.
Change-Id: I00d7617a7c380f2a5ea3f38ec14948a598aa5c1a
Reviewed-on: https://chromium-review.googlesource.com/265184
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
7c9e8c96
|
2015-04-10T14:48:08
|
|
Revert "Use nullptr consistently in TIntermConstantUnion::fold"
Part of a chain breaking the clang build:
http://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Linux%20Builder/builds/33588
This reverts commit 5f2feee42971fdbbd7cb389fffe2f632060ec6e3.
Change-Id: I5ad54b05148ae2d4f19e50a67aded2bad4f55f91
Reviewed-on: https://chromium-review.googlesource.com/265143
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
5f2feee4
|
2015-04-08T14:26:25
|
|
Use nullptr consistently in TIntermConstantUnion::fold
Newly added code in TIntermConstantUnion::fold uses nullptr where as
remaining part of the function uses NULL. This change removes NULL and
consistently uses nullptr in complete function.
Change-Id: Ieaada3cf46bf3e16d3ef91b300c86537f778c33f
Reviewed-on: https://chromium-review.googlesource.com/264632
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
0273c68c
|
2015-04-06T17:35:38
|
|
Support constant folding of common built-ins
This change adds constant folding support for unary common built-ins:
abs, sign, floor, trunc, round, roundEven, ceil and fract.
BUG=angleproject:913
TEST= dEQP tests
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.common*
(80 out of 210 tests started passing with this change)
Change-Id: I09f2f99b3108e0d2fb1919a0631e4317b6a28be3
Reviewed-on: https://chromium-review.googlesource.com/263709
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
1c89caef
|
2015-04-06T17:29:48
|
|
Support constant folding of exponential built-ins
This change adds constant folding support for unary exponential
built-ins - exp, log, exp2, log2, sqrt and inversesqrt.
BUG=angleproject:913
TEST= dEQP tests
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.exponential*
(48 out of 56 tests started passing with this change)
Change-Id: I22af56876d1b7ce305697bf9bf43ad9ec5d8a3a5
Reviewed-on: https://chromium-review.googlesource.com/263708
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
af930db1
|
2015-04-02T11:45:09
|
|
Support constant folding of trigonometry built-ins
This change adds constant folding support for trigonometry built-in
functions. Constant folding for these functions also fixes constant
expression issues where constant initializer is a built-in trignometry
function whose arguments are all constant expressions.
BUG=angleproject:913
TEST= dEQP tests
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.angle_and_trigonometry*
(112 out of 120 tests pass with this change)
Change-Id: I2ed4360532469fe0d70048d5f2300a8db6f9fcda
Reviewed-on: https://chromium-review.googlesource.com/263679
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
794e0009
|
2015-04-07T18:31:54
|
|
Fix and enable warning C4244 (Conversion from 'type1' to 'type2', possible loss of data)
Change-Id: Id0e06d7d6600344d858f00dabc219d79289bbc82
Reviewed-on: https://chromium-review.googlesource.com/265020
Tested-by: Minmin Gong <mgong@microsoft.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
b3584fb4
|
2015-04-09T17:34:21
|
|
Revert "Fix and enable warning C4244 (Conversion from 'type1' to 'type2', possible loss of data)"
Causing a build failure on Mac/Clang:
./Tokenizer.cpp:551:7: error: extra tokens at end of #else directive [-Werror,-Wextra-tokens]
#else if defined(_MSC_VER)
http://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Mac%20Builder/builds/29136
This reverts commit 3b26e231d99154814eb428f75a67bbe7a21adadc.
Change-Id: I2d11ddcc18130d908fd2ec3d6f5ab890cfccd5e7
Reviewed-on: https://chromium-review.googlesource.com/264983
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
3b26e231
|
2015-04-07T18:31:54
|
|
Fix and enable warning C4244 (Conversion from 'type1' to 'type2', possible loss of data)
Change-Id: I73d9a2b9ad16f032be974b9c819de0dc1247c2ea
Reviewed-on: https://chromium-review.googlesource.com/264533
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
f6c694bc
|
2015-03-26T14:50:53
|
|
Assign built-in function return type in promote()
This finishes the refactoring of unary math operation handling so that
IntermUnary::promote has the complete code for setting the return type of
the node.
BUG=angleproject:952
TEST=angle_unittests, WebGL conformance tests
Change-Id: I19bd8d53029e24f734c9436eceb446b37e7fcf26
Reviewed-on: https://chromium-review.googlesource.com/262416
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
dca3e796
|
2015-03-26T13:24:04
|
|
Refactor unary math operator handling to clarify responsibilities
Shuffle the code around so that each part has a clear responsibility:
IntermUnary::promote is responsible for setting the return type of the
node, Intermediate::addUnaryMath is responsible for creating the node
object, and ParseContext::createUnaryMath is responsible for validating
the operand type.
This removes duplicated bool type check for logical not.
BUG=angleproject:952
TEST=angle_unittests, WebGL conformance tests
Change-Id: I9f5a0abb6434ad2730441ea9199ec3f5382ebcda
Reviewed-on: https://chromium-review.googlesource.com/262415
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
47fd36a7
|
2015-03-19T14:22:24
|
|
Move some validation from IntermBinary::promote to ParseContext
This makes the role of promote() in the system clearer and helps to make
the code more understandable, since more of the checks are in the same
logical place.
BUG=angleproject:952
TEST=angle_unittests, WebGL conformance tests
Change-Id: Idb2de927d872e46210d71cf6de06a6f8c1fc5da1
Reviewed-on: https://chromium-review.googlesource.com/260803
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
e79904c3
|
2015-03-18T16:56:42
|
|
Accept equality and assignment for arrays in parsing
This is enough to support the operations in GLSL output. HLSL output will
likely require additional work to support this.
BUG=angleproject:941
Change-Id: I728d511ab07af94bc3382dc2796c1e9ac79d1442
Reviewed-on: https://chromium-review.googlesource.com/260801
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
d6b14287
|
2015-03-17T14:31:35
|
|
Move binary op array check to ParseContext
Also piece together an addAssign function in ParseContext that uses the
binary op array check. This will make it easier to change the
array-related checks in the future to use shaderVersion. Moving
validation out from IntermBinary::promote also makes the architecture
clearer, promote()'s role should be mainly to determine the type of the
return value of the binary operation, not to do validation.
BUG=angleproject:941
TEST=angle_unittests, WebGL conformance tests
Change-Id: If1de33ea250893527be7f0d7930d4678a0864684
Reviewed-on: https://chromium-review.googlesource.com/260571
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
a3a36664
|
2015-02-17T13:46:51
|
|
Implement parsing switch statements
Put in some groundwork for parsing switch statements and case labels in
the parser, including definitions for IntermNode classes. Intermediate
functions for adding the statements are stubbed to only generate errors
for now.
Tested by manually disabling shading language version checks for switch
in a Chromium build and checking that the expected errors are generated.
BUG=angle:921
Change-Id: I064b3e0c4c1b724a083cf5bc78eebfdd3794eb1b
Reviewed-on: https://chromium-review.googlesource.com/250380
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
6b19d765
|
2015-02-19T09:40:39
|
|
Implement missing variants of abs/sign
This change adds ANGLE support for abs/sign variants introduced
in ESSL3.
BUG=angle:923
TEST=Unit tests, dEQP tests
Unit Tests:
TypeTrackingTest.BuiltInAbsSignFunctionFloatResultTypeAndPrecision
TypeTrackingTest.BuiltInAbsSignFunctionIntResultTypeAndPrecision
dEQP tests passing 100% because of this change:
dEQP-GLES3.functional.shaders.builtin_functions.common.abs
dEQP-GLES3.functional.shaders.builtin_functions.common.sign
Change-Id: I2a3b028611f0eaaac3c031f8926d34a0e146663d
Reviewed-on: https://chromium-review.googlesource.com/251491
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
7c1f6f19
|
2015-02-19T18:56:09
|
|
Revert "Implement missing variants of abs/sign"
This for some reason is failing angle_unittests:
http://build.chromium.org/p/chromium.gpu.fyi/builders/Win7%20Release%20%28NVIDIA%29/builds/13296
Happens across platforms.
This reverts commit 3e142e47cc5b40564bcdba4252fd326bc28ca343.
Change-Id: Ideb20457546c0dec10c9584182cc8d5ead42309d
Reviewed-on: https://chromium-review.googlesource.com/251160
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
3e142e47
|
2015-02-19T09:40:39
|
|
Implement missing variants of abs/sign
This change adds ANGLE support for abs/sign variants introduced
in ESSL3.
BUG=angle:923
TEST=dEQP tests
Tests passing 100% because of this change:
dEQP-GLES3.functional.shaders.builtin_functions.common.abs
dEQP-GLES3.functional.shaders.builtin_functions.common.sign
Change-Id: If22032be2c1ed08451275262e311ef5ac613d45e
Reviewed-on: https://chromium-review.googlesource.com/251060
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
3eab00a0
|
2015-02-12T16:02:39
|
|
Fix constant folding integer modulus
Constant folding % used to generate results from division instead of
results from modulus. Fix this and introduce a test for this and other
integer constant folding, that checks that the right constant values are
found in the IntermNode tree.
BUG=angle:916
TEST=angle_unittests
Change-Id: I75e59b7734eb206378a1b2957af0a5437a90097c
Reviewed-on: https://chromium-review.googlesource.com/249691
Reviewed-by: Gregoire Payen de La Garanderie <Gregory.Payen@imgtec.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Nicolas Capens <capn@chromium.org>
|
|
ff805cc3
|
2015-02-13T10:59:34
|
|
Separate integer and float modulus
Integer and float modulus are separated into Mod and IMod operator types
to make the code clearer and to make GetOperatorString return the correct
value for both.
Change-Id: Ibfbca2c558bf919b0eab6404d7349f87fe47a18c
Reviewed-on: https://chromium-review.googlesource.com/249692
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
31b5fc62
|
2015-01-16T12:13:36
|
|
Add support for bitwise operations in ESSL3
Add support for <<, >>, &, |, ^, and their compound assignment variants
<<=, >>=, &=, |=, ^=. Also add support for bitwise not (~).
BUG=angle:870
Change-Id: I5e6a835409589556d5d58d58078fdf505cfd8da5
Reviewed-on: https://chromium-review.googlesource.com/241850
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
7700ff65
|
2015-01-15T12:16:29
|
|
Add basic support for ESSL3 vec2 (un)pack functions
The functions are emulated on HLSL, and use the native functions on
OpenGL 4.2+ and GLES3.0. Emulation for OpenGL versions <= 4.1 is not yet
implemented.
BUG=angle:865
Change-Id: I6803a1767dacdb3dca12f13924651fd38fcacb75
Reviewed-on: https://chromium-review.googlesource.com/240961
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
d68157fc
|
2015-01-16T12:24:17
|
|
Fix issues related to modulus operator
Make sure that "scalar %= vector" is not approved by the compiler, and
that % and %= are only exposed on GLES3.
BUG=angle:854
Change-Id: I3ac7eb607bd86a6caa905d2bef5d397688ad3fd3
Reviewed-on: https://chromium-review.googlesource.com/241410
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Gregoire Payen de La Garanderie <Gregory.Payen@imgtec.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
e8d2c072
|
2015-01-08T16:33:54
|
|
Implement float-integer conversions for ESSL 3.00
The implementation uses asint, asuint and asfloat in the HLSL output.
BUG=angle:865
Change-Id: I6b48298e18c7b3b0bdeac522b375ebc4eab7cf4e
Reviewed-on: https://chromium-review.googlesource.com/239520
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
be954a23
|
2014-12-23T00:05:28
|
|
Implement support for the binary operator '%' in the translator.
BUG=angle:854
Change-Id: If116de132dc83d93255749b54c1919a75abcb65c
Reviewed-on: https://chromium-review.googlesource.com/236330
Tested-by: Gregoire Payen de La Garanderie <Gregory.Payen@imgtec.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
6c85047a
|
2014-12-02T16:23:17
|
|
Reject compound assignments of the type scalar op= vector/matrix
scalar op vector/matrix produces a vector/matrix, which can't be
assigned to a scalar. Handle this correctly for addition, subtraction and
division. Multiplication was already handled correctly as a special case.
BUG=angle:832
TEST=WebGL conformance tests
Change-Id: I318cae8bf353a5c58c588876ce3f29d18389263c
Reviewed-on: https://chromium-review.googlesource.com/232601
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
352beffc
|
2014-11-19T13:45:55
|
|
Remove RemoveAllTreeNodes, since it was a no-op
IntermNode operator delete() or any of the IntermNode destructors don't
do anything, since all the AST memory is allocated on the PoolAllocator.
Because of this, RemoveAllTreeNodes was simply a no-op, and redundant
with the PoolAllocator deallocation procedure, and could confuse people
reading the code to think that IntermNodes should be deleted
individually, when in fact this is not the case.
BUG=angle:831
Change-Id: Ie1ccaa51986aabf267280d92a8e76ca9f97a19e5
Reviewed-on: https://chromium-review.googlesource.com/230730
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
853dc1ab
|
2014-11-06T17:25:48
|
|
Add mediump and lowp precision emulation support for GLSL output
This implements the rounding as specified in WEBGL_debug_shader_precision
extension proposal for desktop GLSL and ESSL output. The bulk of the new
functionality is added in the form of a new EmulatePrecision AST
traverser, which inserts calls to the rounding routines angle_frm and
angle_frl in the appropriate places, and writes the rounding routines
themselves to the shader.
Compound assignments which are subject to emulation are transformed from
"x op= y" to "angle_compound_op_frm(x, y)", a call to a function which
does the appropriate rounding and places the result of the operation to
x.
The angle_ prefixed names should not clash with user-defined names if
name hashing is on. If name hashing is not on, the precision emulation
can only be used if the angle_ prefix is reserved for use by ANGLE.
To support the rounding routines in output, a new operator type is added
for internal helper function calls, which are not subject to name
hashing.
In ESSL output, all variables are forced to highp when precision
emulation is on to ensure consistency with how precision emulation
performs on desktop.
Comprehensive tests for the added code generation are included.
BUG=angle:787
Change-Id: I0d0ad9327888f803a32e79b64b08763c654c913b
Reviewed-on: https://chromium-review.googlesource.com/229631
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
d2a67b96
|
2014-10-21T16:42:57
|
|
Fix precision tracking for built-in function return values
Previously, the type of the return value of all function calls was set to
the type of the return value in the function signature. This did not
carry precision information.
This patch changes this so that the return value precision is set
correctly for built-in functions. For single-argument math functions, it
mostly depends on that addUnaryMath sets the type of the return value to
be the same as the type of the operand. The type is replaced but the
precision information from the operand type is retained when needed. For
multi-argument math functions, precision is determined based on all the
nodes in the aggregate after the type has been set. For texture
functions, the precision is set according the sampler type as per ESSL
1.0 spec. For textureSize, the precision is always highp as per ESSL 3.0
spec.
BUG=angle:787
Change-Id: I48448e3ffe38656b91177dee9b60dd07a03cd095
Reviewed-on: https://chromium-review.googlesource.com/224951
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
de1e00e1
|
2014-10-09T16:55:32
|
|
Implement support of unary operator "+" in translator.
BUG=angle:779
TEST=conformance/glsl/misc/struct-unary-operators.html
Change-Id: Ia827e07dcfc8ad3bbbc078e54336815be9027945
Reviewed-on: https://chromium-review.googlesource.com/222720
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Tested-by: Zhenyao Mo <zmo@chromium.org>
|