17029 Commits

Author SHA1 Message Date
Shahbaz Youssefi
fede75ffbd Fix multi-draw's gl_DrawID in non-multi-draw draws
The uniform value for gl_DrawID was never reset, so if a program was
first used with multi-draw and then without it, gl_DrawID would not
contain zero.

Test credit info-tibo@orange.fr

Bug: angleproject:8245
Change-Id: I73a613ab2858cde4633fadf6a1a523e462167eb0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4662137
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Steven Noonan <steven@uplinklabs.net>
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
2023-07-06 18:05:55 +00:00
Shahbaz Youssefi
0892420bcf Vulkan: Optimize PBO download between RGBA and BGRA
Google Meet hits this path in Chrome when blurring the background.  The
CPU readback was particularly slow on Intel/Mesa where readback from the
temp buffer took hundreds of milliseconds.

This change adds a compute shader that directly copies from the image to
the pack buffer in simple but common cases.

Bug: b/286882707
Change-Id: I9877ea01e3d8377db96f2539362aca67cf832b4a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4657058
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Yuxin Hu <yuxinhu@google.com>
2023-07-06 17:45:07 +00:00
Yuxin Hu
c934d86be8 Update dEQP-GLES mustpass List
1. Reordered gCaseListFiles.

2. Added below must pass list as they are
required by the Khronos CTS:

gles2-khr-noctx-master.txt
gles32-khr-noctx-master.txt
gles32-khr-single.txt

3. Added new test package to run the tests
in these mustpass lists:

angle_deqp_khr_noctx_gles2_tests
angle_deqp_khr_noctx_gles32_tests
angle_deqp_khr_single_gles32_tests

Newly added tests will not be executed on bot yet.
There will be follow-up CL to add these tests on bot.

Bug: b/286921997
Change-Id: Ibc7dbf81dca67ad7be440d559f5b4ee0211c6c41
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4654841
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Yuxin Hu <yuxinhu@google.com>
2023-07-06 17:07:24 +00:00
Shahbaz Youssefi
be41fe2949 Make glColor/DepthMask entry points lockless
These entry points only set state that is entirely accessed by the
owning context (context-local) and thus don't require locking.
glColorMask* functions also affect the cached context state (in
particular draw validity), so the relevant cached state is also modified
to support being locklessly modified.

Bug: angleproject:8224
Change-Id: I221b4efa25fc1c11419d1ac942f1c37e59ec92c0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4658173
Reviewed-by: Igor Nazarov <i.nazarov@samsung.com>
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-06 16:49:07 +00:00
Shahbaz Youssefi
f0deadab14 Revert "Cleanup multiview support"
This reverts commit 9a7c0b88ba.

Reason for revert: Suspected cause of crash on Canary

Original change's description:
> Cleanup multiview support
>
> * Removed remaining mentions of ANGLE_multiview
>
> * Removed AST transformations used only in
>   the side-by-side multiview implementation
>
> * Changed the type of the internal ViewID_OVR
>   variable to use the dedicated qualifier
>
> * Removed side-by-side multiview support
>   from the D3D11 renderer
>
> * Removed an unused helper for side-by-side
>   multiview support from the OpenGL renderer
>
> * Removed obsoleted test suppressions
>
> Fixed: angleproject:3341
> Change-Id: I5e0706cbf26ea820b51400124ddbf2624b738f17
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4660046
> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>

Bug: chromium:1462504
Bug: chromium:1462505
Bug: chromium:1462506
Bug: chromium:1462478
Bug: chromium:1462531
Change-Id: Ie0e76b1c6823db19f68bb67fdfc8abc00cc62f88
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4666209
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-07-06 16:07:03 +00:00
Ian Elliott
d2d44dda1c Mac: Suppress flaky/crashing test
Bug: angleproject:8091
Bug: angleproject:8244
Change-Id: I5825d6268ec0f5b6e31dabad6ecb6bfff1a48677
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4667811
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-06 01:22:04 +00:00
Sunny Sachanandani
2a5c05df74 gl: Handle copyTexSubImage2D failures manually
https://chromium-review.googlesource.com/c/angle/angle/+/4662093 was a
previous attempt at graceful fallback from copyTexSubImage2D, but the
approach in that CL doesn't quite work since it produces an error when
returning from the function which makes the caller also propagate the
error instead of falling back to blit via shader.

This CL makes it so that we handle the error manually and return an
angle::result::Continue with *copySucceededOut=false to indicate to the
caller that it should try a fallback.

Bug: chromium:1458040
Change-Id: I3cd66dcaa6069d5527c3e73190d72ffbba98ae4b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4662393
Auto-Submit: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-06 00:24:42 +00:00
Shahbaz Youssefi
67994c6f0b Workaround app bug with using ESSL 100 extension in ESSL 310
An app has been found that uses GL_OES_EGL_image_external and
GL_OES_texture_3D which are ESSL-100-only extensions in an ESSL 310
shader.

Workaround this app bug by allowing these extensions to be used in all
versions.

Bug: b/285871779
Change-Id: I82262fc407db48d1fdd66967681c8102029cd0b6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4666351
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2023-07-05 23:41:41 +00:00
Cody Northrop
ec8fb51b69 Tests: Add Evony: The King's Return trace
Test: angle_trace_tests --gtest_filter="*evony_the_kings_return*"
Bug: b/266237531
Bug: b/275096133
Change-Id: I32daa8b1bd4f3253887d02a5127ef4682df4951a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4664602
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Commit-Queue: Cody Northrop <cnorthrop@google.com>
2023-07-05 19:51:21 +00:00
Kenneth Russell
9d9ca90bf0 Properly validate _ADJACENCY primitive modes.
After a refactoring in Issue angleproject:5483 and Issue
chromium:1185267, the _ADJACENCY primitive modes were being validated
as legal in context versions where they were not supported.

Thanks to lehoangquyen@ for an initial version of this CL and one of
the two new tests. Verified locally on an ASAN build on macOS (by
manually disabling SwiftShader, where ASAN does not work) that the new
tests pass cleanly.

Test: SimpleOperationTest.PrimitiveModeLinesAdjacentNegativeTest
Test: SimpleOperationTest.DrawsWithNoAttributeData
Bug: chromium:1457840
Change-Id: Icb0945e0081ca6f97355dc60f75d60c3f4f68565
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4661672
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-05 19:44:42 +00:00
Shahbaz Youssefi
4db1308136 Make glClearColor/Depth/Stencil entry points lockless
These entry points only set state that is entirely accessed by the
owning context and thus don't require locking.

Bug: angleproject:8224
Change-Id: I6cddee865ffd38e228f8f87dd14adffb916e0fed
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4658172
Reviewed-by: Igor Nazarov <i.nazarov@samsung.com>
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-05 18:52:57 +00:00
Yuly Novikov
8a8c8fc280 Roll chromium_revision ad19957265..e506ce09ba (1165395:1165897)
Change log: ad19957265..e506ce09ba
Full diff: ad19957265..e506ce09ba

Changed dependencies
* build: e0690c7c78..f87ccdf42a
* buildtools/linux64: git_revision:4bd1a77e67958fb7f6739bd4542641646f264e5d..git_revision:da5fe01bce4ae84b2619caca7a3aa7ec7d3eb8a7
* buildtools/mac: git_revision:4bd1a77e67958fb7f6739bd4542641646f264e5d..git_revision:da5fe01bce4ae84b2619caca7a3aa7ec7d3eb8a7
* buildtools/win: git_revision:4bd1a77e67958fb7f6739bd4542641646f264e5d..git_revision:da5fe01bce4ae84b2619caca7a3aa7ec7d3eb8a7
* third_party/abseil-cpp: 7d4c4bf473..b5862634ee
* third_party/android_sdk: f5874af13b..ea2e39562f
* third_party/android_sdk/public: -VRKr36Uw8L_iFqqo9nevIBgNMggND5iWxjidyjnCgsC..YK9Rzw3fDzMHVzatNN6VlyoD_81amLZpN1AbmkdOd6AC
* third_party/android_sdk/public: RSI3iwryh7URLGRgJHsCvUxj092woTPnKt4pwFcJ6L8C..HWVsGs2HCKgSVv41FsOcsfJbNcB0UFiNrF6Tc4yRArYC
* third_party/android_sdk/public: eo5KvW6UVor92LwZai8Zulc624BQZoCu-yn7wa1z_YcC..u-bhWbTME6u-DjypTgr3ZikCyeAeU6txkR9ET6Uudc8C
* third_party/android_system_sdk: RGY8Vyf8jjszRIJRFxZj7beXSUEHTQM90MtYejUvdMgC..4QeolYaSKWBtVTgzJU4tHUfzA9OJTDM8YUcD426IctwC
* third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/{catapult_..48b31edbfc
* third_party/jdk: 2Of9Pe_OdO4xoAATuiLDiMVNebKTNO3WrwJGqil4RosC..-1zDGMOzS_Qsja50TakJCSqN9C9TYppQrsny4HATSQwC
* third_party/jinja2: 264c07d7e6..515dd10de9
* tools/clang: 36a80749cf..75c7faf556
* tools/perf: 422351564c..159b3b88fd
DEPS diff: ad19957265..e506ce09ba/DEPS

No update to Clang.

BUG=None

Change-Id: I4b8366a4585826221f2843682088ac100dd44f2d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4661021
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Ian Elliott <ianelliott@google.com>
2023-07-05 17:48:07 +00:00
angle-autoroll
cb5cd76d1e Manual roll vulkan-deps from 2b2cba62bfea to e21365bc9170 (38 revisions)
Manual roll requested by ynovikov@google.com
Suppress new VUIDs:
    "VUID-vkCmdDrawIndexed-None-08608",
    "VUID-vkCmdDraw-None-08753",
    "VUID-vkCmdDrawIndexed-None-08753",

https://chromium.googlesource.com/vulkan-deps.git/+log/2b2cba62bfea..e21365bc9170

Changed dependencies:
* glslang: 9575e33186..3ebb72cc74
* spirv-cross: 2d3a152081..b8e742c91b
* spirv-tools: 310a67020a..58459c2b1a
* vulkan-headers: b6a29e5ca8..ad5f8ee975
* vulkan-loader: a1d9d485ce..dce85674e2
* vulkan-tools: 247c806c93..2e5260d44c
* vulkan-validation-layers: 926ffb1f41..4400858043

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/vulkan-deps-angle-autoroll
Please CC
angle-team@google.com,ianelliott@google.com,ynovikov@google.com on the
revert to ensure that a human
is aware of the problem.

To file a bug in ANGLE:
https://bugs.chromium.org/p/angleproject/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: angleproject:8242
Change-Id: I475146b418565e633043f6b57cb07baedcff02ba
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4662877
Commit-Queue: Ian Elliott <ianelliott@google.com>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Ian Elliott <ianelliott@google.com>
2023-07-04 18:24:43 +00:00
Yuly Novikov
c67d97bab9 Expand dEQP-EGL suppression
dEQP-EGL.functional.robustness.reset_context.shaders.out_of_bounds_non_robust.reset_status.writes.*
fail also on SwiftShader Windows.

Bug: chromium:1462139, b/286921997
Change-Id: If20b217ba47f3c3cc0da7a17478424798b406408
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4664801
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
2023-07-04 15:59:32 +00:00
Alexey Knyazev
9a7c0b88ba Cleanup multiview support
* Removed remaining mentions of ANGLE_multiview

* Removed AST transformations used only in
  the side-by-side multiview implementation

* Changed the type of the internal ViewID_OVR
  variable to use the dedicated qualifier

* Removed side-by-side multiview support
  from the D3D11 renderer

* Removed an unused helper for side-by-side
  multiview support from the OpenGL renderer

* Removed obsoleted test suppressions

Fixed: angleproject:3341
Change-Id: I5e0706cbf26ea820b51400124ddbf2624b738f17
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4660046
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
2023-07-04 11:42:21 +00:00
Mohan Maiya
758139051d Update ANGLEExtensionAvailability test expectation
ANGLEExtensionAvailability test should allow vendors
that support VK_EXT_image_2d_view_of_3d Vulkan extension
to expose EGL_KHR_gl_texture_3D_image extension string
with the Vulkan backend.

Bug: angleproject:7320
Test: ImageTest.ANGLEExtensionAvailability*
Change-Id: I3f6d407e100827604124e312bb61a59dbfb50dac
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4658874
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-04 10:36:51 +00:00
Sunny Sachanandani
e70b9b4fe5 gl: Use ANGLE_GL_TRY_ALWAYS_CHECK for CopyTexSubImage
CopyTexSubImage fails with certain formats on Pixel 2 & 4 with a driver
error. TextureGL::copySubTextureHelper has a fallback path to handle
errors, but it gets skipped because BlitGL::copyTexSubImage uses
ANGLE_GL_TRY which doesn't check for GL errors in release builds. This
CL fixes that by using ANGLE_GL_TRY_ALWAYS_CHECK instead which is anyway
intended for any GL call that might allocate memory behind the scenes.

Bug: chromium:1458040
Change-Id: If660f3ef9968338d4ecf7fa20ab481aad84ed981
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4662093
Auto-Submit: Sunny Sachanandani <sunnyps@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-04 09:44:36 +00:00
Ian Elliott
db3537aa00 Vulkan: Suppress VVL "VUID-vkCmdDraw-None-08608"
Bug: angleproject:8242
Change-Id: Ia446cfc370ad6ade4967644416dee9e18aaaa0d3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4664612
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-04 01:50:11 +00:00
Igor Nazarov
25ce3dfec6 Use compare_exchange_weak() in AllocateGlobalMutexImpl()
Speculative fix of the crash.

New logic will ensure that `currentMutex` is not `nullptr` when returned
from `AllocateGlobalMutexImpl()`

Also removed explicit memory order for safety (no actual difference in
generated code on ARM64/x86-64, but ARM generates less instructions).

Bug: chromium:1457915
Change-Id: I8d932ee499f9d8ee4e38ab2173f4f1cefd0aa294
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4650794
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-30 15:49:01 +00:00
Alexey Knyazev
20cc4a9bc2 D3D11: Fix non-trivial blits for snorm buffers
Bug: angleproject:8048
Change-Id: Ifec7ea71e0ab88f545ae088b0faae4b95512a207
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4654315
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
2023-06-29 19:19:27 +00:00
Charlie Lao
166579637b Vulkan: Improve SyncVk::serverWait
If sync object has already finished, there is no need to insert pipeline
barrier. With this CL, asphalt_9 average frame time reduces from 5.464
ms to 5.268 ms (-3.58%), making it 85% of native GLES (4.49 ms) on pixel
7 pro.

Bug: b/277644512
Change-Id: I112ccef0619da3c05cba44066327edc0bb81c366
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4651599
Reviewed-by: Roman Lavrov <romanl@google.com>
Commit-Queue: Charlie Lao <cclao@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-29 18:40:59 +00:00
Shahbaz Youssefi
ccf8530b4e Split context state by locality of get/set effect
Some state are purely local to the context when get or set.  For
example, the state of depth test does not affect and is not affected by
any other state.

Some state on the other hand may affect other contexts.  In particular,
some objects are shared between contexts of a share group, and may
affect each other through the observer interface.

These sets of state are separated to create a clear boundary between
state that can and cannot be accessed without holding the share group
lock.  A follow up change removes locking from the entry points that
purely access the former set of states.

For the latter state, it is likely possible to access most if not all of
them without holding a lock, but careful inspection is required before
that can be considered.  In particular, most entry points that simply
bind an object are likely harmless if the ref counter is turned atomic.

Bug: angleproject:8224
Change-Id: I91c3fa9de870c13d48012a5e06c177dab4010907
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4651375
Reviewed-by: Charlie Lao <cclao@google.com>
Reviewed-by: Roman Lavrov <romanl@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-29 16:20:48 +00:00
Shahbaz Youssefi
5f581f879c Pass dirty bits by value
Split CL from follow up change where the dirty bits need to be passed
by value as they are calculated from two sets.  Many cached dirty bits
are turned to constexpr as a result.

Bug: angleproject:8224
Change-Id: Ibdb3090d6ee93788e1502b72bce55f4677937c58
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4650074
Reviewed-by: Roman Lavrov <romanl@google.com>
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
2023-06-29 14:42:28 +00:00
Alexey Knyazev
0e7c79e3b2 Vulkan: Fix resolve with multiple targets of different formats
Ensure that the appropriate code path is taken
when resolving into multiple target buffers of
different formats.

Bug: chromium:1123524
Change-Id: Ic25a52ba069a2209c907226613fde1109823c094
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4650561
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
2023-06-29 14:25:53 +00:00
Cody Northrop
77c4b67791 Vulkan: Suppress PointSize VVL error
Bug: angleproject:8237
Bug: angleproject:2796
Bug: b/288961771
Change-Id: I7e4b364225c61fd72091e9d84d45eb71a02a5597
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4653398
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Auto-Submit: Cody Northrop <cnorthrop@google.com>
2023-06-28 17:52:29 +00:00
L. E. Segovia
ed391dae33 Replace extern thread_local to avoid GCC < 9.1 bug
GCC generates broken code for mingw-w64 target when accessing `extern
thread_local` variables from another compilation unit.

See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104862

See:
https://invent.kde.org/graphics/krita/-/blob/master/3rdparty/ext_googleangle/02-patches_krita/0017-Replace-extern-thread_local-to-avoid-GCC-mingw-w64-b.patch

Co-authored-by: Alvin Wong <alvinhochun@gmail.com>
Bug: None
Change-Id: Ief0036054e644d40b8b0e86ed990280e566da2a9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4637587
Auto-Submit: L. E. Segovia <amy@amyspark.me>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-27 22:05:50 +00:00
Steven Noonan
f150cf100d Vulkan: minor pipeline cache chunk key hash bugfix
The hash key was not correctly streaming the chunk index into the key
string -- "chunkIndex" here is a uint8_t, which the ostream incorrectly
identified as a character rather than byte. So the "std::hex" modifier
didn't have any effect and chunkIndex 0 had a truncated key.

Bug: angleproject:8231
Change-Id: Icb4977b658214979e08f66fcb98217259d4799ee
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4639493
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-27 19:05:01 +00:00
Steven Noonan
113f847be6 centralize basic OS/platform detection functions
We had multiple different places that defined these, and with varying
naming schemes. Centralize them to be defined in platform_helpers.h.

Also renaming the IsApple(uint32_t) functions to IsAppleGPU(uint32_t) to
avoid ambiguous meaning: "IsApple" should mean "is Apple-vended OS"
while "IsAppleGPU" should mean "is Apple GPU vendor ID".

Bug: angleproject:8229
Change-Id: If4e3fc5ac1b5b8ad416663950a1b2ee912ccad99
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4647291
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Steven Noonan <steven@uplinklabs.net>
Auto-Submit: Steven Noonan <steven@uplinklabs.net>
Reviewed-by: Roman Lavrov <romanl@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-27 18:21:04 +00:00
Amirali Abdolrashidi
b1b12d4aa6 Vulkan: Move device OOM tests to new test suite
* Moved the device OOM tests from VulkanImageTest to a new test suite,
  VulkanMemoryTest.
  * It is instantiated for ES3.

* Moved the slow tests in the expectation file to the end.

Bug: b/280304441
Change-Id: Icc958b5eb071567f8e6671661302760c7f5e3621
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4639041
Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
2023-06-27 17:33:42 +00:00
Igor Nazarov
9faf7059f9 Optimize angle::Spinlock performance
This optimization is a preparation for future commits.

Performance was tested by defining `ContextMutexType = angle::Spinlock`
to use `SharedContextMutex<angle::Spinlock>` as `mSharedContextMutex`.

Test result is average time for 1000'000 `glGetError()` calls on S906B
with locked CPU frequencies:

    SharedContextMutex<angle::Spinlock>
        Before the optimization:        14.289 ms
        After the optimization:         12.941 ms (-9.4%)

Performance when not using `angle::Spinlock` (current code):

    SingleContextMutex:                  9.115 ms  (-36.2%)
    SharedContextMutex<std::mutex>:     29.186 ms (+204.3%)

Bug: angleproject:8226
Change-Id: I447ff807cd6b72ff3fc115e73736fe63eb642785
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4632728
Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-27 17:22:16 +00:00
Mark Lobodzinski
5f6d78487b Android: Add/update MaliG710 expectations and tests
Fixed End2End tests causing valiadation errors where
VK_EXT_primitives_generated_query was being enabled without enabling
VK_EXT_transform_feedback.

Consolidated the DEQP-GLES3 expectations for the
functional.transform_feedback* tests, updated some changed
test names.

These test expectations were collected from the 43.0 driver
version.

Bug: b/285628492
Bug: angleproject:8212
Change-Id: I224a2eec33ee56b7303d17aebd998de65354106c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4626241
Reviewed-by: Ian Elliott <ianelliott@google.com>
Reviewed-by: Mark Łobodziński <mark@lunarg.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Mark Łobodziński <mark@lunarg.com>
2023-06-27 15:32:00 +00:00
Constantine Shablia
0e3d200d9c Tests: Add paletted formats glGetTexImageANGLE tests
Test: angle_end2end_tests
        --gtest_filter=GetImageTestES1.PalettedTexImage*

Bug: angleproject:7710
Change-Id: I1c7edcbeae86d88076deffb2b8484ecd85a4b773
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4629690
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Cody Northrop <cnorthrop@google.com>
Auto-Submit: Constantine Shablya <constantine.shablya@collabora.com>
2023-06-27 04:42:13 +00:00
Mohan Maiya
122b292d96 Fix bug in ProgramPipelineObjectBenchmark
Bug: angleproject:5102
Test: ProgramPipelineObjectBenchmark*
Change-Id: I8d596ce7d6d9866b3333e675b40d9aad470525e6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4647096
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: mohan maiya <m.maiya@samsung.com>
2023-06-27 03:33:19 +00:00
Steven Noonan
42c3a9fe3e Vulkan: support creating context with MoltenVK on macOS
The Vulkan loader somewhat recently introduced a requirement that
clients must opt-in to using portability implementations of Vulkan (such
as MoltenVK). Since there is no native Vulkan driver for macOS (and
therefore no alternative), unconditionally enable the portability
enumeration extension there.

Bug: angleproject:8229
Change-Id: I24f0f24e25abd277855ed9ac4de370cfb47d3266
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4639495
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Steven Noonan <steven@uplinklabs.net>
Reviewed-by: Charlie Lao <cclao@google.com>
Auto-Submit: Steven Noonan <steven@uplinklabs.net>
2023-06-27 02:25:34 +00:00
Amirali Abdolrashidi
232506e1d3 Vulkan: Free the garbage memory before realloc
The previous CL added the feature of freeing garbage memory in the
event of device OOM. However, it was for image allocations only.

* Extended finishing commands and freeing the garbage to buffers.

* Added unit test to allocate buffer after freeing memory space on the
  device.

Bug: b/280304441
Change-Id: I540b27a41b34d1ceb1cd3119213341c9f290ea38
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4540209
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Reviewed-by: Charlie Lao <cclao@google.com>
2023-06-27 00:26:54 +00:00
Amirali Abdolrashidi
5f9548c35b Vulkan: Free the garbage memory before realloc
Currently image allocations fall back to system memory in case of
a device OOM. However, in some cases, it is also possible to gain
some memory by freeing garbage memory from the device. This allows
us to keep the allocation on the device memory.

* Updated the image allocation fallback, so we will try cleaning the
  garbage memory through the renderer before retrying the allocation.

  * finishOneCommandBatchAndCleanup() in RendererVk, which will call a
    similar function in its CommandQueue. It will be called until there
    are no more in-flight submissions.

  * The existing finishOneCommandBatchAndCleanup() in CommandQueue has
    been renamed to finishOneCommandBatchAndCleanupImpl().

* Updated the flags used for VMA image allocations. If any device memory
  is freed after garbage cleanup to make enough space for the new
  allocation, it will take precedence over the system memory.

* Added unit tests in which a new image allocation could happen on the
  device after freeing the garbage memory.
  * They use a 2D texture and a 2D texture array for garbage.

Bug: b/280304441
Change-Id: Ia5e605e180833b44af8c77550ab1b0b8ba21724e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4547941
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
2023-06-27 00:23:23 +00:00
Charlie Lao
02292814a9 Vulkan: Optimize the usage of FastMap in DescriptorSetDescBuilder
While looking at disassemble of
DescriptorSetDescBuilder::updateOneShaderBuffer() function, I noticed
that there are a lot of CPU cycles spent in FastMap::operator[]. What
happend here is that we are increasing size one by one as we build
descriptorSet, and that hit `if (mData.size() <= key)` case and we end
up resize the underline FastVector, and that resize also initialize the
element with zeros, which immediately overwrite by actual data. Since we
actually know the eventual size of
DescriptorSetDescBuilder::mDesc/mHandles/mDynamicOffsets, we could just
switch to angle::FastVector which will avoid this check size and grow
every time we write to it. This CL switches the use of FastMap in
DescriptorSetDescBuilder to FastVector. The only trick we need to watch
out is that previously the new elements are always zero filled and now
it does not. So we need to make sure we write every field of structure.

This CL also renames WriteDescriptorDescBuilder to WriteDescriptorDescs
since when it is read only we are passing it as const reference already,
there is no added advantage to have two classes.

Bug: b/282194402
Change-Id: I06a063cc51585fc17fbf0d5aa916b9aa0ab88dd4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4581881
Reviewed-by: Roman Lavrov <romanl@google.com>
Commit-Queue: Charlie Lao <cclao@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-27 00:10:01 +00:00
Amirali Abdolrashidi
cba77bceb2 Disable device OOM tests for Linux/NVIDIA
* Disabled the device OOM test in VulkanImageTest for Linux/NVIDIA
  systems, due to potentially affecting other tests with flakiness.

Bug: angleproject:8236
Change-Id: I4dc0e4f22149507350093708031e05ded5e5c18e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4647294
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
2023-06-26 22:06:45 +00:00
Shahbaz Youssefi
cafbf6e266 Vulkan: Simplify active uniform check
Bug: angleproject:7220
Change-Id: Ic0f26f3d09bac570d4ed3f791c456d569208424a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4636869
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-26 20:39:24 +00:00
Amirali Abdolrashidi
61eda436a5 Fix TexImage3D validation for 2D arrays below ES3
Currently if we try to define a 2D texture array in ES2, a crash
occurs during its validation. Since texture3DOES only adds support to
3D textures, we should make sure the validation only passes if ES3 and
above are used.

* Added check for 2D texture array usage in validating glTexImage3D().

Bug: angleproject:8213
Change-Id: Ib477d8b6eec89c35d605a1b575bfb5519d19452e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4618955
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-26 20:00:07 +00:00
Roman Lavrov
4a4b13cc69 Fix SixteenBppTextureDitheringTestES3 formats
Copy-paste mistake from https://crrev.com/c/4628974

Bug: b/284462263
Change-Id: Id9f78386a0c1495c4c2e32d0c5b18a8e2f5cc74a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4645735
Auto-Submit: Roman Lavrov <romanl@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Roman Lavrov <romanl@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-26 19:52:02 +00:00
Yuxin Hu
2283d2d0e3 Update the mustpass list that dEQP-EGL tests uses
Android CTS and Khronos CTS use different set of
dEQP tests. android/cts contains mustpass lists
for Android CTS. We have test coverage in the
Android CTS in Android testing infra, and we would
like ANGLE standlone deqp test runner to cover the
Khronos CTS. Update the dEQP-EGL test runner to use
the mustpass list that Khronos CTS uses.

Since the test lists changed, some tests in
expectation files are no longer needed, as they
are not within Khronos CTS mustpass list. Keeping
them in the expectation file will cause test runner
exception as the test runner does check if the test
listed in the expectation file is in the mustpass list.

Bug: b/286921997
Bug: angleproject:6277
Bug: angleproject:7506
Bug: angleproject:6528
Change-Id: I7851b854322985f564cbb56d804f04f663d947aa
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4619627
Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Reviewed-by: Charlie Lao <cclao@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
2023-06-26 17:27:24 +00:00
Shahbaz Youssefi
2e20951645 Move state dirty bits definitions out of the class
This is in preparation for a follow up change that splits the state
class.

Bug: angleproject:8224
Change-Id: Ic9b253583e40fcc93ff37605b6b6e1deb55a6e55
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4631843
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2023-06-26 17:20:43 +00:00
Mohan Maiya
a31e8c3023 Refactor Image colorspace tests for better readability
1. Always upload color values encoded in sRGB colorspace for
   sampling tests and linear colorspace for rendering tests.
   Depending on attribute list, the test will either expect
   color decoded in linear space or sRGB color value as is
2. Add helper functions that determine expected output color
   for a given attribute list and EGLImage usage

Refactor TEST and helper functions to account for the above updates

Test: ImageTest*_Colorspace*
Bug: angleproject:3756
Change-Id: I54ae22b2d379e6fdfa04429849de5efe9684caf4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4643452
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: mohan maiya <m.maiya@samsung.com>
2023-06-26 17:17:41 +00:00
Mohan Maiya
0fe6f28262 Reset and then populate frontend features during display initialize
Overwritten features were never reset even if a display was
terminated. On platforms that reuse displays for all tests
in the end2end suite, overridden feature would leak into
subsequent tests causing unexpected failure.

Bug: angleproject:8235
Change-Id: I1b359bc762a2bca8db4e4dbc7a587604e5bd6a5b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4643453
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: mohan maiya <m.maiya@samsung.com>
2023-06-26 17:15:59 +00:00
Shahbaz Youssefi
ec1f18db02 Vulkan: Remove ShaderVariableType and flatten info map
With the conversion of the interface variable info map keys to SPIR-V
ids, there is no longer a benefit to bucket resources by their type.
This change removes this bucketing and flattens the map.

Bug: angleproject:7220
Change-Id: If83cb02ca9e91f72dddb2deb7313fee40f9f06c3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4632577
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-26 17:14:26 +00:00
Steven Noonan
04965ddeb5 D3D11: identify D3D11on12 in renderer string
The renderer string didn't previously give any indicator of whether the
context was created as D3D11 or D3D11on12.

Bug: angleproject:8233
Change-Id: Iee8ae4698c1e08d1826249d92f232a153cd0ee4c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4639492
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2023-06-26 17:00:59 +00:00
Shahbaz Youssefi
b5f87c0402 Vulkan: Simplify shader interface variable map
The shader interface variable map had a "resource index" -> info map to
optimize descriptor set building.  That avoided hashing the resource
name when the rest of the map was name-based.

With the map using SPIR-V ids now, there is no reason to maintain this
map; SPIR-V ids can be used to look up the info just as efficiently.

Bug: angleproject:7220
Change-Id: I619783dce558a59184955cc314c1f41e6733f1b7
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4630728
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
2023-06-26 16:32:11 +00:00
Steven Noonan
7a38d61440 remove ScheduleYield, replace with std::this_thread::yield
Instead of hand-rolling this function, just use std::this_thread::yield,
which has the advantage of being cross-platform and using an underlying
implementation that's actually more correct on Windows[1][2].

    [1] 40640c6df9/stl/src/cthread.cpp (L84-L86)
    [2] https://joeduffyblog.com/2006/08/22/priorityinduced-starvation-why-sleep1-is-better-than-sleep0-and-the-windows-balance-set-manager/

Bug: angleproject:8232
Change-Id: I9053fa362f328dc45b7c13f5f70818adf89a290f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4639490
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-26 16:19:44 +00:00
Steven Noonan
131acc3133 Vulkan: fix blob caching of initial pipeline cache
When creating a new pipeline cache and the blob cache doesn't have
a matching one we can load, we unintentionally skipped serializing it to
the blob cache until the pipeline cache state changed later on.

Bug: angleproject:8230
Change-Id: If86d1bd169a63da9f9a394284a754bccb7d52e20
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4639496
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-26 16:11:21 +00:00