We're changing eglReleaseTexImage so it calls
flushCommandBuffer(mtl::NoWait) instead of
flushCommandBuffer(mtl::WaitUntilScheduled)
and then adding an extension to allow us to
WaitUntilScheduled.
This is because Chrome calls eglReleaseTexImage for
every canvas and having it WaitUntilScheduled per call
is very slow. So instead we'll call eglWaitUntilWorkScheduledANGLE
once which will effectively wait just once.
Bug: angleproject:7890
Change-Id: I87bc9f9a1a7f4a0f99d93736cc3083799e76afeb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4109311
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Gregg Tavares <gman@chromium.org>
Add eglCopyMetalSharedEventANGLE function to the
ANGLE_metal_shared_event_sync extension. This brings the extension on
par with the EGL_ANDROID_native_fence_sync extension.
eglCopyMetalSharedEventANGLE allows for copying the Metal event object
from EGLSync objects implemented by the ANGLE Metal renderer. This
function follows Objective-C convention for "copy" methods and increases
the retain count of the Metal event object. The EGL API user is thus
responsible for ensuring to release the returned object to avoid memory
leaks.
Test: angle_end2end_tests --gtest_filter=EGLSyncTestMetalSharedEvent.*
Bug: angleproject:7561
Change-Id: I8c35b559014b85cb8c6a0e76ac2ab7891eed5da0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3881423
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Quyen Le <lehoangquyen@chromium.org>
Implement creation of fence sync object taking an external
MTLSharedEvent and optional value to use when signaling completion of
prior commands.
Extended end2end test suite with metal shared event test cases.
Test: angle_end2end_tests --gtest_filter=EGLSyncTestMetalSharedEvent.*
Bug: angleproject:7561
Change-Id: I0e72b5417275a20a24e535670ceb995ecc87abcb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3865060
Reviewed-by: Quyen Le <lehoangquyen@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
On Android, the EGL loader supports and implements the necessary
functionality for the following colorspace extensions -
1. EGL_EXT_gl_colorspace_display_p3
2. EGL_EXT_gl_colorspace_display_p3_linear
3. EGL_EXT_gl_colorspace_display_p3_passthrough
4. EGL_EXT_gl_colorspace_scrgb
5. EGL_EXT_gl_colorspace_scrgb_linear
Add support for "EGL_ANGLE_colorspace_attribute_passthrough"
extension that allows vendors that support wide color gamut
to passthrough colorspace attribute values to the underlying
Vulkan implementation to be used during VkImage creation.
Bug: angleproject:7319
Test: PbufferColorspaceTest.CreateSurfaceWithColorspace*
Change-Id: Ibd78bb5fea4ede394f4dc5027c1d4a730746f2ee
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3855048
Commit-Queue: mohan maiya <m.maiya@samsung.com>
Reviewed-by: Ian Elliott <ianelliott@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
This switches ANGLE to use the upstream XML files for the CL, EGL
GLX and WGL APIs. Since gl.xml has a few more significant diffs
from the upstream version, that work will come in another CL.
This also removes an ANGLE EGL ext that was added upstream.
Bug: angleproject:6461
Change-Id: I29ead5edc13a4256d1f702c330a5d3d233502cd4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3854318
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
I was going to do this bit-by-bit, but there are just too many of them,
so I'm lumping as many of these enums into one commit as I can.
I basically went through all the extensions/EGL_* files and found all
the enum definitions there and added them to the xml.
Bug: angleproject:7193
Change-Id: Idaffd283e9118abf84bdff9c4e140334a1f8ee06
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3582939
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
This is necessary for a loader like GLAD to generate a correct egl.h
header with ANGLE extensions.
Bug: angleproject:7193
Change-Id: Id3f07ffee216890418b202520fccff7ccfcaa6dd
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3582273
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
eglHandleGPUSwitch() does not work with WebKit sandbox profile.
The root cause is that we do not know the
primary display, and as such we do not know which GPU drives this.
Add eglForceGPUSwitchANGLE(display, gpuIDHigh, gpuIDLow).
This lets the caller figure out the GPU in another process. Then
the caller can just set the GPU in the sandboxed process.
Add tests that are disabled by default until the runner and the
infrastructure supports running the tests with automatic switching
enabled.
Bug: angleproject:7092
Change-Id: I316ee431156596effbdb89659a5e24291719a204
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3516274
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Swapchain-based backends like Vulkan might block a lot in
vkAcquireNextImageKHR, which is bad for overall fast progress if we also
hold the global EGL lock there.
This CL starts to split the global EGL lock. We release the EGL lock
when performing vkAcquireNextImageKHR, and only maintain a lock for
surfaces.
This is done via a new custom entry point, EGL_PrepareSwapBuffers, so
that we can control how the global lock is used throughout the entire
call.
Bug: angleproject:6851
Change-Id: I095cd8b3bdbb13c842cab0a46148e2122582cdfd
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3373426
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Lingfeng Yang <lfy@google.com>
This Metal-specific EGL extension allows a given context
and the GPU resources it allocates to be associated with
a particular task ID on the system, for system-level
bookkeeping purposes.
Bug: angleproject:6795
Change-Id: I19ee0993564169b01c4a450e63dcfacd339b98b5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3335172
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
This extension is for exporting VkImage from EGLImage.
The VkImage must be used with the same VkDevice used by ANGLE
Vulkan backend.
Bug: chromium:1264439
Change-Id: I222d900465cf2716d94fc64f06e240390ec518ac
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3285025
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
The new EGL headers introduced 'EGL_NO_X11' which we could use
for ANGLE vulkan display/headless backend.
Changes in CL:
1. Updated include/EGL/egl*.h and scripts/egl.xml based on latest
EGL repo: https://github.com/KhronosGroup/EGL-Registry
Note: local modifications to the file were preserved in
eglext.h, search keyword 'eglext_angle.h' for detail
2. run scripts to update entry_points/loader
scripts/generate_entry_points.py
scripts/generate_loader.py
scripts/run_code_generation.py
3. Update ANGLE code on API 'eglSwapBuffersWithDamage'
4. Format with 'git cl format'
Bug: angleproject:5260
Change-Id: I70ed0dccecf0426929ef8b4775605554d66c5724
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2576314
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
This is a first step towards auto-generating more EGL code. It
includes format handling for all the EGL parameter types, type
reinterpretation for EGL types using the "packed enum" handling,
and code refactoring to support the new consistent validation
entry point pattern.
Bug: angleproject:2621
Change-Id: I2740e82928db311aa934825cbe74bd75bf49c33c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2552976
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Add the ability to release and reacquire the high-power GPU, and to
respond to changes in the active GPU. In Chromium, the GPU process can
not access the WindowServer. An external process must inform ANGLE
that the active GPU has changed, and that ANGLE should switch its
internal context to the new GPU.
Incorporates a couple of functions from WebKit, used with permission,
to effect this GPU switch.
A follow-on change in Chromium which uses these new APIs will make the
existing dual-GPU tests pass with ANGLE and the passthrough command
decoder.
Carry forward Chromium's workaround of disabling GPU switching on
older MacBook Pros to ensure stability.
Document the process of adding new EGL extensions to ANGLE.
Bug: chromium:1091824
Change-Id: I499739156e851b493555d4d6e4aef87d8b97fa31
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2240638
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
eglGetMscRateCHROMIUM was added to EGL_CHROMIUM_sync_control based
on the original extension GLX_OML_sync_control. However, this new
function is not universally implemented. This CL moves it to a new
extension, EGL_ANGLE_sync_control_rate, and renames it to
eglGetMscRateANGLE.
Bug: chromium:1064078
Change-Id: Ia2a29c6776b2b2bf2b98e58ee83b5f141ed01301
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2118154
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
When ANGLE is using the GL backend on GLX, we can expose
eglGetMscRateCHROMIUM via glXGetMscRateOML. Otherwise, this function
should return false.
Bug: chromium:1042393
Change-Id: Id9b308c2217e07ee9860e2869be0e23b7a0c7411
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2017048
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
This CL adds two new extensions:
* EGL_ANGLE_ggp_stream_descriptor:
Introduces a new attribute to CreateWindowSurface. Allows the app
to pass in a stream descriptor to VkCreateSurfaceKHR.
Mirrors VK_GGP_stream_descriptor_surface.
* EGL_ANGLE_swap_with_frame_token:
Introduces a new function 'eglSwapBuffersWithFrameTokenANGLE'. This
allows the app to pass a GGP frame token down to vkQueuePresentKHR.
Mirrors VK_GGP_frame_token.
Bug: angleproject:4078
Change-Id: I4313ac4c264e68999905049f661bc64b44f72fab
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1897315
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
For consistency, call these ANGLE "features", a subset of which may be
workarounds. Also, whether the feature is enabled/disabled should be
publically visible as "status".
Bug: angleproject:1621
Change-Id: I0de90a932fbfe1fc9b59138153d616d29fa7268b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1643410
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Add eglQueryDisplayAttribANGLE based on eglQueryDisplayAttribEXT to add
behavior for quering the count of all workarounds available. Used
externally to build a list of workarounds.
Bug: angleproject:1621
Change-Id: I793acedc76111fd018600169d58bf5d8cf4a63ee
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1637817
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
This extension is used to query strings from an array based on index,
which will be used to query all the information about workarounds in
ANGLE.
Bug: angleproject:1621
Change-Id: I27157f278f7f17c92c8b4fd7753e2a5ecd0528f6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1627723
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Re-land fixes build to ensure commit_id is built before libEGL.
libEGL was implicitly loading libGLESv2 on startup. This is bad
because on platforms like Linux and Mac we could sometimes use the
incorrect rpath. This in turn meant we needed workarounds like using
"_angle" extensions to our shared objects to get the correct loading
behaviour.
Fix this by loading libGLESv2 dynamically in libEGL. We build the
loader automatically from egl.xml. The loader itself is lazily
initialized on every EGL entry point call. This is necessary because
on Linux, etc, there is no equivalent to Windows' DLLMain.
We also use an EGL.h with different generation options so we have the
proper function pointer types. A README is included for instructions
on how to regenerate EGL.h.
The entry point generation script is refactored into a helper class
that is used in the loader generator. Also adds the libGLESv2 versions
of the EGL entry points in the DEF file on Windows. This allows them to
be imported properly in 32-bit configurations.
Also fixes up some errors in ANGLE's entry point definitions. Also
includes a clang-format disable rule for the Khronos headers.
This CL will help us to run ANGLE tests against native drivers.
Bug: angleproject:2871
Bug: chromium:915731
Change-Id: I4192a938d1f4117cea1bf1399c98bda7ac25ddab
Reviewed-on: https://chromium-review.googlesource.com/c/1380511
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
This reverts commit dd815b623e.
Reason for revert: Broke https://luci-milo.appspot.com/p/chromium/builders/luci.chromium.ci/win-rel/8006
Original change's description:
> Load correct libGLESv2 on Linux and Mac.
>
> libEGL was implicitly loading libGLESv2 on startup. This is bad
> because on platforms like Linux and Mac we could sometimes use the
> incorrect rpath. This in turn meant we needed workarounds like using
> "_angle" extensions to our shared objects to get the correct loading
> behaviour.
>
> Fix this by loading libGLESv2 dynamically in libEGL. We build the
> loader automatically from egl.xml. The loader itself is lazily
> initialized on every EGL entry point call. This is necessary because
> on Linux, etc, there is no equivalent to Windows' DLLMain.
>
> We also use an EGL.h with different generation options so we have the
> proper function pointer types. A README is included for instructions
> on how to regenerate EGL.h.
>
> The entry point generation script is refactored into a helper class
> that is used in the loader generator. Also adds the libGLESv2 versions
> of the EGL entry points in the DEF file on Windows. This allows them to
> be imported properly in 32-bit configurations.
>
> Also fixes up some errors in ANGLE's entry point definitions. Also
> includes a clang-format disable rule for the Khronos headers.
>
> This CL will help us to run ANGLE tests against native drivers.
>
> Bug: angleproject:2871
> Change-Id: Id6ecf969308f17b1be4083538428c9c1a1836572
> Reviewed-on: https://chromium-review.googlesource.com/c/1370725
> Commit-Queue: Jamie Madill <jmadill@chromium.org>
> Reviewed-by: Geoff Lang <geofflang@chromium.org>
TBR=ynovikov@chromium.org,geofflang@chromium.org,jmadill@chromium.org
Change-Id: I921b3c45435ab4f05cbc2d1c1172b4185d6257b0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:2871
Reviewed-on: https://chromium-review.googlesource.com/c/1378887
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
libEGL was implicitly loading libGLESv2 on startup. This is bad
because on platforms like Linux and Mac we could sometimes use the
incorrect rpath. This in turn meant we needed workarounds like using
"_angle" extensions to our shared objects to get the correct loading
behaviour.
Fix this by loading libGLESv2 dynamically in libEGL. We build the
loader automatically from egl.xml. The loader itself is lazily
initialized on every EGL entry point call. This is necessary because
on Linux, etc, there is no equivalent to Windows' DLLMain.
We also use an EGL.h with different generation options so we have the
proper function pointer types. A README is included for instructions
on how to regenerate EGL.h.
The entry point generation script is refactored into a helper class
that is used in the loader generator. Also adds the libGLESv2 versions
of the EGL entry points in the DEF file on Windows. This allows them to
be imported properly in 32-bit configurations.
Also fixes up some errors in ANGLE's entry point definitions. Also
includes a clang-format disable rule for the Khronos headers.
This CL will help us to run ANGLE tests against native drivers.
Bug: angleproject:2871
Change-Id: Id6ecf969308f17b1be4083538428c9c1a1836572
Reviewed-on: https://chromium-review.googlesource.com/c/1370725
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>