Граф коммитов

79 Коммитов

Автор SHA1 Сообщение Дата
Shahbaz Youssefi 745999a976 Add test for multithreaded shared-context resource
The test does this:

1. Context 1: Read Texture 1 and draw into Framebuffer 1
2. Context 2: Read Texture 1 and draw into Framebuffer 2
3. Context 1: Delete Framebuffer 1
4. Context 1: Flush
5. Context 2: Modify Texture 1

Issue is Texture 1's mCurrentReadingNodes contains one node from each
context's command graph, one of which is deleted at step 4. At step 5, a
dependency is added from both nodes (one already deleted) to a new node,
causing use-after-free.

Bug: angleproject:4130
Change-Id: I06720aec20d0b49114937f1cd9b193a4f1df9d8d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1924790
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2019-12-02 20:18:03 +00:00
Jamie Madill 57b37b6b79 Rename util/system_utils to util/test_utils.
This removes a GN naming conflict between util/system_utils and
common/system_utils. This conflict was preventing us from adding
unit tests to utils' version of system_utils. Since these functions are
only useful to tests and samples rename them test_utils for simplicity.

Will enable further development of ANGLE's standalone testing harness.

Bug: angleproject:3162
Change-Id: I9e34fb69f96c5de6dc2453fce4148a0f285e15ed
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1825268
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2019-09-27 21:47:21 +00:00
Stuart Morgan 9d737966ac Standardize copyright notices to project style
For all "ANGLE Project" copyrights, standardize to the format specified
by the style guide. Changes:
- "Copyright (c)" and "Copyright(c)" changed to just "Copyright".
- Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1").
- Fixed a small number of files that had no copyright date using the
  initial commit year from the version control history.
- Fixed one instance of copyright being "The ANGLE Project" rather than
  "The ANGLE Project Authors"

These changes are applied both to the copyright of source file, and
where applicable to copyright statements that are generated by
templates.

BUG=angleproject:3811

Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2019-08-14 23:05:33 +00:00
Geoff Lang 6a02f06dfd Implement EGL_ANGLE_create_context_backwards_compatible
This extension allows the user to specify if ANGLE should create a
context of the exact requested version or a higher version context that
is backwards compatible.

BUG=angleproject:3425

Change-Id: I7d0b75cdd7e34a2fc888aa238e1eeb67af82ae0d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1601560
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2019-07-18 22:51:46 +00:00
Jamie Madill 3089f92e8a Move EGL Display config into EGLPlatformParameters.
This CL moves all of the EGLDisplay configuration into an EGL platform
struct. Consolidating display configuration in the struct allows us to
move configuration out of the test constructor. Then when we filter
test configs we don't need to wait for the individual test setup.

Bug: angleproject:3393
Change-Id: I5bd06dcdc9f2867ebc43c1d4984077ada35cafc8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1574674
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
2019-05-01 21:07:47 +00:00
Jamie Madill b81490759f Clean up ANGLE test extension functions.
None of these functions needed to be member functions. Also make the
naming more consistent.

Bug: angleproject:3393
Change-Id: I7aafe2269a48af703a87bd9a8cf4cfab9e177dd3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1574673
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2019-05-01 15:39:25 +00:00
Jamie Madill 0659c99131 Set swap interval explicitly.
The swap interval can be changed independent of the Surface config.
Thus it makes more sense to set it explicitly in test setup. This
simplifies the test config.

Also updates some of the API for GLWindowBase. Return an explicit
error from makeCurrent.

Bug: angleproject:3393
Change-Id: Ic62b33018e872bc0e38f2848e2427ed898b60749
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1574672
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2019-05-01 14:50:20 +00:00
Geoff Lang 057b76e149 Implement GL_CHROMIUM_lose_context.
This is useful for testing context lost behaviour.

BUG=angleproject:3379

Change-Id: If0e1538553b1761e313fc36ccde5138cd495200f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1566141
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
2019-04-17 15:48:14 +00:00
Jamie Madill f455f7565a Reuse angle_end2end_test windows and displays.
This both speeds up test execution and cuts down on the number of new
windows and displays created for a test config. This feature is only
currently enabled for Windows NVIDIA and Intel. On every other config
there were blocking issues that would need investigation. Several tests
were manually flagged as needed new displays on each iteration to
prevent test flakiness.

This feature might fix the issues with Intel test flakiness that have
been prominent on the ANGLE CQ.

WGL configurations have also been removed from ANGLE tests. So this
removes more of the code from ANGLETest.cpp.

Bug: angleproject:3261
Change-Id: Ic2864d4806ad38e0eeaa3c0afcd54ae1c548090f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1520995
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
2019-03-21 01:45:10 +00:00
Jamie Madill 0f566fc77c Introduce ConfigParameters test helper struct.
This allows us to more easily compare sets of parameters used in our
tests. The config parameters are stuff like the red / gree / blue bits
used in an EGL config. Or particular sets of extensions or other
EGL options.

This will more easily allow us to determine when we need to use a new
EGL display instead of reusing a prior.

Bug: angleproject:3261
Change-Id: Ia1f0ede988e0b4084fbb4d55097e94fd89ee4899
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1531535
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
2019-03-20 16:54:53 +00:00
Michael Spang 229fc83d68 Vulkan: Port renderer to Fuchsia (reland)
Add DisplayVk and WindowSurfaceVk subclasses for Fuchsia to the vulkan
renderer, as well as an implementation of OSWindow that renders
fullscreen for the test suite.

Disallow use of the vulkan loader from third_party as Fuchsia uses a fork
of the loader and has not sent those changes upstream yet.

Add a small wayland-inspired library libfuchsia-egl to provide a type
"struct fuchsia_egl_window" to use as EGLNativeWindowType. This type
combines a zx_handle_t to an image pipe channel and a surface size.

Image pipes can only be used once to create a VkSurfaceKHR. This means we
have to recreate the pipe in tests that call eglCreateWindowSurface more
than once with a single OSWindow, or the second call will fail. Add a
resetNativeWindow() method to accomplish this.

Reland disabling -Wextra-semi.

BUG=angleproject:2475
TEST=angle_end2end_tests on Fuchsia

Change-Id: Ie91715bcd760c6c04d4b8a02a91daa71e32ee30c
Reviewed-on: https://chromium-review.googlesource.com/c/1467603
Commit-Queue: Michael Spang <spang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2019-02-13 00:37:39 +00:00
Jamie Madill 3f0ff409c7 Revert "Vulkan: Port renderer to Fuchsia"
This reverts commit 991d1cfb5e.

Reason for revert: Failing compile on the fuchsia bots on the ANGLE
auto-roller.

https://ci.chromium.org/p/chromium/builders/luci.chromium.try/fuchsia_x64/209198

In file included from ../../third_party/angle/util/fuchsia/ScenicWindow.cpp:10:
In file included from ../../third_party/angle/util/fuchsia/ScenicWindow.h:13:
In file included from gen/third_party/fuchsia-sdk/sdk/fidl/fuchsia/ui/policy/cpp/fidl.h:5:
In file included from ../../third_party/fuchsia-sdk/sdk/pkg/fidl_cpp/include/lib/fidl/cpp/internal/header.h:12:
../../third_party/fuchsia-sdk/sdk/pkg/fit/include/lib/fit/function.h:135:6: error: extra ';' after member function definition [-Werror,-Wextra-semi]
    };
     ^
1 error generated.

Original change's description:
> Vulkan: Port renderer to Fuchsia
> 
> Add DisplayVk and WindowSurfaceVk subclasses for Fuchsia to the vulkan
> renderer, as well as an implementation of OSWindow that renders
> fullscreen for the test suite.
> 
> Disallow use of the vulkan loader from third_party as Fuchsia uses a fork
> of the loader and has not sent those changes upstream yet.
> 
> Add a small wayland-inspired library libfuchsia-egl to provide a type
> "struct fuchsia_egl_window" to use as EGLNativeWindowType. This type
> combines a zx_handle_t to an image pipe channel and a surface size.
> 
> Image pipes can only be used once to create a VkSurfaceKHR. This means we
> have to recreate the pipe in tests that call eglCreateWindowSurface more
> than once with a single OSWindow, or the second call will fail. Add a
> resetNativeWindow() method to accomplish this.
> 
> BUG=angleproject:2475
> TEST=angle_end2end_tests on Fuchsia
> 
> Change-Id: I71a613a362dd1c8aada49a3c02ae461e064457bf
> Reviewed-on: https://chromium-review.googlesource.com/c/1446496
> Commit-Queue: Michael Spang <spang@chromium.org>
> Reviewed-by: Jamie Madill <jmadill@chromium.org>

TBR=spang@chromium.org,geofflang@chromium.org,jmadill@chromium.org,syoussefi@chromium.org

Change-Id: I2d9abefa9db5363ba63a17c1773d0e147040d055
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:2475
Reviewed-on: https://chromium-review.googlesource.com/c/1465761
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2019-02-12 03:09:10 +00:00
Michael Spang 991d1cfb5e Vulkan: Port renderer to Fuchsia
Add DisplayVk and WindowSurfaceVk subclasses for Fuchsia to the vulkan
renderer, as well as an implementation of OSWindow that renders
fullscreen for the test suite.

Disallow use of the vulkan loader from third_party as Fuchsia uses a fork
of the loader and has not sent those changes upstream yet.

Add a small wayland-inspired library libfuchsia-egl to provide a type
"struct fuchsia_egl_window" to use as EGLNativeWindowType. This type
combines a zx_handle_t to an image pipe channel and a surface size.

Image pipes can only be used once to create a VkSurfaceKHR. This means we
have to recreate the pipe in tests that call eglCreateWindowSurface more
than once with a single OSWindow, or the second call will fail. Add a
resetNativeWindow() method to accomplish this.

BUG=angleproject:2475
TEST=angle_end2end_tests on Fuchsia

Change-Id: I71a613a362dd1c8aada49a3c02ae461e064457bf
Reviewed-on: https://chromium-review.googlesource.com/c/1446496
Commit-Queue: Michael Spang <spang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2019-02-11 22:51:25 +00:00
Jamie Madill 1f56ed2a9b Add WGLWindow and WGL test configs.
WGLWindow lets us use a Windows driver's bindings instead of ANGLE.
This only works if the underlying driver supports OpenGL ES
compatibility.

Also adds the WGL headers, WGL XML, and a specialized WGL loader.

Because of a small driver issue with NVIDIA I added a retry for the WGL
Window initialization.

Bug: angleproject:2995
Change-Id: Ie5148ece470dd03df33015f4919ad1fa79a859ec
Reviewed-on: https://chromium-review.googlesource.com/c/1366021
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
2019-01-03 21:35:24 +00:00
Jamie Madill ad398ee839 Free OSWindow and EGLWindow through helpers.
This cleans up any potential problems with allocating and freeing
resources in different shared objects or DLLs. Previously we were
using a dynamically linked allocation function and then calling
the standard delete function.

Also adds a base class helper for EGLWindow. Will base the WGL
Window class on this.

Needed for running ANGLE tests against native drivers.

Bug: angleproject:2995
Change-Id: Ic92b447649ebb32c547605c20086c07a601842f0
Reviewed-on: https://chromium-review.googlesource.com/c/1393443
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
2019-01-03 18:42:50 +00:00
Jamie Madill ba319ba31c Re-land "Load entry points dynamically in tests and samples."
Fixes the Android/ChromeOS/Fuchsia builds by using consistent EGL
headers.

This CL adds a dynamic loader generator based on XML files. It also
refactors the entry point generation script to move the XML parsing
into a helper class.

Additionally this includes a new GLES 1.0 base header. The new
header allows for function pointer types and hiding prototypes.

All tests and samples now load ANGLE dynamically. In the future this
will be extended to load entry points from the driver directly when
possible. This will allow us to perform more accurate A/B testing.

The new build configuration leads to some tests having more warnings
applied. The CL includes fixes for the new warnings.

Bug: angleproject:2995
Change-Id: I5a8772f41a0f89570b3736b785f44b7de1539b57
Reviewed-on: https://chromium-review.googlesource.com/c/1392382
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2019-01-01 18:56:45 +00:00
Yuly Novikov 9f088621eb Revert "Load entry points dynamically in tests and samples."
This reverts commit 03923558a7.

Reason for revert: fails compilation on Android, ChromeOS and Fuchsia during roll https://chromium-review.googlesource.com/c/chromium/src/+/1392624

Original change's description:
> Load entry points dynamically in tests and samples.
> 
> This CL adds a dynamic loader generator based on XML files. It also
> refactors the entry point generation script to move the XML parsing
> into a helper class.
> 
> Additionally this includes a new GLES 1.0 base header. The new
> header allows for function pointer types and hiding prototypes.
> 
> All tests and samples now load ANGLE dynamically. In the future this
> will be extended to load entry points from the driver directly when
> possible. This will allow us to perform more accurate A/B testing.
> 
> The new build configuration leads to some tests having more warnings
> applied. The CL includes fixes for the new warnings.
> 
> Bug: angleproject:2995
> Change-Id: I6726d4163f7a6e54d2482f094c0a952f59702a05
> Reviewed-on: https://chromium-review.googlesource.com/c/1359516
> Commit-Queue: Jamie Madill <jmadill@chromium.org>
> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>

TBR=ynovikov@chromium.org,jmadill@chromium.org,syoussefi@chromium.org

Change-Id: I902bec2d733c2b879be29c02ab52a0b7d4eaa077
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:2995
Reviewed-on: https://chromium-review.googlesource.com/c/1392381
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
2018-12-29 20:46:23 +00:00
Jamie Madill 03923558a7 Load entry points dynamically in tests and samples.
This CL adds a dynamic loader generator based on XML files. It also
refactors the entry point generation script to move the XML parsing
into a helper class.

Additionally this includes a new GLES 1.0 base header. The new
header allows for function pointer types and hiding prototypes.

All tests and samples now load ANGLE dynamically. In the future this
will be extended to load entry points from the driver directly when
possible. This will allow us to perform more accurate A/B testing.

The new build configuration leads to some tests having more warnings
applied. The CL includes fixes for the new warnings.

Bug: angleproject:2995
Change-Id: I6726d4163f7a6e54d2482f094c0a952f59702a05
Reviewed-on: https://chromium-review.googlesource.com/c/1359516
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2018-12-29 16:24:36 +00:00
Jamie Madill 35cd7332ab Refactor test shader style.
This change enforces a lot more consistency. We pass const char * to
the Compile functions instead of std::string. Also fixes the
indentation of C++11 block comments to be more consistent.

Bug: angleproject:2995
Change-Id: Id6e5ea94055d8cbd420df4ea2e81b2d96cb5ce78
Reviewed-on: https://chromium-review.googlesource.com/c/1357103
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-12-03 13:20:23 +00:00
Tobin Ehlis 1bf963b629 Clean up PlatformMethods attribute enum
Centralize definition of EGL_PLATFORM_ANGLE_PLATFORM_METHODS_ANGLEX
in Platform.h.

Bug: angleproject:2528
Change-Id: Id2b022c4ea08d2e98cbd6c3b248b58d096c20dfb
Reviewed-on: https://chromium-review.googlesource.com/1144265
Reviewed-by: Tobin Ehlis <tobine@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2018-08-30 22:20:00 +00:00
Omar El Sheikh eb4b869758 Introduced eglMakeCurrent Perf Test
Currently disabled test on android

Also made the default EGL device type be
EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE

Updated destroy function of RendererVk to properly
reset the mMemoryProperties member variable

Bug: angleproject:2735
Change-Id: Ie1f8ab1ac93b18eda4c10c3b10ecd4756f1d8543
Reviewed-on: https://chromium-review.googlesource.com/1140508
Commit-Queue: Omar El Sheikh <theoking@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2018-07-25 18:35:56 +00:00
Geoff Lang 24ddc7a894 WGL: Support unvirtualized contexts and unsafe multithreading.
When using unvirtualized contexts, DisplayWGL still creates a Renderer for
managing any internal GL resources such as emulated back buffers for
DXGISwapChainWindowSurfaceWGL or D3DTextureSurfaceWGL but also creates a new
Renderer for each GL context.  All created contexts share resources.

BUG=angleproject:2464

Change-Id: I945502514079368e062beef70bed49c61ed44403
Reviewed-on: https://chromium-review.googlesource.com/1097459
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
2018-06-21 20:21:27 +00:00
Geoff Lang 3b9b027c59 Add basic tests of (unsafe) multithreaded contexts.
BUG=angleproject:2464

Change-Id: Ia0f0788a1bc4d2ecd883b058f15c629cac5fd166
Reviewed-on: https://chromium-review.googlesource.com/1036063
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2018-05-07 21:00:48 +00:00
Geoff Lang 0ab41fa5eb Add an EGL extension to disable GL extensions by default.
BUG=angleproject:2404

Change-Id: I2667ddc92d5c9ef6e0ef115f2fdf0c3d3643d945
Reviewed-on: https://chromium-review.googlesource.com/962702
Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2018-03-14 20:46:16 +00:00
Jamie Madill 1fce3283f0 Samples: Add command line flag to select renderer.
This gives us the ability to test Vulkan without a special recompile,
and keeps the default setting to the default ANGLE renderer. Only
implemented for the hello_triangle sample currently.

Also includes an extra error message for missing EGL config, which is
where the Vulkan init fails right now, due to missing depth/stencil
support.

Also includes a hack to get Vulkan samples running without depth/
stencil.

BUG=angleproject:2167

Change-Id: I6925b9b84956fb69cbf602a828ea95d8c7125b68
Reviewed-on: https://chromium-review.googlesource.com/707688
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2017-10-10 14:58:03 +00:00
Geoff Lang b433e872c8 Change robust resource init into a context creation attribute.
Enabled support on OpenGL even through the extension is not fully
implemented so that testing with Chromium/Passthrough commmand decoder
is still possible.

BUG=angleproject:1635

Change-Id: Ia417b1779aace1eae19514325701a79cd33f4ef3
Reviewed-on: https://chromium-review.googlesource.com/678479
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2017-10-06 14:23:12 +00:00
Jiajia Qin 8a7b3a0ced Reland 'Remove IndexRange retrieving in validation'
This change adds GL_KHR_robust_buffer_access_behavior support.
The old change is in https://chromium-review.googlesource.com/c/angle/angle/+/607413

BUG=755897, angleproject:1393, angleproject:1463

Change-Id: I04a1132c3ae8d3a766194df61c4ff7bf0b084f03
Reviewed-on: https://chromium-review.googlesource.com/640750
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2017-09-05 14:37:18 +00:00
Jamie Madill 222c517f70 Control Debug layers in ANGLE_platform_angle.
Debug layers seem to be a universal thing among functional back-ends.
D3D, OpenGL and Vulkan all need some kind of controls for debugging,
so it seems to make sense to make this control part of the base
extension.

Default the extension to EGL_DONT_CARE, which allows the back-end to
have a lot of flexibility in terms of implementation.

Also enable the extension in the D3D11 and OpenGL back-ends, and set
the extension to enabled for angle_end2end_tests.

Remove EGLVulkanEXTTest since it no longer tests anything not tested
in the base ANGLETest class.

BUG=angleproject:2086

Change-Id: I52d8170effd1846b9afbe6e4052c699fe5cb0de8
Reviewed-on: https://chromium-review.googlesource.com/578369
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
2017-07-19 22:18:10 +00:00
Jamie Madill 293e114db2 Add tests for the cache control extension.
A first test verifies the validation of the extension, and a second
compiles a simple shader and checks the cache behaviour.

These tests don't currently run since the extension is disabled,
but they will start running as soon as we expose it.

BUG=angleproject:1897

Change-Id: Id4a76b83090712a267576069b711eeee29aa81dd
2017-07-12 12:01:56 -04:00
Jamie Madill fe54834f9f Proliferate gl::Context.
This enables a few small things: it will enable making the platform
a property of the Display rather than a global. The same goes for the
global logging annotator. Also it ensures all back-end implementations
have access to the GL / EGL state when available.

Also introduces a smart pointer helper class to angleutils for objects
that prefer to be destroyed with a context (gl::Context/egl::Display)
parameter. We were using std::unique_ptr in a few places that would
not work well with these objects.

BUG=angleproject:1156

Change-Id: I59e288a3d6f766ff8a0f4b48ff3a1fbf7489daba
Reviewed-on: https://chromium-review.googlesource.com/529706
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2017-06-19 17:58:28 +00:00
Jamie Madill 948bbe51db Redesign robust resource init as a display extension.
Also correct the enum allocation to values that are available to ANGLE.

BUG=angleproject:1635

Change-Id: I443f5654aa6a5049b4a1ae4c253cd6473b4e446e
Reviewed-on: https://chromium-review.googlesource.com/520002
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2017-06-01 19:19:35 +00:00
Jamie Madill 98de826c92 Platform: Fix initialization order in tests.
Because of the platform refactor in abf3857206 we broke the way
the tests override the D3D workarounds for the tiny depth/stencil bug.

This change passes a pointer to the platform directly in the EGL init
logic, which solves this issue. It also removes all decltype code in
the platform header which might fix the UBSAN problem we were seeing
previously.

Also change a present mode selection error into a warning in the Vk
back-end, since this was being triggered on AMD, but is safe.

BUG=angleproject:2042

Change-Id: Ibbd0c69ce11a840cf4b33c616f56020001e553aa
Reviewed-on: https://chromium-review.googlesource.com/513519
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2017-05-29 19:30:26 +00:00
Jamie Madill 6811a3160c Use GetPlatformDisplay instead of GetPlatformDisplayEXT.
This will allow us to use EGLAttrib and pass pointers as Display
init parameters if necessary.

BUG=angleproject:2042

Change-Id: Ib0f85d71bc9d3dff2db9453012f40303f3c3bd7c
Reviewed-on: https://chromium-review.googlesource.com/513518
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2017-05-25 17:52:52 +00:00
Bryan Bernhart (Intel Americas Inc) 151d5de65f Enable MSAA for texture client buffers
Enhancement to the EGL_ANGLE_d3d_texture_client_buffer extension to
allow use of a shared D3D texture that can be multi-sampled.

BUG=angleproject:1917

Change-Id: Iaf59bbd575a5dfb29345f55b549bc4017bf2d7d0
Reviewed-on: https://chromium-review.googlesource.com/446907
Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2017-04-24 16:18:33 +00:00
Jamie Madill e08a1d368e Plumb robust resource init extensions.
This also cleans up a few minor glitches in the extension texts,
and renames the EGL extension for consistency.

It incidentally fixes a bug in our EGL init where we were checking
the wrong client versions for KHR_create_context.

It also implements a new feature for tests which allow them to defer
Context creation until the test body. This allows tests to check for
EGL extension available before trying to create a context with certain
extensions.

BUG=angleproject:1635

Change-Id: I9311991332c357e36214082b16f2a4a57bfa8865
Reviewed-on: https://chromium-review.googlesource.com/450920
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2017-03-08 00:54:23 +00:00
Geoff Lang feb8c68685 Add extensions to disable client arrays.
Chrome doesn't allow any client data in its command buffer.  Add an ANGLE
extension to request a context that disallows client data.

BUG=602737

Change-Id: If9d5144daea3c629a73562396000df59a671aad3
Reviewed-on: https://chromium-review.googlesource.com/441986
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2017-02-15 17:31:55 +00:00
Fredrik Hubinette 5714a202bc D3D11: Add RGB10_A2 as a supported EGL pbuffer config format.
Update EGLWindow to select configs that exactly match the requested
config.  Too many tests make assumptions about the default framebuffer's
format.

BUG=angleproject:1662

Change-Id: I4cf8aedf51013ca0f3f40f6bbd40f24a4a90561f
Reviewed-on: https://chromium-review.googlesource.com/419681
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2017-02-01 19:36:29 +00:00
Geoff Lang c5a2a172ee Add EGL_EXT_pixel_format_float support, enables float EGL surfaces.
Add floating point EGL configs for the D3D11 backend.

BUG=angleproject:1707

Change-Id: Ic84cd3a0d41e78cc39d0275d83e7695f55673ddf
Reviewed-on: https://chromium-review.googlesource.com/428294
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2017-01-30 23:36:54 +00:00
Jamie Madill 0448ec847d Vulkan: Enable validation layers on request.
Also adds the build files for the Vulkan layers.

The layers are enabled by default for the tests.

BUG=angleproject:1319

Change-Id: I0b442b36312a1299a932922e1c4e39f00801de49
Reviewed-on: https://chromium-review.googlesource.com/367751
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2016-12-23 20:43:56 +00:00
Geoff Lang f41a7151a5 Add an extension to disable resource generation on bind.
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>
2016-09-23 14:16:37 +00:00
Geoff Lang c287ea6e0a Add WebGL validation extensions to ANGLE.
BUG=angleproject:1523

Change-Id: I6fecb5055ed8087665aeee34b3a066ea8f38d51b
Reviewed-on: https://chromium-review.googlesource.com/386281
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2016-09-20 15:27:28 +00:00
Austin Kinross 2a63b3f860 Re-land "Implement EGL_experimental_present_path_angle"
- Re-land with clang fix.

This allows ANGLE to render directly onto a D3D swapchain in the correct
orientation when using the D3D11 renderer.

The trick is to add an extra uniform to each shader which takes either
the value +1.0 or -1.0. When rendering to a texture, ANGLE sets this
value to -1.0. When rendering to the default framebuffer, ANGLE sets
this value to +1.0. ANGLE multiplies vertex positions by this value in
the VS to invert rendering when appropriate. It also corrects other
state (e.g. viewport/scissor rect) and shader built-in values
(e.g. gl_FragCoord).

This saves a substantial amount of GPU time and lowers power
consumption. For example, the old method (where ANGLE renders all
content onto an offscreen texture, and then copies/inverts this onto the
swapchain at eglSwapBuffers() time) uses about 20% of the GPU each frame
on a Lumia 630.

Verification:
+ dEQP GL ES2 tests pass when "present path fast" is enabled
+ all ANGLE_end2end_tests pass when "present path fast" is enabled

BUG=angleproject:1219

Change-Id: I56b339897828753a616d7bae837a2f354dba9c63
Reviewed-on: https://chromium-review.googlesource.com/326730
Tryjob-Request: Austin Kinross <aukinros@microsoft.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2016-02-08 21:05:16 +00:00
Jamie Madill d1c46228ef Revert "Implement EGL_experimental_present_path_angle"
Compile failure on Clang/Win:

The reason for reverting is: FAILED: ninja -t msvc -e environment.x86 --
"..\..\third_party/llvm-build/Release+Asserts/bin/clang-cl" -m32 /nologo
/showIncludes /FC
@obj\third_party\angle\src\tests\egl_tests\angle_end2end_tests.EGLPresentPathD3D11Test.obj.rsp
/c ..\..\third_party\angle\src\tests\egl_tests\EGLPresentPathD3D11Test.cpp
/Foobj\third_party\angle\src\tests\egl_tests\angle_end2end_tests.EGLPresentPathD3D11Test.obj
/Fdobj\gpu\angle_end2end_tests.cc.pdb 
In file included from
..\..\third_party\angle\src\tests\egl_tests\EGLPresentPathD3D11Test.cpp:7:
In file included from
..\..\third_party\angle\src\tests\test_utils/ANGLETest.h:13:
..\..\testing\gtest\include\gtest/gtest.h(1392,16) :  error: comparison of
integers of different signs: 'const int' and 'const unsigned int'
[-Werror,-Wsign-compare]
  if (expected == actual) {
      ~~~~~~~~ ^  ~~~~~~
..\..\testing\gtest\include\gtest/gtest.h(1422,12) :  note: in instantiation of
function template specialization 'testing::internal::CmpHelperEQ<int, unsigned
int>' requested here
    return CmpHelperEQ(expected_expression, actual_expression, expected,
           ^
..\..\third_party\angle\src\tests\egl_tests\EGLPresentPathD3D11Test.cpp(281,9) :
 note: in instantiation of function template specialization
'testing::internal::EqHelper<false>::Compare<int, unsigned int>' requested here
        ASSERT_EQ(mWindowWidth * 4, mappedSubresource.RowPitch);
        ^
..\..\testing\gtest\include\gtest/gtest.h(1960,32) :  note: expanded from macro
'ASSERT_EQ'
# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
                               ^
..\..\testing\gtest\include\gtest/gtest.h(1943,67) :  note: expanded from macro
'GTEST_ASSERT_EQ'
                      EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
                                                                  ^

BUG=angleproject:1219

This reverts commit 6b3c1db517.

Change-Id: Ia67ab82dd13295dc03235d57fa417c73f20a49e6
Reviewed-on: https://chromium-review.googlesource.com/326680
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2016-02-08 14:51:45 +00:00
Austin Kinross 6b3c1db517 Implement EGL_experimental_present_path_angle
This allows ANGLE to render directly onto a D3D swapchain in the correct
orientation when using the D3D11 renderer.

The trick is to add an extra uniform to each shader which takes either
the value +1.0 or -1.0. When rendering to a texture, ANGLE sets this
value to -1.0. When rendering to the default framebuffer, ANGLE sets
this value to +1.0. ANGLE multiplies vertex positions by this value in
the VS to invert rendering when appropriate. It also corrects other
state (e.g. viewport/scissor rect) and shader built-in values
(e.g. gl_FragCoord).

This saves a substantial amount of GPU time and lowers power
consumption. For example, the old method (where ANGLE renders all
content onto an offscreen texture, and then copies/inverts this onto the
swapchain at eglSwapBuffers() time) uses about 20% of the GPU each frame
on a Lumia 630.

Verification:
+ dEQP GL ES2 tests pass when "present path fast" is enabled
+ all ANGLE_end2end_tests pass when "present path fast" is enabled

BUG=angleproject:1219

Change-Id: Ib6eeea46bafa6ebce4adada0ae9db3a433b8fc4c
Reviewed-on: https://chromium-review.googlesource.com/321360
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tryjob-Request: Austin Kinross <aukinros@microsoft.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2016-02-05 20:14:18 +00:00
Jamie Madill 60ec6ea703 Implement dirty bits for Framebuffer.
The dirty bits set the stage for performance improvements in D3D, but
don't actually reduce any of the redundant work just yet.

BUG=angleproject:1260

Change-Id: Ib84e6a9b7aa40c37c41790f492361b22faaf4742
Reviewed-on: https://chromium-review.googlesource.com/318730
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tryjob-Request: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
2016-01-25 20:34:18 +00:00
Frank Henigman 82e3f3de8e Cast display parm for eglGetPlatformDisplayEXT.
The native display parameter to eglGetPlatformDisplayEXT has type void*.
When building with -DUSE_OZONE the native display type is intptr_t so
a cast is needed.

BUG=angleproject:1297

Change-Id: I947f5f9016926b6e3d590a2e29b5ee1fc883384d
Reviewed-on: https://chromium-review.googlesource.com/323471
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
Tested-by: Frank Henigman <fjhenigman@chromium.org>
2016-01-25 18:43:37 +00:00
Geoff Lang 70d0f4996a Implement GL_KHR_debug.
BUG=angleproject:520

Change-Id: I9ced3e7ab1515feddf2ec103c26b2610a45b1784
Reviewed-on: https://chromium-review.googlesource.com/319830
Tryjob-Request: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
2016-01-02 15:09:23 +00:00
Geoff Lang 66988745f2 Revert "Implement GL_KHR_debug."
This reverts commit 6c521b7a70.

Change-Id: I6ff981198e31f34d3e405edea6277ee75516d6ee
Reviewed-on: https://chromium-review.googlesource.com/319820
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
2015-12-22 19:39:40 +00:00
Geoff Lang 6c521b7a70 Implement GL_KHR_debug.
BUG=angleproject:520

Change-Id: I78d14cc8c94f5cef58604220f0ca847473b25bf8
Reviewed-on: https://chromium-review.googlesource.com/317820
Tryjob-Request: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
2015-12-22 15:36:53 +00:00
Geoff Lang 5ade8459ad Properly check for EGL_KHR_create_context before creating ES3 context.
Mark EGL_KHR_create_context as supported in the DisplayGLs.

BUG=angleproject:1149

Change-Id: I20671535680eb2c3b9c08205cee243b3aa5c5821
Reviewed-on: https://chromium-review.googlesource.com/297080
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
2015-09-03 15:10:22 +00:00