angle_end2end_tests included tests that used both the entry points
from our shared libraries as well as calling libANGLE classes like
gl::Context directly. Split these into a new test executable.
This also removes the libANGLE code from all the end2end tests.
It's necessary to add static versions of libEGL and libGLESv2 so
that we call safely call methods in libANGLE an the entry points
from the same target.
BUG=angleproject:1660
Change-Id: I6d82021b9300231ddb5fee435e5d77728f8f1292
Reviewed-on: https://chromium-review.googlesource.com/419175
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Now that Chromium is switched over, we can remove the old global
APIs so they no longer conflict with glslang/Vulkan.
BUG=angleproject:1319
Change-Id: Ia673d47caa7ca40139e4989fac374acd48f52ab9
Reviewed-on: https://chromium-review.googlesource.com/408517
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
This extension is currently in draft; ANGLE will be the first implementation.
BUG=angleproject:1553
BUG=chromium:630498
Change-Id: I795caa36f722a347cb7924990b60452d51b1e177
Reviewed-on: https://chromium-review.googlesource.com/423435
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
The OVR_multiview and OVR_multiview2 extensions add gl_ViewID_OVR to
shaders. gl_ViewID_OVR can be translated either as is in GLSL output
or as a uniform by setting the SH_TRANSLATE_VIEWID_OVR_AS_UNIFORM
compiler flag.
If WebGL output is selected, the shaders will be validated according
to proposed rules in the WEBGL_multiview spec.
BUG=angleproject:1669
TEST=angle_unittests
Change-Id: I19ea3a6c8b4edb78be03f1a50a96bfef018870d0
Reviewed-on: https://chromium-review.googlesource.com/422848
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
With this CL we have the ability to create Vulkan test configs and run
basic tests, although the only thing that works is creating a Vulkan
Renderer using the extension.
BUG=angleproject:1319
Change-Id: I8ad17bba01241334be7da16e68fea38762ca6a20
Reviewed-on: https://chromium-review.googlesource.com/367750
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
When the tiny depth texture would get re-created on change, it was
not freeing any cached SRVs which were pointing to the old tex.
Fix this by erasing the cache entry if the texure is recreated.
Also include a test which hooks into the workarounds to force
testing on every platform.
Also narrow the workaround to only apply to depth/stencil textures
which use these mips in GL, rather than D3D, where we always create
a full mip chain.
BUG=angleproject:1664
Change-Id: If0ac396b8847e1bf9b50165e5332da573e9bb3e4
Reviewed-on: https://chromium-review.googlesource.com/421567
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
atan(y, x) is not always returning expected results on NVIDIA OpenGL
drivers between versions 367 and 375. Work around this by emulating
atan(y, x) using the regular atan(x) function. A fix to the driver is
expected in a future release.
It is most convenient to implement the vector atan(y, x) functions by
using the scalar atan(y, x) function. Support for simple dependencies
between emulated functions is added to BuiltInFunctionEmulator. In the
current implementation one function is allowed to have at most one
other function as its dependency.
BUG=chromium:672380
TEST=angle_end2end_tests
Change-Id: I9eba8b0b7979c7c7eaed353b264932e41830beb1
Reviewed-on: https://chromium-review.googlesource.com/419016
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Result of -float is wrong on Intel Mac 10.11 drivers. Replace -float
with 0.0 - float to work around this issue.
BUG=308366
BUG=672380
Change-Id: I53bc2eda7259fff5805bec39896fc7b7a6eaf665
Reviewed-on: https://chromium-review.googlesource.com/417169
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
The mechanism for requesting extensions is now a separate extension.
Added a way to query the extensions that support enabling.
BUG=angleproject:1523
Change-Id: I2efaa9f6d67b12ecae325f455404e34ba04d0e7c
Reviewed-on: https://chromium-review.googlesource.com/414529
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
For loop unrolling is not used and causes the translator fuzzer to find
a hang when unrolling tons of nested loops (duh).
Also remove MMap.h which was unused.
This is essentially a revert of https://codereview.appspot.com/4331048
BUG=chromium:665255
Change-Id: Id6940f7e306d4ed53bc992f751e9ffe733190f17
Reviewed-on: https://chromium-review.googlesource.com/412023
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
We only need the typed variable information in our header files.
The entry point and other enum info can be encapsulated better
in the cpp files that call through to the translator. The only
tricky one is the compile options, which we return from our
implementation - put the typedef for these in the ShaderVars
header to fix this.
This should partially work around the problem of shaderlang
for Vulkan and ANGLE's translator (also ShaderLang) using some
identifiers with the same names.
BUG=angleproject:1576
Change-Id: I43c530486498c210796b9e197a6780bf2f7b3afb
Reviewed-on: https://chromium-review.googlesource.com/412423
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
AMD driver in Linux requires invariant qualifier to match between
shaders even for GLSL >= 4.2. This conflicts with ESSL 3.0 which
disallows invariant qualifier in fragment shader. Remove invariant
qualifier in vertex shader to workaround AMD driver bug.
BUG=chromium:639760
TEST=webgl2_conformance
Change-Id: Id5adf7e7032105486df90a1f200471ea81ee5c36
Reviewed-on: https://chromium-review.googlesource.com/411917
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
This is a follow-up patch of
https://chromium-review.googlesource.com/408569. This CL removes
invariant declaration in ESSL 3.00 vertex shader, such like:
"
out vec4 foo;
invariant foo;
"
This CL also adds the workarounds in libANGLE.
BUG=chromium:639760
TEST=webgl2_conformance
Change-Id: I568ab51a9a2f5da10d1aff0b63aae8805097e081
Reviewed-on: https://chromium-review.googlesource.com/409157
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Working with glslang in Vulkan means we are static linking libANGLE
with functions that have the same name as our translator APIs. We
can fix this by scoping our APIs. We don't need to scope the types
of the file, since they don't conflict.
This will require a follow-up patch to remove the unscoped APIs
once we switch over Chromium.
We also scope TCompiler and some related classes to avoid multiply
defined link errors with glslang.
BUG=angleproject:1576
Change-Id: I729b19467d2ff7d374a82044b16dbebdf2dc8f16
Reviewed-on: https://chromium-review.googlesource.com/408337
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
This relands https://chromium-review.googlesource.com/#/c/400005/.
ESSL and GLSL are not consistent on invariant matching in vertex shader
and fragment shader. See the following rules:
ESSL 1.00 - input and output must match
ESSL 3.00 - only output, inputs cannot be declared as invariant.
GLSL 1.10.59 - does not exist
GLSL 1.20.8 - input and output must match
GLSL 1.30.10 - input and output must match
GLSL 1.40.8 - input and output must match
GLSL 1.50.11 - input and output must match
GLSL 3.30.6 - input and output must match
GLSL 4.00.9 - input and output must match
GLSL 4.10.6 - input and output must match
GLSL 4.20.11 - input can omit invariant
GLSL 4.30.8 - input can omit invariant
GLSL 4.40.9 - input can omit invariant
GLSL 4.50.5 - input can omit invariant
Since GLSL 4.20, invariant qualifier description were changed to:
"
Only variables output from a shader (including those that are then input
to a subsequent shader) can be candidates for invariance. This includes
user-defined output variables and the built-in output variables. As only
outputs need be declared with invariant, an output from one shader stage
will still match an input of a subsequent stage without the input being
declared as invariant.
"
It's not very clear if input in fragment can be declared as invariant.
Mesa driver disallows use of input declared as invariant in fragment
shader, while other drivers may allow it. This CL removes invariant
declaration for input in fragment shader except AMD driver in Linux.
AMD's driver obviously contradicts the spec by forcing invariance to
match between vertex and fragment shaders.
BUG=chromium:639760, chromium:659326
TEST=conformance/glsl/misc/shaders-with-invariance.html and
conformance/glsl/bugs/invariant-does-not-leak-across-shaders.html
Change-Id: I0aa9be14f0cee7a11a249c91fba27c570c52ca1b
Reviewed-on: https://chromium-review.googlesource.com/404228
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
On some Mac drivers with shader version 4.1, they will
treat unused std140 and shared uniform blocks' members as inactive. However,
WebGL2.0 based on OpenGL ES3.0.4 requires all members of a named uniform block
declared with a shared or std140 layout qualifier to be considered active.
The uniform block itself is also considered active.
This workaround is to reference all members of unused std140 and shared uniform blocks
at the beginning of the vertex/fragment shader's main().
BUG=chromium:618464
TEST=UniformBufferTest.ActiveUniformBlockNumber
Change-Id: I18da4e2b61b0170068bf5ea38ce54667b0737780
Reviewed-on: https://chromium-review.googlesource.com/395648
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This allows specifying data size to all GL functions that provide a pointer to
client memory and a length parameter for all functions in which the driver
writes to client memory.
BUG=angleproject:1354
Change-Id: Ia68be1576b957cb529c87b5e0d1bd638c7dbd371
Reviewed-on: https://chromium-review.googlesource.com/382012
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
On some Mac drivers with shader version 4.1, they will
treat unused std140 and shared uniform blocks' members as inactive. However,
WebGL2.0 based on OpenGL ES3.0.4 requires all members of a named uniform block
declared with a shared or std140 layout qualifier to be considered active.
The uniform block itself is also considered active.
This workaround is to reference all members of unused std140 and shared uniform blocks
at the beginning of the vertex/fragment shader's main().
BUG=chromium:618464
TEST=UniformBufferTest.ActiveUniformBlockNumber
Change-Id: I1d2c5e3e8da04786ac6a37fd26f7bb9c14cd76ed
Reviewed-on: https://chromium-review.googlesource.com/387169
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
On some Intel drivers, calling function isnan() on highp float will get wrong
answer. This patch work arounds this bug by using an expression to emulate
this function.
BUG=chromium:650547
Change-Id: I5bc5e0352c434f42cd2c55103a74f9f7ba51a72c
Reviewed-on: https://chromium-review.googlesource.com/389834
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
BUG=angleproject:1518
Change-Id: I662f7b07da5c97831496f2617b0adadf9858bdc9
Reviewed-on: https://chromium-review.googlesource.com/386799
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
On some Intel D3D drivers, evaluating unary minor operator on an
integer variable may get wrong answer in vertex shader.
This patch works around this bug by replacing -(int) with ~(int)+1
on Windows Intel.
BUG=chromium:644033
Change-Id: I0af719e84d618a33f25bcb33bde0c381fb462a31
Reviewed-on: https://chromium-review.googlesource.com/381675
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Condition calculation in for and while loops has bug on Intel Mac. Work
around it by converting "CONDITION" to "CONDITION && true".
This CL also adds previous SH_EMULATE_ABS_INT_FUNCTION workaround to
the ANGLE GL back-end on OSX
BUG=chromium:644669
TEST=deqp/functional/gles3/shaderloop_for/while.html
Change-Id: I910f662b054f259fcb601b9938841b3a2d066840
Reviewed-on: https://chromium-review.googlesource.com/381678
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Qiankun Miao <qiankun.miao@intel.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
The timing restrictions code is not in use and not updated for ESSL3,
so it is better to remove it to make refactoring the AST easier.
It can also be argued that perfect prevention of shader timing attacks
is not feasible due to factors that are not under control of ANGLE,
such as fixed function color compression in GPUs. Such color
compression may make the use of texture bandwidth and thus performance
dependent on the content of a texture regardless of whether a
compressed format is chosen through the API.
SH_DEPENDENCY_GRAPH flag that could only be active together with the
timing restrictions flag is also removed, along with all the code that
was supporting it. The newer CallDAG code is used for different
purposes and is kept.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: I2cd10e18df366e8e43f7c3af1ca12d2a4bfb2007
Reviewed-on: https://chromium-review.googlesource.com/384511
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
The flag is not used in chrome. We decide to do per emulation per flag.
BUG=chromium:642227
Change-Id: I936d53e5015186e35e672d0cb51c853a941582d2
Reviewed-on: https://chromium-review.googlesource.com/379077
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
abs(i) where i is an integer returns unexpected result in Intel Mac.
This works around the issue by emulating abs(i) manually.
BUG=chromium:642227
TEST=deqp/functional/gles3/shadercommonfunction.html
Change-Id: I2a41e0f4bcb0766109d651e663283b1760468017
Reviewed-on: https://chromium-review.googlesource.com/377628
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
So that there will be one instance of static thread synchronization variables
in AndroidWindow.
Previously there was one instance in lib_angle_deqp_gles2_tests__library
and one in libangle_deqp_libgles2, resulting in AndroidWindow::initialize
waiting forever.
Also make the change in GYP build to fix standalone build,
and fix rpath issues on Mac.
BUG=angleproject:1471
TEST=end2end and deqp tests on standalone Win10 and end2end on GN Mac 10.11
Change-Id: I731578459400bb47d269df129aabed9b67b555e6
Reviewed-on: https://chromium-review.googlesource.com/376202
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
GLSL function texelfetchoffset will be translated into texture.Load in
ANGLE. In D3D there is a note that When one or more of the coordinates
in Location exceeds the u, v, or w mipmap level dimensions of the
texture, Load returns zero in all components, but in glsl there is no
such restriction, which will cause the WebGL 2 dEQP test
deqp/functional/gles3/shadertexturefunction/texelfetchoffset.html fail
on Windows with Intel GPU.
Adapted from ExpandIntegerPowExpressions.cpp, this patch adds a
translation from texelFetchOffset into texelFetch to work around this
issue.
BUG=angleproject:1469
Change-Id: Iecfb9570472036acf5960789bdb1a63f191316be
Reviewed-on: https://chromium-review.googlesource.com/367883
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
There were two issues with the current implementation:
* The GetDimensions function already takes into account the base level of the
SRV.
* The GetDimensions function returns doesn't return valid sizes for levels
that don't exist in the SRV. Instead, manually do the lod offset.
BUG=angleproject:931
BUG=angleproject:1316
TEST=dEQP-GLES3.functional.shaders.texture_functions.texturesize.sampler2d_fixed_vertex
Change-Id: I63259b563a42b93b73949e0ef7ac412099a42f13
Reviewed-on: https://chromium-review.googlesource.com/376099
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Compute shaders can be now compiled and linked to create programs.
Some tests are added to verify successful and unsuccessful compute
shader linking.
The patch also replaces std::array<int, 3> with a custom struct
WorkGroupSize.
BUG=angleproject:1442
TEST=angle_end2end_tests
TEST=angle_unittests
Change-Id: I4ab0ac05755d0167a6d2a798f8d7f1516cf54d84
Reviewed-on: https://chromium-review.googlesource.com/366740
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
So that there will be one instance of static thread synchronization variables
in AndroidWindow.
Previously there was one instance in lib_angle_deqp_gles2_tests__library
and one in libangle_deqp_libgles2, resulting in AndroidWindow::initialize
waiting forever.
BUG=angleproject:1471
Change-Id: Ia529c91e34960eb352730c1bb89a91ce6336c8a0
Reviewed-on: https://chromium-review.googlesource.com/368983
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
This is implemented as a compiler option which is enabled by default
when outputting to desktop GLSL version 130 and greater, which does
not support this #pragma in fragment shaders. As a workaround, and for
better compatibility on desktop OpenGL drivers, this pragma is also
flattened into the outputs of vertex shaders, and the inputs of ESSL
1.00 fragment shaders.
TEST=conformance/glsl/misc/shaders-with-invariance.html with --enable-unsafe-es3-apis
BUG=629622, angleproject:1293
Change-Id: Ib040230915e639971505ed496d26e804c9d64e68
Reviewed-on: https://chromium-review.googlesource.com/361792
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Support is added for compute shader compilation. There is a small
extension to the parser so that 'local_size_x = ', 'local_size_y = '
and 'local_size_z = ' are supported as layout qualifiers.
A few shader compilation tests are added and one which checks the AST
whether the layout qualifiers are properly parsed.
BUG=angleproject:1442
TEST=angle_unittests
TEST=angle_end2end_tests
Change-Id: I67283797d1cf13fa4ac47faa2a6e66d93a2db867
Reviewed-on: https://chromium-review.googlesource.com/362300
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>