Commit Graph

21583 Commits

Author SHA1 Message Date
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
angle-autoroll
f015b25357 Roll VK-GL-CTS from f29bd2feeaff to 12bc45af35d5 (10 revisions)
f29bd2feea..12bc45af35

2023-06-23 lorenzo@khronosgroup.org Merge remote-tracking branch
'vk-gl-cts/opengl-es-cts-3.2.9'
2023-06-23 piotr.byszewski@mobica.com Regenerate mustpass
2023-06-23 aitor@lunarg.com Test partial binding of depth/stencil images
2023-06-23 piotr.byszewski@mobica.com Test commands on transfer-only
queue
2023-06-23 cturner@igalia.com Allow DECODE_OUTPUT and DECODE_DPB
features for YCbCr formats
2023-06-23 matt.coster@imgtec.com Don't attempt pipeline library tests
without VK_KHR_pipeline_library
2023-06-23 rgarcia@igalia.com Test occlusion and frag shader inv counts
with flat shading
2023-06-23 alyssa@rosenzweig.io surfaceless: Fix shared contexts and
implement makeCurrent
2023-06-23 lorenzo@khronosgroup.org Merge vk-gl-cts/vulkan-cts-1.3.6
into vk-gl-cts/main
2023-06-22 alexander.galazin@imgtec.com Notice of withdrawal of Vulkan
CTS 1.3.3.x

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/vk-gl-cts-angle-autoroll
Please CC angle-team@google.com,solti@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: None
Tbr: solti@google.com
Change-Id: I96a35e762f3cd5585027a5afa84d160619ee02c9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4646068
Bot-Commit: angle-autoroll <angle-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: angle-autoroll <angle-autoroll@skia-public.iam.gserviceaccount.com>
2023-06-26 16:20:45 +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
L. E. Segovia
0574f0ab5b CLRefPointer: fix reference to STL type for MinGW Clang
See:
https://invent.kde.org/graphics/krita/-/blob/master/3rdparty/ext_googleangle/02-patches_krita/0012-Fix-Clang-MinGW-target-build.patch

Co-authored-by: Alvin Wong <alvinhochun@gmail.com>
Bug: None
Change-Id: I0b7acebf7246297cbf8aa5062256c7008f78cf7b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4637586
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Auto-Submit: L. E. Segovia <amy@amyspark.me>
2023-06-26 15:27:41 +00:00
Steven Noonan
f6c7dc8918 Spinlock: implement ANGLE_SMT_PAUSE for ARM/ARM64
This intrinsic is available on GCC, Clang, and MSVC.

Bug: angleproject:6067
Change-Id: I010eefa3417df196407fb8182c0de927f4bf0cab
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4639491
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-26 15:06:25 +00:00
Shahbaz Youssefi
764f31be32 Add more BitSetArray tests
Bug: angleproject:8224
Change-Id: I8835da245df52e1be2e3e4ea17e32ce8c438e51e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4636870
Reviewed-by: Roman Lavrov <romanl@google.com>
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Roman Lavrov <romanl@google.com>
2023-06-26 14:13:30 +00:00
Amirali Abdolrashidi
7169dc5fe0 Fix vsync and offscreen for restricted_trace_perf
* Updated the command used to run the trace so it would use the mode
  input, which includes --vsync and --offscreen.

Bug: angleproject:8234
Change-Id: Ia761e369993183dcdfb66383f3006cf660044add
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4641272
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
2023-06-23 21:24:37 +00:00
Yuly Novikov
f834ba7fda Switch Linux SwANGLE testing to Ubuntu22.04
Turn off experimental builders at the same time.

Bug: chromium:1380082
Change-Id: I1cf5f3efef791819ad01af63197bb931af10e019
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4639183
Reviewed-by: Brian Sheedy <bsheedy@chromium.org>
Auto-Submit: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
2023-06-23 19:12:34 +00:00
L. E. Segovia
566f1ee465 mathutil: Enable usage of builtins for MinGW GCC too
See:
https://invent.kde.org/graphics/krita/-/blob/master/3rdparty/ext_googleangle/02-patches_krita/0011-Fix-MinGW-build.patch

Co-authored-by: Alvin Wong <alvinhochun@gmail.com>
Bug: None
Change-Id: I9663a11d62a61674b361fc46eeb53b3c3096ccbd
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4637585
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Auto-Submit: L. E. Segovia <amy@amyspark.me>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2023-06-23 18:29:27 +00:00
Gregg Tavares
bc2d5ed01f Fix wrong size computation in test
Bug: angleproject:8227
Change-Id: Idde149465de57db4091847dfdb213a63bc4e3e2c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4638742
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2023-06-23 17:50:11 +00:00
angle-autoroll
2e285bb591 Roll SwiftShader from ae667fe96db9 to afd97bf1e914 (3 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/ae667fe96db9..afd97bf1e914

2023-06-21 hwennborg@google.com Fix incorrect use of scoped enumerations
in format string
2023-06-20 jif@google.com Update Reactor/LLVMJIT for RISC-V.
2023-06-20 jif@google.com Add files back to fix build on RISC-V

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

To file a bug in SwiftShader:
https://bugs.chromium.org/p/swiftshader/issues/entry
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: None
Tbr: ynovikov@google.com
Use-Permissive-Angle-Pixel-Comparison: True
Change-Id: Ica3d7b0678cda26039fdd6d5ad6292a919f82ce9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4638272
Bot-Commit: angle-autoroll <angle-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: angle-autoroll <angle-autoroll@skia-public.iam.gserviceaccount.com>
2023-06-23 11:48:32 +00:00
angle-autoroll
9211ebf1f2 Roll Chromium from 0b8bd02c6abc to 14fa1a826dad (564 revisions)
0b8bd02c6a..14fa1a826d

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

To file a bug in Chromium:
https://bugs.chromium.org/p/chromium/issues/entry
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

Changed dependencies
* build: 8c37146184..4438010153
* buildtools: 18ae18e1fc..ad9b993f2f
* buildtools/third_party/libc++/trunk: 38a8ad0f7e..745104ff4a
* testing: 8a35ff2cfd..75c78f8f64
* third_party/abseil-cpp: 3562169a5c..8f8f07bdce
* third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/{catapult_..143fef4b41
* third_party/depot_tools: a59c3eb470..98d3bb27f0
* third_party/fuchsia-sdk/sdk: version:13.20230621.2.1..version:13.20230622.3.1
* third_party/zlib: e6795474e4..f81f385906
* tools/android: 12312e22b3..9b4ea9e0d4
* tools/mb: 5593da17f4..f80577ef22
No update to Clang.

Bug: None
Tbr: ynovikov@google.com
Change-Id: I3786657034cf893efceb46fc9191f27b1625e991
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4639487
Bot-Commit: angle-autoroll <angle-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: angle-autoroll <angle-autoroll@skia-public.iam.gserviceaccount.com>
2023-06-23 08:33:27 +00:00
Shahbaz Youssefi
16d65289e8 Vulkan: Remove hashing of the SPIR-V id in variable map
The interface variable ids are already mostly packed, so a flat array
will do with the id as key.

Bug: angleproject:7220
Change-Id: I17cded0378b1b67379b979b00d69bbe04088a840
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4628975
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-23 04:47:22 +00:00
Steven Noonan
ac4f52c4f7 Vulkan: release all resources on RendererVk destroy
The most important part of this is unloading the libvulkan handle. We
open the handle in ::initialize but we were previously only unloading it
in ::~RendererVk[1]. Since a DisplayVk (and RendererVk) are not
destructed in between context creations, this meant that the libvulkan
library handle reference count only increased, never decreased.

[1] Which, incidentally, never gets invoked, ever. We create Display
    instances and they live forever in a static structure and we only
    ::initialize/::terminate them.

Bug: angleproject:8225
Change-Id: I03da9b19f0c4ae3b5efacd07880aadb7ee77ebf5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4636882
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-23 04:34:59 +00:00
Shahbaz Youssefi
c1ba8e6f28 Vulkan: Flatten shader interface variable maps
This change removes duplicate entries added in the shader shader
interface variable maps.  One level of arrayness (indexed by shader
type) is removed from these maps as now there is only a single  entry
per linked resource/etc.

Bug: angleproject:7220
Change-Id: Ibf2d06a0e1f68e68797c2066f36e14cb9e667f77
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4628677
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-23 03:12:59 +00:00
Maksim Sisov
4ed2d403a3 metal: disable render to texture extension.
It's implemented incorrectly in the current backend (or not
implemented at all).

Once it's fixed, we can turn on that again.

Bug: angleproject:3107, angleproject:6395, chromium:1424910
Change-Id: I176327b027b25084525a242c81c1625efe43c89a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4634659
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2023-06-22 19:09:07 +00:00
Shahbaz Youssefi
75065c575f Vulkan: Fix email in OWNERS
Bug: None
Change-Id: I552b0192e5d191a7d759c15b809486b7f1ee1f57
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4636781
Commit-Queue: Charlie Lao <cclao@google.com>
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
2023-06-22 16:55:48 +00:00
Geoff Lang
70ecc80f03 Metal: Store MSL in shared pointers to immutable strings
The translated metal shader source is quite large and we store copies
in both ProgramMtl and mtl::LibraryCache.

Instead, store the source in shared_ptrs to immutable strings. This has
a nice side effect of simplifying the cache keys for mtl::Library cache
and avoiding string copies.

This saves about 4% GPU process memory.

Since these strings are rarely accessed, the overhead of shared_ptr is
not a concern.

Bug: chromium:1329376
Change-Id: I507529ff1e25cc6aafead272fc9bb6ab0b8dbe88
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4614361
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Quyen Le <lehoangquyen@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2023-06-22 16:24:04 +00:00
Geoff Lang
8bc7fffb8b Include framebuffer completeness reason in draw errors
Framebuffers have a much more detailed "reason" string for framebuffer
completeness errors. Make sure that reason is printed when a draw call
fails due to incomplete framebuffer.

Rework how draw validation errors are stored to keep the extra GL error
enum.

Bug: chromium:1455725
Change-Id: I5984452c5aab4f8ccb73d43bd63bca1aae53e847
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4632578
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2023-06-22 15:52:58 +00:00
Geoff Lang
ecf245ff4c Metal: Don't force all incomplete textures to initialize
ensureIncompleteTexturesCreated is called in every syncState and
initializes all types of incomplete textures, even when they are not
used.

Skip it entirely. ContextMtl::getIncompleteTexture already lazily
creates the incomplete textures, per type.

This saves about 1mb (~5% of ANGLE's allocations for Chrome) of
malloc'd memory per context.

Bug: chromium:1329376
Change-Id: I14ab7098ce2e486383d1d0d41039f0e526755878
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4615190
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Quyen Le <lehoangquyen@chromium.org>
2023-06-22 15:29:55 +00:00
Roman Lavrov
e431b3e449 Add pixels checks to bandingTest on Android +toggle GL_DITHER
Bug: b/284462263
Change-Id: I69122d1d53d03a2e75d498e77a669099a568ab3c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4628974
Commit-Queue: Roman Lavrov <romanl@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-22 14:06:57 +00:00
Roman Lavrov
6e99d6bc07 Only build angle_capture_tests_trace when building traces
Some PGO build failed in Chromium. Standalone ANGLE testing is
currently sufficient.

Bug: chromium:1456291
Change-Id: I5a685020afdfe152348d282a28379c3b628d5964
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4636681
Commit-Queue: Roman Lavrov <romanl@google.com>
Auto-Submit: Roman Lavrov <romanl@google.com>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
2023-06-22 13:42:52 +00:00
Shahbaz Youssefi
bbcf54bcb7 Vulkan: Refactor uniform/block binding duplication code
Previously, resource binding assignment was done as such:

```
for each shader stage
  assign bindings to textures
  assign bindings to blocks
  assign bindings to images
  etc
```

To deduplicate bindings when the same resource was used in multiple
stages, a map was used, keyed by the resource's name, to detect when an
already visited resource is encountered in a future stage.  This was
both inefficient and unnecessarily complicated.

With this change, resource binding assignment is done as such:

```
for each texture
  assign one binding to all shader stages
for each block
  assign one binding to all shader stages
for each image
  assign one binding to all shader stages
etc
```

The aforementioned map is removed.

Because the resource bindings are now changed, the rest of the code
(which sets up the pipeline layout, updates descriptor sets, sets
dynamic buffer offsets, etc) are all updated to follow the above
pattern.  As a result, nested loops are avoided and duplicate entries in
the variable map are never visited.

Bug: angleproject:7220
Change-Id: Iaff7b5f8b2bada8ac5078d21e5c790bf0d27aca7
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4622011
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
2023-06-22 13:24:35 +00:00
angle-autoroll
7658525166 Roll vulkan-deps from bcc1118ec796 to 23a32754e715 (6 revisions)
https://chromium.googlesource.com/vulkan-deps.git/+log/bcc1118ec796..23a32754e715

Changed dependencies:
* glslang: 6a7ec4be7b..9575e33186
* spirv-headers: 6e09e44cd8..10db9d4e19
* spirv-tools: a63ac9f73d..54691dcd73
* vulkan-loader: 27e1acf1e9..b02d69f3a1
* vulkan-validation-layers: 1642f520f4..cb9c77d609

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,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: None
Tbr: ynovikov@google.com
Change-Id: I3221bd8d99ad62e711040d6a43ccb3e95971e91c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4636170
Commit-Queue: angle-autoroll <angle-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: angle-autoroll <angle-autoroll@skia-public.iam.gserviceaccount.com>
2023-06-22 10:58:05 +00:00
angle-autoroll
a2b3f9b646 Roll Chromium from 75b049842ff8 to 0b8bd02c6abc (547 revisions)
75b049842f..0b8bd02c6a

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

To file a bug in Chromium:
https://bugs.chromium.org/p/chromium/issues/entry
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

Changed dependencies
* build: 160bff3d7a..8c37146184
* buildtools: 0cf6a99585..18ae18e1fc
* buildtools/third_party/libc++/trunk: 055b2e17ae..38a8ad0f7e
* testing: 2d4146a8f0..8a35ff2cfd
* third_party/abseil-cpp: c6d7cf4e8c..3562169a5c
* third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/{catapult_..6c0cc79e43
* third_party/depot_tools: 4ec095fa85..a59c3eb470
* third_party/fuchsia-sdk/sdk: version:13.20230620.2.1..version:13.20230621.2.1
* third_party/r8: rByCj9NgDDYIIW97qHizKUoC4pyBnIbr-mHt_DcskjYC..vw5kLlW3-suSlCKSO9OQpFWpR8oDnvQ8k1RgKNUapQYC
* tools/android: 182d3b233e..12312e22b3
* tools/clang: 86501dda63..ff9b9e9ce2
* tools/mb: 87b12f417f..5593da17f4
No update to Clang.

Bug: None
Tbr: ynovikov@google.com
Change-Id: Ie26f2cb73dde85e31dbc919f6051b64bbdf70009
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4635326
Commit-Queue: angle-autoroll <angle-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: angle-autoroll <angle-autoroll@skia-public.iam.gserviceaccount.com>
2023-06-22 09:08:41 +00:00
Steven Noonan
ac263582dd Vulkan: add workaround for VK_EXT_full_screen_exclusive on AMD
On outdated (but recent) AMD drivers, the Windows-only Vulkan extension
VK_EXT_full_screen_exclusive appeared to be implicitly enabled and set
to VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT mode. Even though
ANGLE did not enable or interact with this extension at all, the driver
was incorrectly returning VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT
error codes on various swapchain operations when the full screen window
focus was lost (i.e. alt-tab out and back in). Naturally, ANGLE was not
expecting these error codes and did not know how to handle them.
Depending on where the errors occurred, ANGLE might crash or retry
creating the swapchain repeatedly.

Treating the unexpected VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT
error code as VK_ERROR_OUT_OF_DATE_KHR/VK_SUBOPTIMAL_KHR was not
sufficient, because the driver would repeat the error on every swapchain
operation, apparently expecting the error to be handled by
a vkAcquireFullScreenExclusiveModeEXT call (even though that would make
no sense, since the extension was not enabled).

The incorrect driver behavior was reported to AMD and was fixed in
recent driver releases. The earliest driver I've tested and know to be
working is AMD's Adrenaline driver version 23.5.2
(VkPhysicalDeviceProperties calls this driverVersion 2.0.262/0x800106).
The last known bad version was 0x8000e9.

The simplest workaround on these older AMD graphics drivers is to
explicitly enable the extension, but set it to
VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT mode. On newer drivers we do not
need to do anything with the extension and can ignore it.

Bug: angleproject:8215
Change-Id: I7c58d47a0350f4b0bc1a77f200c1e2f72fcde8d8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4627279
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
2023-06-21 20:37:29 +00:00
Nico Weber
c23029d2fe [apple] Fix build with newer libc++
Using `return mPtr` without a `*` works too, but it looks lie these
methods are unused, so just remove them.

Bug: chromium:1454568
Change-Id: Ie4441ac611787765e354480561e6a0e25aefa159
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4631841
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
2023-06-21 18:55:41 +00:00
Yuly Novikov
74cf0be3fe Temporarily remove NVIDIA testing from mac-test
To facilitate removing macOS 10.14 support while MacBook Pro 2013
machines are being upgraded to a newer OS version.

Bug: chromium:1456549
Change-Id: Ibb3e597d82482c1c86010f94aa4c75cd9bf44995
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4632818
Auto-Submit: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2023-06-21 17:00:06 +00:00
Geoff Lang
954b3339e8 Add internal format to TexStorage validation errors
Print the hex value of the internal format when generating error
messages about invalid internal formats in glTexStorage.

Bug: chromium:1455725
Change-Id: Ia99c8891c5510590a3fcaf3699476942bf80b57c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4632579
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2023-06-21 16:14:26 +00:00
Shahbaz Youssefi
b28ba57e06 Update OWNERS
Bug: None
Change-Id: I20ed7c410967cb207c50e32af58abacc6ddb816c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4628679
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-21 13:52:39 +00:00
angle-autoroll
789c444aaa Roll vulkan-deps from 90577eb35eea to bcc1118ec796 (12 revisions)
https://chromium.googlesource.com/vulkan-deps.git/+log/90577eb35eea..bcc1118ec796

Changed dependencies:
* vulkan-loader: db51885950..27e1acf1e9
* vulkan-tools: ca8bb4ee3c..07924a8a49
* vulkan-validation-layers: e2be2287f4..1642f520f4

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,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: None
Tbr: ynovikov@google.com
Change-Id: I8ed972fa617400e26a1753b0069d3036ea28d12e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4629513
Commit-Queue: angle-autoroll <angle-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: angle-autoroll <angle-autoroll@skia-public.iam.gserviceaccount.com>
2023-06-21 11:59:00 +00:00
angle-autoroll
beff6830b9 Roll Chromium from 4c627b09fbd1 to 75b049842ff8 (625 revisions)
4c627b09fb..75b049842f

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

To file a bug in Chromium:
https://bugs.chromium.org/p/chromium/issues/entry
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

Changed dependencies
* build: e2f84698b4..160bff3d7a
* testing: ae3bc83ffb..2d4146a8f0
* third_party/android_build_tools/lint: nGuHS3ccbDvKba1WE0bWYRax-Ibs76dLKpdsPpXqCiMC..kqQgSDAgfuKTUIT8gpYlhM9gvajbtIDs_ApDbh3wdNIC
* third_party/android_build_tools/manifest_merger: UNXioFXYvz7k7UmE2WYAaXuYIK3Ky0aSQ0IuDEdS9soC..pRHDE8UAgipcDQINCUsRz94lgm5BHQjiL-BLF6d6xC4C
* third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/{catapult_..cef5cf05b2
* third_party/depot_tools: 4480f863c5..4ec095fa85
* third_party/fuchsia-sdk/sdk: version:13.20230619.3.1..version:13.20230620.2.1
* third_party/r8: ZX7cPoz9LnLgpZfPPVDoXWcwHqATDC43bmIOinCWAxwC..rByCj9NgDDYIIW97qHizKUoC4pyBnIbr-mHt_DcskjYC
No update to Clang.

Bug: None
Tbr: ynovikov@google.com
Change-Id: I13b68b410422990fe407d45d235f6527b7cb29ac
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4629512
Commit-Queue: angle-autoroll <angle-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: angle-autoroll <angle-autoroll@skia-public.iam.gserviceaccount.com>
2023-06-21 08:23:52 +00:00
Steven Noonan
15156b1da4 Vulkan: disable graphics_pipeline_library on old NVIDIA drivers
On drivers before R530, there are some transient visual glitches in
rendering when using VK_EXT_graphics_pipeline_library. Basically you
might see correct renders for a few frames, very incorrect renders for
about 10-20 frames, and then it would render correctly from then on.

This problem went away either at R530 or slightly after. This change
sets the minimum version to R531, which is the first version I observed
behaving correctly.

Bug: angleproject:8218
Change-Id: I7af4f74c1469ecf2306dec0cab9062eff2ec5f2c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4627277
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-20 22:57:52 +00:00
Shahbaz Youssefi
7adf6532cc Remove unused helper classes
Bug: angleproject:6954
Change-Id: I325f6a67b1f2f1dffdf051f83a8d4f29c4fe25dd
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4628678
Reviewed-by: Roman Lavrov <romanl@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-20 21:54:56 +00:00
Steven Noonan
2e0b369d60 Vulkan: copy drawIndirectFirstInstance from physical device features
Not doing so results in VVL errors (you need the GPU-assisted validation
preset enabled to see this error):

    [ VUID-VkDrawIndexedIndirectCommand-firstInstance-00554 ]
    The drawIndirectFirstInstance feature is not enabled, but the
    firstInstance member of the VkDrawIndexedIndirectCommand structure
    at index 1 is not zero The Vulkan spec states: If the
    drawIndirectFirstInstance feature is not enabled, firstInstance must
    be 0

Bug: angleproject:8220
Change-Id: Ia43036584b85e4a7d9c3fcaf793be94b965f708f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4627278
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2023-06-20 21:06:06 +00:00