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

169 Коммитов

Автор SHA1 Сообщение Дата
Jamie Madill f7b5d5d1e0 Capture/Replay: Remove inline variable declarations.
This makes parsing easier for the "simplified C" interpreter.
We introduce a resource ID buffer as a way to manage a list
of resource IDs to replace the inline resource lists.

Turns on the Among Us trace in the interpreter tests.

Bug: angleproject:7775
Change-Id: I1bb9c0e9b087965a18691bc99b2e9947610b9eaf
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4128719
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2023-01-19 15:42:09 +00:00
Jamie Madill fdada9ee81 Re-land: "Make SyncIDs a packed type."
This re-land fixes the sync map size tracking.

This prepares syncs to use a simple resource map like other
types, which will make life easier in the trace interpreter.

Bug: angleproject:7775
Change-Id: If2114c51d5b68503890eacbf549182823667fedc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4178012
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2023-01-18 21:45:23 +00:00
Jamie Madill 8971a59284 Revert "Make SyncIDs a packed type."
This reverts commit 9de913077a.

Reason for revert: Fails win-trace, somewhat flakily.

Original change's description:
> Make SyncIDs a packed type.
>
> This prepares syncs to use a simple resource map like other
> types, which will make life easier in the trace interpreter.
>
> Bug: angleproject:7775
> Change-Id: Ic2867f6133256f5ce2320eb2b322c1059266b201
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4103720
> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
> Commit-Queue: Jamie Madill <jmadill@chromium.org>
> Reviewed-by: Cody Northrop <cnorthrop@google.com>

Bug: angleproject:7775
Change-Id: I29534b14c973fa34a4cb7457d534cd6156f33cd2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4178010
Auto-Submit: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-01-18 14:36:06 +00:00
Jamie Madill 9de913077a Make SyncIDs a packed type.
This prepares syncs to use a simple resource map like other
types, which will make life easier in the trace interpreter.

Bug: angleproject:7775
Change-Id: Ic2867f6133256f5ce2320eb2b322c1059266b201
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4103720
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2023-01-17 21:30:01 +00:00
Jamie Madill aaee3c23c1 Build and test ANGLE with Vulkan secondary CBs.
This will allow us to run tests with both permutations of
ANGLE (custom secondaries & Vulkan secondaries) in the same
build directory. It will also allow us to run these configs
as tests on our infra. This CL adds a few simple test to CI.

Bug: angleproject:6811
Change-Id: I053f8cc5bafc2a7ab7d0665da9301f0ba7f8417f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4067806
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2022-12-02 15:46:53 +00:00
Peng Huang 2805e164a6 Fix EGLImage related race condition crash
Bug: chromium:1383195
Change-Id: Ibd74126f19674dad9425d2c8f5b3a217cfd590e4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4062912
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
2022-11-29 21:46:19 +00:00
Chris Dalton 9f693aa383 Implement an allow list for PLS
In order to guarantee no data is lost while using the
EXT_shader_pixel_local_storage extension, we need to restrict
applications to a small subset of commands while pixel local storage is
active. This CL implements the allow list for GL entrypoints using
wildcard matching inside the code generator, and adds custom validation
for the more specific restrictions that go into effect when PLS is
active.

Bug: angleproject:7279
Change-Id: I5dd48bd93c10e8775f32be32a4fcf17855eb2f0e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3932552
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Chris Dalton <chris@rive.app>
2022-11-01 16:32:11 +00:00
Jamie Madill dc62b3eef6 Capture/Replay: Add trace interpreter.
Also adds a self-test using the retrace script.

Bug: angleproject:7752
Change-Id: I1985b47250bef99726d2ca2d90bef859208e357e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3965128
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
2022-10-21 23:12:02 +00:00
Jamie Madill 6193274a52 Capture/Replay: Redesign in-memory call capture replay.
This will allow the replay to use the call captures returned
by the interpreter's parser.

Bug: angleproject:7752
Change-Id: If1b281d9ce7ccfbdc23bea615e1e2258c8a029f9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3963367
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
2022-10-21 00:17:51 +00:00
Jamie Madill fd45cec30b Entry Points: Move enum helper to registry_xml.
This will make it accessible to other generators.

Bug: angleproject:7752
Change-Id: I91bc9a4d6c919266ea329f66d271bf881d99d17a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3963364
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2022-10-20 22:27:40 +00:00
Jamie Madill 4bfb749ff2 Capture/Replay: Move shared trace code into src/common.
This will let them be accessible to the test harnesses. The
trace tests interpreter will need direct access to the classes
that we move in this CL.

This CL also moves the GLenum utils into the common folder,
where they were already used by some other tests.

Bug: angleproject:7752
Change-Id: I97ad607938ef29bc316f6d40098478e002ea8128
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3963362
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2022-10-20 14:18:58 +00:00
Jamie Madill 8403e4c512 EGL: Resource IDs for Surface, Context and EGL Image.
This will make these classes play nicely with resource maps. As these
objects are used in a lot of places, and simplified C can't handle
unordered_map, it's necessary to index the maps by simple packed IDs
in capture/replay code. This indirection will also have increased
safety as we validate EGL resource ID handle values before accessing
the memory directly.

Also hides some of the other EGL capture methods behind helper methods
to simplify the C code and hide assignments and other complex maps.

Bug: angleproject:7758
Change-Id: Ibc7bb56430d3068bd38877c9dfb011979d4ea234
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3957164
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
2022-10-20 14:11:18 +00:00
Jamie Madill 2265e37bf9 Capture/Replay: Auto-generate EGL capture code.
Replaces the custom code in the EGL stubs. Skips a few "Get"
entry points because this CL doesn't implement pointer capture
like we do for all the GL entry points.

Includes a new state in the AttributeMap that indicates which
type of attribute values we used when initializing the map.

Bug: angleproject:4035
Change-Id: I272eac5e4068602ce710ef66c9a1dce5387943a5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3949911
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2022-10-14 22:25:49 +00:00
Jamie Madill 7c4dc25328 Capture/Replay: Clean up EGL capture.
This switches the EGL capture types to ANGLE-casted pointers since
that's what we receive in the capture layer. Note that even if the
capture layer were used as a pure layer, not an EGL implementation,
we'd still have these types for state tracking.

This also prefixes each EGL class in the entry points with the egl
namespace for consistency and for simplifying the ParamType code.

Required changing to non-const gl::Context * in a few places. Also
changes the gSurfaceMap to be indexed by the raw pointer value,
which cleans up the code somewhat.

Bug: angleproject:4035
Change-Id: Id800c1ba25e5819ac7ea1df8aab806bc393fe192
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3949910
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2022-10-14 20:43:53 +00:00
Jamie Madill 5b3781ecff Remove namespacing from all ANGLE loaders.
This will make it easier to work with pure C files.

Bug: angleproject:7731
Change-Id: I2fe9af486af5f339d973c9149f082eb1f2efa8c4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3925426
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2022-10-04 12:16:30 +00:00
Shahbaz Youssefi de73f7cd7d Introduce GL_ANGLE_logic_op
This extension exposes the desktop GL glLogicOp function as a GLES
extension.  This is supported by Vulkan through the logicOp feature as
well.

The goal is to directly use this extension in GLES1 emulation where the
backend supports it, avoiding a more costly fallback.

Bug: angleproject:3862
Change-Id: I7ed436cdf401437157ca9724168849b4c819b91b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3898310
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2022-09-20 04:02:18 +00:00
Eddie Hatfield 3960e63b1a Infra: Enable angle_deqp_gl46_tests on SwiftShader
This change disables the WGL frontend by default on
Windows when building ANGLE for desktop GL. This
is because the WGL frontend is not yet fully
implemented and it causes some of the trace tests to
fail. The WGL frontend should be enabled by default on
windows when more of its functionality gets implemented.

Test: angle_deqp_gl46_tests --use-angle=swiftshader
Bug: angleproject:7566
Bug: angleproject:7628
Change-Id: I69c695eb56d3858f715eeb86d28cc805e25c60eb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3858142
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Cody Northrop <cnorthrop@google.com>
2022-09-02 18:46:02 +00:00
Jamie Madill 64f41972a9 Use canonical gl.xml and update enum to string function.
This replaces our copy of gl.xml with the upstream canonical copy.
Note that one patch is required before we can remove ANGLE's copy:

https://github.com/KhronosGroup/OpenGL-Registry/pull/538

Because the upstream version uses a new method of enum groups, we
also update our enum-to-string generator to use the new groups.
This new code includes many more enums and groups in the mapping.

Bug: angleproject:6461
Change-Id: I1c0ab44c36afce8db04c9661b377bbe5762c913e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3856649
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2022-08-29 20:29:27 +00:00
Eddie Hatfield 98d5db7063 Add capture functions for desktop GL entry points
The parameter capture functions are left unimplemented for now.

Bug: angleproject:7533
Change-Id: Ief356e7401805cf9b417e1f5cc3790011237e03f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3858618
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Eddie Hatfield <eddiehatfield@google.com>
2022-08-26 20:19:45 +00:00
Eddie Hatfield d89c027e7c Add unimplemented GLX entry points to desktop GL
Test: Run glxgears and hit unimplemented in ANGLE

Bug: angleproject:7533
Change-Id: Ic7ed7506b6d0c5ef5022ae6899cbd6c4d351b178
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3852631
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Eddie Hatfield <eddiehatfield@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2022-08-24 21:26:01 +00:00
Eddie Hatfield c54ed79053 Get desktop GL conformance tests to build
The target for these tests is angle_deqp_gl_tests.

Bug: angleproject:7533
Change-Id: I290822671d99da020f9a6a1f02bee43987644bf9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3766435
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Eddie Hatfield <eddiehatfield@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2022-08-03 22:17:47 +00:00
Peng Huang b78d471aea Add angle_enable_share_context_lock build flag
This flags can be used to enable the share context lock.
Without this lock, the client need to use gl calls in
a threadsafe way. It is true by default.

Bug: chromium:1336126
Change-Id: I984f8cfb0379195f6ebe11b0997e401f2421affa
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3780582
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
2022-07-21 19:04:00 +00:00
Faye Zhang 06ff0e3cb0 Implement GL_EXT_base_instance
Added new extension GL_EXT_base_instance to registry_xml.py
and auto-generated the entry point function calls for the
following functions introduced by the extension:
* GL_DrawElementsInstancedBaseVertexBaseInstanceEXT
* GL_DrawElementsInstancedBaseInstanceEXT
* GL_DrawArraysInstancedBaseInstanceEXT

Bug: angleproject:6983
Change-Id: I36167faf3ca98e42acf787dbf09ee7052e15e358
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3691952
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Commit-Queue: Faye Zhang <ffz@google.com>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
2022-06-07 23:58:38 +00:00
Gert Wollny 66b9214fbb Capture/Replay: rename ANGLE_CAPTURE to ANGLE_CAPTURE_GL
In addition gunning "git cl format" on the current tree resulted
in additional changes.

Bug: angleproject:4964
Change-Id: I3df4888aef763d06f91227409dbd943d0d25689e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3634699
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2022-05-10 16:31:06 +00:00
Jamie Madill 24c641dce9 Add stubs for AMD_performance_monitor.
We can piggy-back on this extension to report internal ANGLE
performance counters to the ANGLE tests.

Includes a minor variable de-duplication in the EP generator.

Bug: angleproject:4918
Change-Id: I4a76aea957b423a36a90349643bd50a4e1905849
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3497537
Reviewed-by: Charlie Lao <cclao@google.com>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2022-03-08 15:48:28 +00:00
Jamie Madill 2d3ce72d19 Refactor shared library load to avoid allocations.
Fixes a leak of an angle::Library detected in the EGL loader.

Bug: angleproject:6937
Change-Id: I623aa6172b98a35465e1d2641b92f67bdc5d24e7
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3403060
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2022-01-31 19:17:03 +00:00
Lingfeng Yang 926b43e751 Reland: Frontend: separate lock in swap prep
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>
2022-01-11 22:23:19 +00:00
Jamie Madill 9d668d6c47 Revert "Frontend: separate lock in swap prep"
This reverts commit 40c5cb255c.

Reason for revert: Regression in TSAN caused by this CL:

https://ci.chromium.org/ui/p/angle/builders/ci/linux-tsan-test/352/overview

Original change's description:
> Frontend: separate lock in swap prep
>
> 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.
>
> Bug: angleproject:6851
> Change-Id: I329d5c4c579718a4980c4261590f77099ce1400e
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3361249
> Reviewed-by: Charlie Lao <cclao@google.com>
> Reviewed-by: Geoff Lang <geofflang@chromium.org>
> Commit-Queue: Lingfeng Yang <lfy@google.com>

Bug: angleproject:6851
Change-Id: Ie03b784021f7b8b5c1ef95a911ef7da4029abd46
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3373165
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2022-01-07 18:19:24 +00:00
Lingfeng Yang 40c5cb255c Frontend: separate lock in swap prep
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.

Bug: angleproject:6851
Change-Id: I329d5c4c579718a4980c4261590f77099ce1400e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3361249
Reviewed-by: Charlie Lao <cclao@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Lingfeng Yang <lfy@google.com>
2022-01-07 17:06:34 +00:00
Alexis Hetu cac81f0772 Return full error info when opening a library with dlopen
This CL adds a parameter to OpenSharedLibrary and
OpenSharedLibraryWithExtension which is used to
return the full path of the library which was opened.
If dlopen failed, the string also contains the result
of dlerror which explains what the error was.

Bug: chromium:1246171
Change-Id: I374c7e2dfa18853c8137b4cbea06af8db3fdb501
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3340020
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Alexis Hétu <sugoi@chromium.org>
2021-12-15 16:09:21 +00:00
Alexis Hetu f7d92a32f1 Add debug info when loading EGL entry points fails
Mac11 bots are often failing with the:
"Error loading EGL entry points"
error for an unknown reason.

This CL adds the library path to the error message
to see if it's trying to open the correct file.

Bug: chromium:1277690
Change-Id: Ieb73a3097702933a89794d92c19ee44a6301c169
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3330576
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Alexis Hétu <sugoi@chromium.org>
2021-12-10 17:42:30 +00:00
Gert Wollny 8d51bd4bdc Capture/Replay: Add default return path for AccessParamValue
Some versions of MSVC have a bug that it will not detect when
all values of an enum are exhausted in a switch statement, which
leads to a warning that not all code path return a value, and
since the warning is treated as an error, compilation fails.

Bug: angleproject:6721
Change-Id: I4d62191ce83a04ba554dd804f13e7d428afd86a4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3291649
Commit-Queue: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-11-19 21:53:05 +00:00
YuxinHu 2aa5286d5f Add Entry Point name to validation errors
Add gl/gles entry point names to validation error messages

some special cases:
1. Debug::insertPerfWarning() is invoked from multiple places,
such as TextureVK, ContextVK,
adding an extra entryPoint function parameter
in these files will need
extra investigations.
I am passing the entryPoint name GLInvalid as a
temp workaround.

2.ErrorSet::hangleError() is invoked from multiple
Context*.cpp files,
adding an extra entryPoint function parameter
in these files will need
extra investigations.
I am passing the entryPoint name GLInvalid as a
temp workaround.

3. Debug::insertMessage(), Debug::popGroup(), Debug::pushGroup()
can be invoked from more than one GL entry points,
e.g. Debug::pushGroup() can be invoked from
either GL_APIENTRY GL_PushDebugGroup() or
GL_APIENTRY GL_PushDebugGroupKHR()
through context->pushDebugGroup() call.
Right now the same entry point name glPushDebugGroup will
be printed out in the error message for both cases.
However, we should be able to tell the actual entry point
by checking which version: KHR version or core version the
application uses, and this helps avoid the confusion.
For now we will let the same entry point name
getting printed for both cases.

Bug: angleproject:6523
Change-Id: I64a5463d9168d8444d376d1f428c3b3d894f2ea9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3215063
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Yuxin Hu <yuxinhu@google.com>
2021-10-14 22:48:22 +00:00
Gert Wollny 8712495dab Capture/Replay: Don't handle void pointers as const
TL;DR: glReadPixels needs a non-const pointer if a pack buffer
is bound, so change the code generation to keep TvoidPointer
non-const and regenerate the entry points.

Long version:

When no pack buffer is bound, then in WriteCppReplayForCall
param.readBufferSizeBytes is non-zero and the cast of the read
buffer pointer is using the type passed by the parameter
(TvoidPionter) to write the typecast by calling ParamTypeToString
directly, which returns "void *".

If. OTOH, a pack buffer is bound, then param.readBufferSizeBytes
is zero, and the default WriteParamCaptureReplay is called. This
autogenerated function forwards the call to WriteParamValueReplay
by using an explicit type specification, and the autogeneration
code was translating TvoidPointer to call
   WriteParamValueReplay<ParamType::TvoidConstPointer>
which would then translate to "const void *" in the parameter type
cast, and this would lead to a compilation failure, because the
parameter must be a non-const pointer.

Change the autogeneration code so that TvoidPointer is not forced
to be a const pointer and regenerate the entry points.

Bug: angleproject:6521
Change-Id: I673c77f803a284fb7dfc08a2e0918aebdf698194
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3204959
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Gert Wollny <gert.wollny@collabora.com>
2021-10-12 16:30:20 +00:00
Jamie Madill ad286e7111 Capture/Replay: Clean up ResourceTracker access.
This reduces the boilerplate needed to tracked genned/deleted
resources.

Refactoring change only.

Bug: angleproject:5133
Change-Id: I81f8877b2c308fe9d4136999f3ca63371a070720
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3100591
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2021-08-18 13:15:25 +00:00
Tim Van Patten 62cac8b55f Capture/Replay: Add EGL support to generate_entry_points.py
Add EGL support to generate_entry_points.py. This is a pre-requisite to
frame capture being able to generate EGL calls, which is required for
multi-context support.

Bug: angleproject:5878
Bug: angleproject:4035
Change-Id: I3b8e9c91f9e2820b5207fc02d858e8109921f581
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3078993
Commit-Queue: Tim Van Patten <timvp@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-08-12 19:17:51 +00:00
Geoff Lang 232e523656 Remove the explicit context extension.
This extension currently has no known users and doubles the
number of entry points that ANGLE exports which is a significant
binary size cost.

This saves about 130kb of binary size on Android.

Bug: chromium:1084580
Change-Id: Ib0fc4930b38a33bd61434f7d0030ba9fb9b93ba7
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3015518
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-07-16 20:04:00 +00:00
Jamie Madill 48da1c3594 Vulkan: Prefer the local vulkan loader over the system one.
Load the Vulkan loader ourselves and give vkGetInstanceProcAddr to
volk. This allows us to always prefer loading from the current module
directory instead of using the platform-specific ordering.

Refactor angle::Library loading to use ModuleDir instead of
ApplicationDir.

CL originally authored by Geoff Lang.

Bug: chromium:1219969
Change-Id: I21d1926e90fd66e1c23cea7323991ae55f3d22d4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3035444
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2021-07-16 18:56:40 +00:00
Tim Van Patten 223cd0ac24 Capture/Replay: Refactor shared context handling
This is the initial CL to enable capture/replay of multi-context
applications.

This CL refactors FrameCapture and FrameCaptureShared to move much of
the functionality into FrameCaptureShared, since most everything is
shared by Contexts in the share group. For example, the setup of the
majority of the GL objects is done in the new SetupReplayContextShared()
function in the new $LABEL_capture_context_shared_frame001.cpp file. The
setup is performed by (for example):

    void SetupReplay()
    {
        $LABEL::InitReplay();
        $LABEL::SetupReplayContextShared();
        SetupReplayContext2();
    }

This performs the shared setup first, followed by the context-specific
setup, which may reference shared objects careated by
LABEL::SetupReplayContextShared().

No re-capturing is required with this change, since the external APIs
(i.e., SetupReplay()) are still the same.

Bug: angleproject:5878
Test: Manual MEC and replay of Magic Tiles 3, Candy Crush Soda Saga, Temple Run 2
Change-Id: Iab7bfe651437e9be1dee83514cd97acc20c61d1d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2965780
Commit-Queue: Tim Van Patten <timvp@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-07-15 04:03:03 +00:00
John Plate baca10b7f2 CL: Remove object cache and fix multi-threading
All CL front end objects used to be cached to be able to determine
if an object has been created by the front end to check its validity.
The validity is now checked with the existence of an intrinsic value
(the dispatch table pointer), which is consistent with the patterns
found in Mesa and clvk (though clvk uses a magic value).
This allows the removal of all cached objects.

The cached objects were stored with std::unique_ptr. These are now
gone and all remaining pointers are now custom intrinsic reference
count pointers.

Also remove global lock which causes deadlocks, e.g. when CL API
is called from a separate thread to unlock a blocking call with
a user event. Most of the front end is constant and already
thread-safe. The ref count is also thread-safe now (atomic).
A few remaining locks will follow.
Without the global lock it was now possible to make the API
reentrant, and to remove the workaround with the Khronos ICD
loader to skip ANGLE's OpenCL library.

Bug: angleproject:6001
Change-Id: I7d3b52db9011a02cb7ea9ebdeb6e22c4c702ef5b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2927395
Commit-Queue: John Plate <jplate@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2021-06-02 16:04:49 +00:00
John Plate 51ab3dc34e CL: Improve validation readablity
Improve validation readablity by introducing a bit field class
and by changing how the CL error code is returned.

Bug: angleproject:6001
Change-Id: I51deb745454e5281de725481edef85eb30be28c7
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2919690
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: John Plate <jplate@google.com>
2021-06-02 11:17:28 +00:00
John Plate a7ae63e479 CL: Move object cast from entry points to stubs and front end
Move the OpenCl object cast from the generated entry points to the
stubs and front end, to make it possible to properly use static_cast.
This removes the limitation that the front end objects have to be
standard layout (and makes it possible to use virtual functions),
which is consistent with other front end objects.

Move the back end initialization from the stubs to the entry point
functions, which fixes a bug where the back ends were not initialized
during validation.

Move more code from the stubs to the front end, to keep the stubs
light.

Remove unused function `default_return_value` from
`generate_entry_points.py`.

Bug: angleproject:5904
Change-Id: Id999ad6c537888017bf3252c6f6e088b7d4c7984
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2897245
Commit-Queue: John Plate <jplate@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2021-05-18 11:08:43 +00:00
John Plate b300dc52be CL: device partitioning for front end and passthrough
Partitioning is the creation of sub-devices. Also add reference
counting for CL objects, which is needed now for sub-devices.

Also fix CL print format strings, since cl_ulong is actually
always 64 bit and not unsigned long.

Bug: angleproject:5904
Change-Id: I006699fad2f953ce312bca87c9b6362b5d77a18a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2880665
Commit-Queue: John Plate <jplate@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-05-13 15:23:11 +00:00
John Plate dfe208f188 Add loader for CL pass-through back end
Bug: angleproject:5904
Change-Id: If4960f3150f6bbc85a30f0f6ac5c9e668e6ff756
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2864022
Commit-Queue: John Plate <jplate@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2021-05-06 13:06:09 +00:00
John Plate 05fb22724f Add support for OpenCL ICD Loader
Bug: angleproject:5908
Change-Id: Idafc0d15b69f9a21f2ab5e48c4c34f0dc0e0ee96
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2854598
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: John Plate <jplate@google.com>
2021-05-03 17:27:16 +00:00
John Plate cddb2003b1 Stubs for CL validation entry points
Bug: angleproject:5775
Change-Id: Ic3b15efdf602bad8f5f170f03ba24b421a398ca8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2848504
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: John Plate <jplate@google.com>
2021-04-27 18:20:09 +00:00
John Plate e25f3b105f Generate empty CL object classes
Bug: angleproject:5886
Change-Id: I01566f40e85bd7f5531536fdc1df42965622a939
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2844969
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: John Plate <jplate@google.com>
2021-04-22 17:19:56 +00:00
John Plate 8226dc23e2 Generate CL enums in libGLESv2
Bug: angleproject:5869
Change-Id: Ie547d415bed37accef6cb62d28bc6b088a1eb810
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2829370
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: John Plate <jplate@google.com>
2021-04-15 21:39:26 +00:00
John Plate 8994fc7be7 Migrate CL entry points to libGLESv2
Bug: angleproject:5759
Change-Id: I79644e7bda3ad0a15eb041b2805b8765c0d22029
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2822258
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: John Plate <jplate@google.com>
2021-04-13 20:50:32 +00:00
John Plate 1d7046ca5d Generate CL stubs in libGLESv2
Bug: angleproject:5758
Change-Id: I6440dacf0db57a56923d2cab5a7c791981ba3b9d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2822248
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2021-04-13 12:41:45 +00:00