|
7d7f8c44
|
2015-05-19T18:38:49
|
|
Ensure that conditional blocks and loop bodies are sequence nodes
AST transformations such as unfolding logical operations can only
create nodes inside sequence (block) nodes. This patch ensures that these
AST transformations work even inside conditional blocks and loop bodies
that were first parsed as single statements instead of blocks.
BUG=angleproject:971
TEST=WebGL conformance tests
Change-Id: If98cb7be653ec7b005537b89547f4f4cf1c07c72
Reviewed-on: https://chromium-review.googlesource.com/272141
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
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>
|
|
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>
|
|
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>
|
|
5290174b
|
2015-04-15T13:42:45
|
|
Refactor ternary operator parsing
Refactor ternary operator parsing so that validation is done in
ParseContext and Intermediate's role is simply to create the node added
to the tree.
Remove partially bugged checks for null nodes as a part of this - in
error cases the parser doesn't typically add null nodes to the tree, but
rather always has a fallback to add a dummy node if parsing fails as a
method of recovery. When parsing ternary operators it should be
guaranteed that none of the parameter nodes is null.
Includes a better explanation of why ternary operators are not always
folded when only the condition is constant, and a test to make sure this
doesn't regress.
BUG=angleproject:952
TEST=WebGL conformance tests, angle_unittests
Change-Id: Icbcb721b5ab36cf314a16e79f9814aef1f355fa0
Reviewed-on: https://chromium-review.googlesource.com/265643
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
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>
|
|
69c11b5d
|
2015-03-26T12:59:00
|
|
Move validation from Intermediate::addUnaryMath to ParseContext
Intermediate should only have logic for creating node objects, validation
of parameter types belongs in ParseContext.
BUG=angleproject:952
TEST=angle_unittests, WebGL conformance tests
Change-Id: Ie90697641fabb2a837ccc4571a93616d63ea64e6
Reviewed-on: https://chromium-review.googlesource.com/262414
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
|
|
5e5c826c
|
2015-03-26T14:04:54
|
|
Fix float-int conversion return type precision tracking
Float-int conversion functions are defined to always return highp values.
BUG=angleproject:865
TEST=angle_unittests
Change-Id: Idf243b483f7b5edfcb54de2755af11e17c3756d3
Reviewed-on: https://chromium-review.googlesource.com/262413
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
|
|
fc1806e1
|
2015-03-17T13:03:11
|
|
Move most of addBinaryMath from Intermediate to ParseContext
Some type checks for binary math will be different based on the shading
language version, which is easily accessible in ParseContext. Because of
this and also for architectural simplicity it makes more sense to have
the checks in ParseContext.
BUG=angle:941
TEST=angle_unittests, WebGL conformance tests
Change-Id: I92a499f47e1cbc6a7b6391ce0fa04284803e7140
Reviewed-on: https://chromium-review.googlesource.com/260570
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
3c1dfb5a
|
2015-02-20T11:34:03
|
|
Add stubs for switch and case output
BUG=angle:921
Change-Id: I58bd645a8d53ef5bad9b680e54c8948d50932fca
Reviewed-on: https://chromium-review.googlesource.com/251525
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
b1a85f48
|
2014-08-19T15:23:24
|
|
Rename compiler intermediate source files.
This prevents confusion between "TIntermediate" and "TIntermNode".
BUG=angle:711
Change-Id: Ib7a086382a479db3f77bf2ab06ce321aa7b35d13
Reviewed-on: https://chromium-review.googlesource.com/212936
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
|
|
e40d1e9c
|
2014-07-16T17:40:36
|
|
Fix style violations.
BUG=angle:650
TEST=no behavior change
Change-Id: I3096615a181b1ec2c18ce60566c3d6249975b84e
Reviewed-on: https://chromium-review.googlesource.com/208569
Tested-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
16004fca
|
2014-06-11T11:29:11
|
|
Eliminate conversion operations.
They've been replaced by using constructor nodes, so any code handling conversion operators
can be removed.
BUG=380353
Change-Id: I70413179e7443efccbf997a5dd0f053c23689589
Reviewed-on: https://chromium-review.googlesource.com/203453
Tested-by: Nicolas Capens <nicolascapens@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
6ed8d8af
|
2014-06-11T11:25:20
|
|
Produce constructors instead of conversions.
GLSL only supports explicit conversion through constructors. Therefore the conversion
nodes are redundant.
BUG=380353
Change-Id: Id871c34750191dac431bf72aac9afed7b0db7f8e
Reviewed-on: https://chromium-review.googlesource.com/203452
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Nicolas Capens <nicolascapens@chromium.org>
|
|
dd0d3426
|
2014-03-26T14:01:56
|
|
Use a heap-memory traversal to free compiler resources.
The stack-memory traversal is prone to stack overflow. See the
WebGL conformance test long-expressions-should-not-crash.
BUG=angle:584
Change-Id: I02d72bc2e4101b7141d609c50303403ea8298e60
Reviewed-on: https://chromium-review.googlesource.com/191930
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
bd0ea9c7
|
2014-03-04T13:53:29
|
|
Don't attempt to perform constant folding with an uninitialized constant variable.
BUG=348205
Change-Id: I9be17832b1a35d2995725ab147977992c2732274
Reviewed-on: https://chromium-review.googlesource.com/188711
Tested-by: Nicolas Capens <nicolascapens@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/189471
|
|
7cab38b5
|
2013-10-15T12:59:30
|
|
Add an option to unfold short circuiting in AST.
We replace "a || b" with "a ? true : b",
"a && b" with "a ? b : false".
This is to work around short circuiting bug in Mac drivers.
ANGLEBUG=482
TEST=webgl conformance tests
R=alokp@chromium.org, kbr@chromium.org
Review URL: https://codereview.appspot.com/14529048
Conflicts:
src/build_angle.gypi
src/compiler/translator/Compiler.cpp
Change-Id: Ic2384a97d58f54294efcb3a012deb2007a9fc658
Reviewed-on: https://chromium-review.googlesource.com/178996
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Tested-by: Shannon Woods <shannonwoods@chromium.org>
|
|
f4b79ba8
|
2013-11-26T10:38:18
|
|
Fix issues with the conditional discard workarounds to do with assignments.
The old modifiesState method really checked if an operator was an assignment,
so restored that behaviour and use the new side effects detection only for
the new code.
ANGLEBUG=486
BUG=
R=nicolascapens@chromium.org, zmo@chromium.org
Review URL: https://codereview.appspot.com/22130043
Change-Id: I84d4e95a0457e63f237a814d80e4f72dd861496b
|
|
3c9eeb97
|
2013-11-04T11:09:26
|
|
Disable optimizations for shaders with conditional discard in D3D9, and
only use expanded short-circuiting conditionals for expressions with
potential side-effects.
Conservatively assume aggreate and selection operators have side effects for now.
BUG=
ANGLEBUG=486
R=geofflang@chromium.org, kbr@chromium.org, nicolas@transgaming.com, shannonwoods@chromium.org
Review URL: https://codereview.appspot.com/14441075
Conflicts:
src/common/version.h
src/compiler/translator.vcxproj
src/compiler/translator.vcxproj.filters
src/compiler/translator/OutputHLSL.cpp
src/libGLESv2/ProgramBinary.cpp
src/libGLESv2/Shader.cpp
src/libGLESv2/Shader.h
Change-Id: Iaf9f10b5de7b33c927ef032f3c4fe9d5095f64dd
|
|
17732823
|
2013-08-29T13:46:49
|
|
Moved the compiler source files into directories based on their project and added a compiler.gypi to generate the compiler projects.
|