ANGLE's testing code recently got enabled in Chromium's builds. While it
builds fine with cl.exe, it isn't quite standards-conformant and doesn't
build with clang. Fix this.
There were three issues:
1. ANGLE_TYPED_TEST_CASE() is a variadic macro that tries to use
__VA_ARGS__ as argument to a variadic template and then pass
that template to another macro. However, [cpp.replace] describes
that ANGLE_TYPED_TEST_CASE(Test, int, float) should be expanded
to TYPED_TEST_CASE(Test, ::testing::Types<int, float>) which
should be interpreted as a "call" of TYPED_TEST_CASE with the
3 macro arguments `Test`, `::testing::Types<int`, and `float>`.
As a fix, use a typedef for the variadic template and refer to
it through the typedef in the macro call.
2. `#version` was used on its own line in a substitution of the
SHADER_SOURCE macro. [cpp]p1 says that every line starting with
a `#` is a preprocessing directive, and [cpp.replace]p11 says
"If there are sequences of preprocessing tokens within the list
of arguments that would otherwise act as preprocessing directives,
the behavior is undefined" (with a footnote that this includes
non-directives -- # followed by unknown text). As a fix, merge the
`#version` line with the previous line. Now the line doesn't start
with `#` and things are fine.
3. Unqualified lookup usually doesn't look into dependent bases. If
this is desired, one usually has to make the call qualified, a
good explanation for this is at
http://eli.thegreenplace.net/2012/02/06/dependent-name-lookup-for-c-templates
cl.exe doesn't implement this rule, and clang tries to emulate
cl.exe's behavior to a certain extend when in Microsoft mode.
However, that seems to not work for member templates with explicit
types (filed http://llvm.org/PR22066 for this, but since it's not
needed to parse Microsoft headers and not standards-conformant,
I'm not sure if we'll fix that). As a fix, don't provide an explicit
type, the inferred type is the same. This is also consistent with
all the other tests in this file. (We might clean up -Wmicrosoft
warnings in the future; if so I'll add the explicit this->s that
are missing in this file when we do.)
BUG=chromium:445406
Change-Id: I77a2f3ab9601a1f0f39b56ed3d05217f123155b8
Reviewed-on: https://chromium-review.googlesource.com/238090
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Added enums to allow users to request major and minor versions of the
underlying API and if a WARP device is used.
BUG=angle:490
Change-Id: I0bfb2ac8d327da28a47cc8e6346300e47ab9538c
Reviewed-on: https://chromium-review.googlesource.com/225081
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
If a previous window was not cleaned up properly due to a crash in a
test, the subsequent windows can fail to be created because the class is
not destroyed. Work around this by always creating a unique class before
creating the window.
Change-Id: Ied6b2818ef03fa12b07111d8204c3c1a6a5bd5ac
Reviewed-on: https://chromium-review.googlesource.com/225080
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Chromium builds define UNICODE, while we don't, which confuses
the built-in IDC_ARROW macro.
With this fix, and http://crbug.com/415983, we can build
angle_perf_tests in Chromium.
BUG=angle:744
Change-Id: I268a7c11a5b5355cb2485bf10faf750972cf4e30
Reviewed-on: https://chromium-review.googlesource.com/220363
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
The Chromium style output will allow the perf bots to collect data
from our performance tests.
BUG=angle:744
Change-Id: I2ffdace688004edf2918ead2a3e2aa2a6c4daf95
Reviewed-on: https://chromium-review.googlesource.com/220361
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
In some parts of ANGLE code, we were using std::vector::data to get
a pointer to the first element. Sadly, this is c++11 only, which
isn't currently supported on Chromium. This was causing a breakage
on Android. We should probably refrain from using data except on
D3D-only code, which we know will be Visual Studio.
BUG=angle:767
Change-Id: Ibc10577368435a13f62d74d77c95076482cd8f82
Reviewed-on: https://chromium-review.googlesource.com/220920
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
This benchmark will attempt to reproduce the slowdown we see
in D3D11 on the turbulenz GPU particles demo.
BUG=angle:705
Change-Id: I9c4c2f09d4282feae30f448fd374cdbb6bceae9b
Reviewed-on: https://chromium-review.googlesource.com/216467
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
We were messing up the client rect on resize, which caused the
ReadPixels checks to mess up around the window edges. Disabling
the window styles on the test windows masked this bug. Fix this
by using a style-less child window inside the parent window.
This gives us access to window styles for the samples project,
along with the ability to use tiny 1x1 windows for testing.
BUG=angle:730
Change-Id: Ic6dd931df7b4e32fbbcacbb004d3bbc49917f658
Reviewed-on: https://chromium-review.googlesource.com/217024
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
This completes the refactor to use the same code for EGL and OS
Window creation for samples and tests.
BUG=angle:730
TEST=angle_tests
Change-Id: Ib6de89f5bf83c0730a66f662cd1f87351f36a5f7
Reviewed-on: https://chromium-review.googlesource.com/213297
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Extra parameters include pixel bit sizes, swap interval
and if we want multisampling. This gives parity between
the tests and samples EGL creation options.
BUG=angle:730
Change-Id: I68d619c2ea141794f0089456bb6bba3d3b1c2a07
Reviewed-on: https://chromium-review.googlesource.com/213296
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
This allows us to use OS Windows and EGL contexts differently
for different implementations - eg, tests and samples.
BUG=angle:730
Change-Id: I65e69fd829c3dbf2f1b406d90045bc296798ebb6
Reviewed-on: https://chromium-review.googlesource.com/213290
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
This code shares the Window and EGL logic between the two
projects.
BUG=angle:730
Change-Id: I8940371226a8f7b02579c332f51679c4a5d0e2a5
Reviewed-on: https://chromium-review.googlesource.com/212799
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>