Also adds a simple unit test checking the pruning
BUG=angleproject:937
BUG=395048
Change-Id: I49904c34d1a72949cdc579569967d99c736c7237
Reviewed-on: https://chromium-review.googlesource.com/264415
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
The CallDAG preprocesses the AST to construct a DAG of
functions that can be used for several analyses.
Use it to implement check for recursion and max call
depth. It will also be used to limit the usage of
[[flatten]] and [[unroll]].
BUG=angleproject:937
BUG=395048
Change-Id: I8578703f2d49513f315aecccbcff34914562e4ff
Reviewed-on: https://chromium-review.googlesource.com/263774
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
Having only one way of setting or clearing arrayness of types clarifies
code dealing with arrays.
TEST=angle_unittests
BUG=angleproject:941
Change-Id: I98cb7c44fd66440c9de8b4c6c4a02827e9300db7
Reviewed-on: https://chromium-review.googlesource.com/264361
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
ANGLE used to accept shaders with non-sized arrays in initializer lists.
Fix this. Proper support for implicitly sized arrays will be implemented
later for ESSL3.
TEST=angle_unittests
BUG=angleproject:941
Change-Id: I53c5ccf0f7ef09ad30e142f8350812959fc4846c
Reviewed-on: https://chromium-review.googlesource.com/264360
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Failures seen on some FYI bots.
Change-Id: I4853438c34ce55a1d803d3a7edf3b3e077905264
Reviewed-on: https://chromium-review.googlesource.com/264462
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
The translator_static dependency is missing from libANGLE.
GYP has this dependency.
Change-Id: I30165a041f88f7e3c6f550744d2c7a4103d0f520
Reviewed-on: https://chromium-review.googlesource.com/264425
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Event tracing requires pulling in timing counters, so we can sync
with Chromium's timestamps. It may require a bit more tricky stuff
to sync ANGLE's GPU timestamps with trace timestamps, but should
allow us to add GPU trace events in the future.
BUG=chromium:436191
BUG=angleproject:966
Change-Id: Ie1dc2981650d96888f988fa74b6fa435fbe8edc2
Reviewed-on: https://chromium-review.googlesource.com/263781
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
We can use the Impl casting helper methods to clean up dynamic type
casting.
Change-Id: I5706da74eedd9f3cdc5a728420074a91ad7c95cb
Reviewed-on: https://chromium-review.googlesource.com/263520
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
This patch cleans up the rest of our custom casting helper
functions.
Change-Id: I41975c736765fca855c4498acca31116df3e8317
Reviewed-on: https://chromium-review.googlesource.com/263477
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
This adds support to the following type of shader code, where an array
constructor is used as a source of assignment:
float a[3];
a = float[3](0.0, 1.0, 2.0);
The assignment gets replaced in the HLSL code by a function call where
the array is an out parameter and the constructor parameters are regular
parameters.
Constructors cannot yet be used in initializers.
With this change in place, some of the relevant dEQP tests start passing.
TEST=dEQP-GLES3.functional.shaders.arrays.constructor.*
BUG=angleproject:941
Change-Id: I13ed603c02a30d9f9950a61c4d562ae9fac058ec
Reviewed-on: https://chromium-review.googlesource.com/263403
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Add limited support for parsing array constructors and writing them out as
GLSL code.
Still missing from this version: HLSL output, array support in
initializer lists, arrays with implicit size.
BUG=angleproject:941
Change-Id: I7febf80923c4cd0b730399f1f49f9456cf3668e9
Reviewed-on: https://chromium-review.googlesource.com/260572
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Found by clang:
..\..\third_party\angle\src\common/angleutils.h(66,5) : error: delete called on 'Timer' that is abstract but has non-virtual destructor [-Werror,-Wdelete-non-virtual-dtor]
delete resource;
^
..\..\third_party\angle\src\tests\perf_tests\ANGLEPerfTest.cpp(26,5) : note: in instantiation of function template specialization 'SafeDelete<Timer>' requested here
SafeDelete(mTimer);
^
BUG=chromium:82385
Change-Id: I69033b1802b5dffbdf2d80889aca7019d710d481
Reviewed-on: https://chromium-review.googlesource.com/264061
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
This cleans up the syntax somewhat. Also place some more of the
helper methods in the header.
BUG=angleproject:963
Change-Id: I62419095a7b65486f54d74791027594e8e595e48
Reviewed-on: https://chromium-review.googlesource.com/263629
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
This will let us squash the attachment types in a follow-up patch.
BUG=angleproject:963
Change-Id: I1efb2e41aa08766189499995b3150aec6fd61c4e
Reviewed-on: https://chromium-review.googlesource.com/263486
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
This will allow narrowing down which usages of
[[flatten]] and [[unroll]] are actually useful.
BUG=angleproject:937
BUG=395048
Change-Id: Icc37abf51a1407c9e7bc708dc08d3ba4050a496a
Reviewed-on: https://chromium-review.googlesource.com/261189
Tested-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This will allow narrowing down which usages of
[[flatten]] and [[unroll]] are actually useful.
BUG=angleproject:937
BUG=395048
Change-Id: Ic31e434c7b5bb6c32eff2336e5949391bfee25a5
Reviewed-on: https://chromium-review.googlesource.com/260930
Reviewed-by: Nicolas Capens <capn@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
The CallDAG preprocesses the AST to construct a DAG of
functions that can be used for several analysis.
Use it to implement check for recursion and max call
depth. It will also be used to limit the usage of
[[flatten]] and [[unroll]].
BUG=angleproject:937
BUG=395048
Change-Id: I643e0ed605ad095e4fd7da4977d842be5e6a12e0
Reviewed-on: https://chromium-review.googlesource.com/229352
Reviewed-by: Nicolas Capens <capn@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This was giving a compile error on OSX. Also update the logic
slightly.
BUG=angleproject:963
Change-Id: I1ac64aa0908a58d9780054084d5c205c61848763
Reviewed-on: https://chromium-review.googlesource.com/263730
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
This will give us better dashboard encapsulation when we're
running on the Chromium bots. It also paves the way for more
specialized draw call tests, like for indexed draw, with uniform
updates, instancing, etc.
BUG=angleproject:744
Change-Id: I396de28c027f99da18a0904f959d23b59cac2010
Reviewed-on: https://chromium-review.googlesource.com/263505
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Add an AST traverser that rejects shaders with expressions that use the return
value of an assignment where an array is assigned to another array. In the
future this should be made into a tool that can simplify these expressions so
that return values of array assignments are not used.
In its current form this code prevents OutputHLSL from producing garbage code
when the original code contains expressions like a = (b = c); where a, b, and c
are all arrays.
BUG=angleproject:960
Change-Id: I11353d7ed7160c853e58a0ef3471ca439cb314c8
Reviewed-on: https://chromium-review.googlesource.com/263070
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Implement support for assignments where the return value of the assignment
is not used in another part of the expression.
TEST=WebGL conformance tests
BUG=angleproject:960
Change-Id: Ibf9d71a75d27d139d2aabb5162ab04a0974321d3
Reviewed-on: https://chromium-review.googlesource.com/263222
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
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>
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>
We can use GetAs() to retrieve the corresponding API object.
BUG=angleproject:963
Change-Id: I472e13664e45f9f05621dea3d28135d4e833fb3d
Reviewed-on: https://chromium-review.googlesource.com/263485
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
This class is no longer necessary or used.
BUG=angleproject:963
Change-Id: I5e6fa64822e637e1cc769be6fe777fa6e13a0d83
Reviewed-on: https://chromium-review.googlesource.com/263484
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Instead of using an Impl type for default attachments, store the
egl::Surface pointer where possible.
BUG=angleproject:963
Change-Id: I3e34849e8b1ccae0c91a79617ec6f64aaaab6b10
Reviewed-on: https://chromium-review.googlesource.com/263483
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
These extensions give power apps the ability to query raw device
pointers from the EGL layer. EGL_EXT_device_query is based on
EGL_EXT_device_base, which is being split into device_query and
device_enumerate. We remove the device enumeration logic, and only
allow the app to query the current device from a display, which
matches how ANGLE works internally.
EGL_ANGLE_device_d3d gives the app the ability to query D3D
devices associated with a display.
BUG=angleproject:935
Change-Id: I8079661f00d11717ed0e792c9fe8dc5c26f67dcc
Reviewed-on: https://chromium-review.googlesource.com/252110
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
This will let us store references to Surface in FBO attachments,
even after the surface is destroyed.
BUG=angleproject:963
Change-Id: I7e1cb161d1e08f78b1c4d730a32ad09ac7e61e30
Reviewed-on: https://chromium-review.googlesource.com/263482
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
This allows the implementation object to also check the caps.
BUG=angleproject:930
Change-Id: I5a48ad942eaa5271b60cffd931829296e5d2a767
Reviewed-on: https://chromium-review.googlesource.com/263481
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
We no longer use the DISALLOW_COPY_AND_ASSIGN macro.
BUG=angleproject:956
Change-Id: I439c4d55612059d6a16ae6351c54c3817be017cf
Reviewed-on: https://chromium-review.googlesource.com/263480
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Also fixes the uniform count upper limit in glGetActiveUniformsiv,
as well as an assert hit with used but unbound uniform buffer.
BUG=angleproject:507
BUG=angleproject:962
Change-Id: I096fe1c9b4f0f398f3a638cd8311278987dfb7dc
Reviewed-on: https://chromium-review.googlesource.com/263404
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Gregoire Payen de La Garanderie <Gregory.Payen@imgtec.com>