17029 Commits

Author SHA1 Message Date
Yuxin Hu
a09773110c Disable the usage of VK_EXT_legacy_dithering
Disable the usage of extension VK_EXT_legacy_dithering
on ARM until the bugs in this extension is addressed.

Bug: b/293136916
Bug: b/292282210
Change-Id: I1a548a2f6c44a78f8c66f706588a9985326217cf
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4718306
Reviewed-by: Solti Ho <solti@google.com>
Commit-Queue: Solti Ho <solti@google.com>
Reviewed-by: Kaiyi Li <kaiyili@google.com>
2023-07-26 00:12:02 +00:00
Geoff Lang
84f5295c97 Metal: Flush with NoWait when hitting renderpass count limits
This flush was added as an optimization to handle a specific use case
where many expensive GPU operations (clears and uploads) were queued
without being flushed. The GPU would be idle during these periods.

WaitUntilScheduled forced CPU/GPU synchronization when it was not
needed. We just want to make sure the work is flushed so the GPU can
pick it up later, not synchronize with anything external.

WaitUntilScheduled is used on iOS still because the Chrome waterfall
does not have coverage of iOS performance.

Bug: chromium:1466696
Change-Id: Ia8938eddf5be5ce586a91ad759d1563182176dba
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4717367
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2023-07-25 22:02:40 +00:00
Hailin zhang
4cae3b09ab Vulkan: disable pipline cache serialization
In old NV drivers, Vulkan pipeline cache will only
generate one single huge cache for one process
shared by all graphics piplines in the same process,
which can be huge.

This is temp solution for nvidia driver cache issue.
after driver version 520. nvidia fix the cache issue.
this might affect second running performance.

Bug: b/258207403
Change-Id: I3ea3e9196ad18fb1cec16c931eb744300d6cfdb9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4713207
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
2023-07-25 22:01:16 +00:00
Geoff Lang
05707391dc Metal: Re-add flush to eglBindTexImage but as NoWait
Removing the flush entirely caused performance regressions on a couple
of benchmarks because the GPU became idle waiting for work. Re-add
the flush but with NoWait so there is no CPU/GPU sychronization.

Bug: chromium:1466696, chromium:1467392
Change-Id: I5e2d1ca7b7a4590e3e668d2cd214d09d28c4b085
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4718007
Reviewed-by: Quyen Le <lehoangquyen@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
2023-07-25 20:53:36 +00:00
Brian Ho
b0b71d5939 Search for system libvulkan on CrOS
Currently, ANGLE searches in the "module" directory for libvulkan
during init on CrOS. The library doesn't exist at this location
(/opt/google/chrome/libvulkan.so), and we should instead just call
dlopen(libvulkan.so) to search the system library paths.

Bug: b/292249282
Change-Id: I7ab4803fe294e69f0ab8533ebc2fa43e25f189eb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4716242
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Brian Ho <hob@chromium.org>
2023-07-25 17:52:54 +00:00
Shahbaz Youssefi
7ea61cb3a1 GL: Complete EGL_ANGLE_external_context_and_surface
This change implements two new entry points added for
EGL_ANGLE_external_context_and_surface: glAcquireExternalContextANGLE
and glReleaseExternalContextANGLE.

These functions remove the need to overload eglMakeCurrent for the
purposes of syncing to and from the external context.

Bug: angleproject:5509
Change-Id: I5d46299ee0c8addaef7066914a8a8aacb0ea2c17
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4706027
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Peng Huang <penghuang@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-25 17:07:56 +00:00
Shahbaz Youssefi
2d5fb09d7f Stubs for EGL_ANGLE_external_context_and_surface
Bug: angleproject:5509
Change-Id: I8e2395784abcd2b4e3e1f888e70a879ef49287bc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4706026
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2023-07-25 16:16:54 +00:00
Roman Lavrov
2d999f7448 Android: Add a way to prepare traces without running tests
Example:
    % out/Android/angle_trace_tests --gtest_filter='*gacha_life' --prepare-only
    ...
    Prepared traces: {'gacha_life'}

Can be used as a setup for running restricted_trace_perf.py

Bug: b/292249127
Change-Id: I901c086a19e1d182c64ec4150ced98c198e21c4d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4711826
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Roman Lavrov <romanl@google.com>
2023-07-24 18:41:32 +00:00
Igor Nazarov
5e21d7f024 Vulkan: Remove dead code
Dead code remained after this CL:
    https://chromium-review.googlesource.com/c/angle/angle/+/3998747
    Vulkan: Remove unused ShaderAndSerial

Bug: b/257116399
Change-Id: Ica3b941fa98886dff309b5eb1734a1718fa8f6fb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4711585
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-24 17:08:26 +00:00
Geoff Lang
5a06559231 Metal: Don't flush on eglBindTexImage.
There is nothing that needs synchronization at this point. About 30% of
ANGLE's CPU time is spent here.

Bug: chromium:1466696
Change-Id: I4993804823790ee9cc38530dea334a6fa3abe7f6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4706926
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Gregg Tavares <gman@chromium.org>
2023-07-24 15:48:43 +00:00
Geoff Lang
430a4f559c Fix read size validation for RGBX formats.
GL_RGBX8_ANGLE is the only format where the upload format is 3-channel
RGB, whilethe download format is 4-channel RGBX.  As such, the internal
format corresponding to format+type expects 3-byte input/output.  The
format is fixed here for readPixels to output 4 bytes per pixel.

Bug: chromium:1458046
Change-Id: Iec737ed64bade003cfab50dc5f595eb4875e81e4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4706957
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-23 01:36:14 +00:00
Roman Lavrov
938ee1e80f Vulkan: legacy_dithering disallow reactivate when breaking RP
Hitting the assert in dEQP GLES2.functional.fragment_ops.random.0:
https://crsrc.org/c/third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp;drc=52fe3116ead9a5de51ddad17fcb14bf8ecb3a69d;l=2347

Bug: b/292259684
Change-Id: Ib40b90dde3b271c714b6181e4ba4d70f3e1b5e86
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4706174
Reviewed-by: Charlie Lao <cclao@google.com>
Auto-Submit: Roman Lavrov <romanl@google.com>
Commit-Queue: Roman Lavrov <romanl@google.com>
2023-07-21 21:31:28 +00:00
Geoff Lang
f586ec98d9 Metal: Validate max render target size without an allocation
We would allocate a MTLRenderPassDescriptor for validating an internal
error case only to throw it away immediately afterwards. This happened
on every new render pass.

This allocation/release amounts to about 10% of ANGLE's CPU time when
running Chrome.

Bug: chromium:1466696
Change-Id: I0bbe086c0b8006d2ff15ae57f25b591f791acb60
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4706925
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-21 20:20:24 +00:00
Geoff Lang
085f25bbb1 GL: Protect against drivers returning 0 max clip distances.
Some Android devices in the wild were hitting the assert that
maxClipDistances must be greater than 0 if ANGLE_clip_cull_distance
is exposed.

Protect against this by disabling various clip/cull extensions if
they don't meet the requirements for number of distances.

Bug: angleproject:7904
Change-Id: Ic6a5e959437fa7aad5302a12cf8c92d1d18024b2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4706684
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2023-07-21 19:18:04 +00:00
Geoff Lang
2e190280f5 GL: Extend disable of EXT_clip_control to Mali-G51.
The G51 appears to be the only other device with this issue.

Bug: chromium:1434317
Change-Id: Iffbc95a7f612c1862e9d129649a6211f488df6c9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4706564
Commit-Queue: Colin Blundell <blundell@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
2023-07-21 12:54:00 +00:00
Jason Macnak
8138ae9b1f Vulkan: EGL's DISPLAY_P3_PASSTHROUGH -> VK's DISPLAY_P3_NONLINEAR
From
https://registry.khronos.org/EGL/extensions/EXT/EGL_EXT_gl_colorspace_display_p3_passthrough.txt

  If its value is EGL_GL_COLORSPACE_DISPLAY_P3_PASSTHROUGH_EXT, then a
  non-linear, sRGB encoded Display-P3 color space is assumed

Bug: b/289125521
Test: cvd start
Test: cts -m CtsViewTestCases
          -t android.view.cts.TextureViewTest#testGetBitmap_8888_PassthroughP3
Change-Id: I07c77c86bbc0d82923ad7435cd2a5558770cd2e3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4673910
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>
2023-07-20 18:25:16 +00:00
Mohan Maiya
4515b27077 Account for implementations that support large gl_PointSize values
The PointSizeAboveMaxIsClamped end2end test intends to render a point
with gl_PointSize that is 2x the implementation's max value to test if
this value is clamped correctly. However, when the max gl_PointSize is
large enough, like with AMD drivers, it results in the center of the
point being outside of the viewport which according to the spec can be
discarded.

Update the test to render to a framebuffer, instead of the default
window surface, one large enough to contain a point of implementation
defined max point size.

Bug: angleproject:2113
Test: PointSpritesTest.PointSizeAboveMaxIsClamped*
Change-Id: I724440495bf5a3c93c76cc28109937a56c45f274
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4697681
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-19 16:54:48 +00:00
Phan Quang Minh
ef4327f6aa Vulkan: Make UtilsVk::copyImage copy YCbCr images properly
This changes the descriptor binding for the image from
VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE to
VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER for YCbCr source textures and
ensures that the copy pipelines and descriptor sets for YCbCr source
textures are created with the appropriate YCbCr samplers, and use the
`texture()` function instead of `texelFetch()` for YCbCr images.

Bug: angleproject:8252
Change-Id: Ife3e230d3669b275f4e0fab1922d75b6b6c4f8bd
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4675806
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
2023-07-19 14:44:41 +00:00
Hailin Zhang
6eea5ff4db Vulkan: fix default MSAA framebuffer clear issue.
Bug: b/290813597
Change-Id: I134c5a99382ca30dbd885a17dfa3c7ac227480ff
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4698113
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Hailin Zhang <hailinzhang@google.com>
2023-07-18 21:27:36 +00:00
Shahbaz Youssefi
52fe3116ea Vulkan: Deduplicate share group's context set tracking
Bug: angleproject:8224
Change-Id: I7a59a37229682fb91ff777f31e02e05d7ab2b80f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4690345
Reviewed-by: Charlie Lao <cclao@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-18 16:31:53 +00:00
Phan Quang Minh
5eb30562b0 Reland "Vulkan: Remove platform restriction of EGL_ANDROID_native_fence_sync"
Instead of enabling it on all non-Mac platforms, this time enable it
only on Linux-kernel based platforms (Linux, ChromeOS, Android). This
should avoid interfering with Fuchsia.

Original change description:
> Remove platform restriction of EGL_ANDROID_native_fence_sync
> extension except for Mac OS.
>
> Bug: angleproject:7834
> Change-Id: I116f44d8baca9cdcdd90013ca173b04461d06ae1
> Signed-off-by: Sungyong Choi <sywow.choi@samsung.com>
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4027707
> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
> Reviewed-by: mohan maiya <m.maiya@samsung.com>
> Commit-Queue: mohan maiya <m.maiya@samsung.com>

Bug: angleproject:7834
Change-Id: Ida89100e8c30c3a2df5a0a8d6d0c9b7e7ce3e412
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4687427
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-18 16:30:57 +00:00
Cody Northrop
85095480da Android: Update script with sync progress
When running lots of traces, there can be a long pause
when syncing traces to the device.

Add a small update so it is clear that work is happening.

Example output:

I12:21:51.806619Z Syncing 1945_air_force trace (1/238)
I12:21:52.178401Z Syncing 20_minutes_till_dawn trace (2/238)
I12:21:52.463608Z Syncing 2_3_4_player_mini_games trace (3/238)
...

Test: angle_trace_tests
Bug: b/276742336
Change-Id: Id81d69b3fc678cb94c2e683a907c44950ead2117
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4690745
Reviewed-by: Roman Lavrov <romanl@google.com>
Commit-Queue: Cody Northrop <cnorthrop@google.com>
2023-07-18 14:25:51 +00:00
Saifuddin Hitawala
a64537f946 Angle: Copy multiplanar d3d11 texture for readPixels
This change performs a copy to an intermediate texture for multiplanar
d3d11 textures before reading from the source texture. This is needed
as we cannot read a plane directly from a multiplanar d3d11 texture.

It also passes the correct format for the plane for multiplanar formats
when initializing the texture instead of getting the format using the
internal format.

We also add a unittest performing glReadPixels for NV12/P010/P016
formats.

Bug: angleproject:7998, chromium:1463924
Change-Id: I9a1708f5a846ace28ac3b6593ea80f1863348333
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4688118
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Auto-Submit: Saifuddin Hitawala <hitawala@chromium.org>
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2023-07-18 13:17:13 +00:00
Shahbaz Youssefi
9f9284b7de Move ShareGroup to its own files
Bug: angleproject:8224
Change-Id: Id6d272018bb5ee8c3e35488f641efa4d99fa836d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4690003
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-17 22:21:48 +00:00
Geoff Lang
9aadc7aacd Metal: Require MSL 2.1.
We had previously shipped both MSL 2.0 and 2.1 shaders to support
MacOS 10.13 (MSL 2.0 only) while also supporting the stencil blit
fast path that MSL 2.1 provides with the has_shader_stencil_output
feature.

Each configuration of precompiled shaders is ~300kb so we will drop
support for MacOS 10.13 and only ship the MSL 2.1 shaders.

Rework of the disablement for NVIDIA and GPU family 1 to be more
readable. The features themselves are always true because "disable on
NVIDIA" is always true and the check for "is NVIDIA" is moved to the
code which fails the initialization.

Bug: angleproject:8258
Change-Id: Icc8c69540e43fd2b0b237fffbfe170bb3422903f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4681130
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-17 22:00:36 +00:00
Roman Lavrov
0518a3ff4d Android: Simplify power metrics collection
Also check for missing values and dupes

Bug: b/291604008
Change-Id: I909ca2bf53d3aa0bf5ba66f7168e9925cfd7da3c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4685323
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Roman Lavrov <romanl@google.com>
2023-07-17 18:22:33 +00:00
Shahbaz Youssefi
bebb83d918 Translator: Limit variable sizes vs uint overflow
Bug: chromium:1464680
Change-Id: I90e204db1ce57c87ed5fe19912e4c157cee18a90
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4685236
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-17 17:29:36 +00:00
Mohan Maiya
05ea114724 Vulkan: Bugfix in gl_FragData array redeclaration
Both OpenGL ES and Vulkan spec allows implementations to limit
the number of output attachments when dual-source blending is enabled.
Account for this limit when setting gl_FragData array length by
re-declaring the gl_FragData array size to match
maxFragmentDualSrcAttachments value.

Bug: angleproject:5537
Test: EXTBlendFuncExtendedDrawTest.FragData/ES2_Vulkan
Change-Id: I5a462344f4c4faf850f56e9c5d4c392370d3d010
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4688396
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: mohan maiya <m.maiya@samsung.com>
2023-07-17 17:16:02 +00:00
Shahbaz Youssefi
bd8001e581 Fix deadlock on device loss
Some backends generate a device loss (propagated to all contexts) while
querying the device status.  The latter is held under a lock, and the
former would attempt to hold the lock when marking the calling context
with device loss.

Bug: chromium:1465262
Change-Id: I55fd96f3573732953daf2a305b0120dbcae6ea30
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4690063
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-17 17:10:37 +00:00
Roman Lavrov
c0f2f71eba Use VK_EXT_legacy_dithering when available instead of emulation
Yields improvement in gpu power: http://b/284462263#comment45

Bug: b/284462263
Change-Id: I5bfd115557b6baac17c05639118feaebf19c5cd4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4652590
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Roman Lavrov <romanl@google.com>
2023-07-17 15:24:21 +00:00
Yuly Novikov
d04dda1505 Skip WebGL2CompatibilityTest.DrawWithZeroSizedBuffer on iOS GL
Bug: angleproject:8264
Change-Id: Icac83200b8e9aa35ba3e85be8b34bd45e616a8bb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4685572
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
2023-07-17 15:16:11 +00:00
Dave Tapuska
507f67ccff Fix cfi issue with Angle invoking worker pool
Mark the function as ignoring cfi-icall because
of broken upstream builds.

https://ci.chromium.org/ui/p/chromium/builders/ci/Linux%20CFI/25615/overview

Bug: angleproject:8256
Change-Id: I63b5fee27bc0565dc6881bd83fd284abc7a9f1f0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4685324
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
2023-07-14 21:39:58 +00:00
Roman Lavrov
c5b7fc3655 Ensure settings get cleaned up on exceptions
Before this change, Ctrl-C or another exception leaves settings behind

Bug: b/284462263
Change-Id: I5694cbb2ca7d43a4173099d126e6695e07ec9d2a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4685238
Commit-Queue: Roman Lavrov <romanl@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2023-07-14 20:11:16 +00:00
Yuly Novikov
9736822967 Skip dEQP-EGL.functional.native_[color|coord]_mapping.native_window.*
Skip on all platforms instead of the individual suppressions,
that let test failures to slip into build failures.

Bug: angleproject:8261
Change-Id: I16a5eaceb5fe49dc4e23233bfe4fe146b77a95f0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4685567
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Auto-Submit: Yuly Novikov <ynovikov@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-07-14 17:55:33 +00:00
Geoff Lang
972f810767 Reject program binaries when the renderer string changes
If the underlying driver changes, reject program binaries from the old
versions. The driver is supposed to do this for us (on OpenGL, at
least) but this adds some extra protection.

Bug: angleproject:4981
Change-Id: Id9486d8e6f9136970c0d7c37d59dea5d43b0a50e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4685317
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2023-07-14 17:04:35 +00:00
Geoff Lang
c0cd00e835 Sync all framebuffer attachments when checking completeness.
If the backend requires that a framebuffer is synchronized before
checking backend completeness, make sure all attachments are
synchronized too.

GL has completeness rules based on GL_BASE_LEVEL and
GL_MAX_LEVEL of texture attachments which are not syncrhonized until
the textures are. If they are left un-sychronized during completeness
checks, the driver will tell us that the framebuffer isn't complete.

Bug: chromium:1455725
Change-Id: I7c3bf6a38f63feaa863f4d8914c3655e286dd768
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4678286
Reviewed-by: Brian Ho <hob@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
2023-07-14 16:31:48 +00:00
Shahbaz Youssefi
5032f08b35 Translator: Unconditionally limit variable sizes
... instead of just for WebGL.  This is to avoid hitting driver bugs
that were prevented with this check for WebGL on a compromised renderer
that can create non-WebGL contexts.

Bug: chromium:1464682
Change-Id: I47a9d9690bd1ca9d701391fb7d70932f2dbe7334
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4685307
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2023-07-14 16:15:55 +00:00
Yuly Novikov
35c077b110 Remove obsolete VUID suppressions
02859 was renamed to 08608 and
06538 was renamed to 08753 in
0cc78b9c28

Bug: angleproject:8242, angleproject:8119, angleproject:7105
Change-Id: Icde11d7c5b598bfb617d899daa795d3e19c8a178
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4687419
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-14 15:33:22 +00:00
Geoff Lang
cc8ea4c29a Metal: Call terminate if display initialization fails.
This ensures that any resources that were partially initialized are
cleaned up.

This is a speculative fix for dual GPU macs not falling back to the
low power GPU. DisplayMtl leaks the metal device if it fails to
initialize due to unsupported GPU families or vendors.

Bug: chromium:1322521
Change-Id: I93930de8c07bb94318ac41c67513a3b1c8bd3bf0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4681842
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
2023-07-14 15:28:02 +00:00
Geoff Lang
8f76a7ebf6 Metal: Use the pipeline cache for RenderUtils compute shaders
This ensures that all pipelines created in the Metal backend are stored
in the single pipeline cache.

Bug: chromium:1329376
Change-Id: I99db93426acb3467be41d1fca5238b34553f6684
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4628680
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Quyen Le <lehoangquyen@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-14 14:16:20 +00:00
Mohan Maiya
19c4e88503 Update input color in YUVSampleLinearFiltering test
This test uses narrow range encoding (as can be seen from the
color value for black) but the Cr component for red is greater
than 240. On some platforms with different clamping logic the
output color after conversion ends up not being red. Update the
input colors to account for different implementations.

Bug: b/210526871
Test: ImageTestES3.SourceYUVAHBTargetExternalYUVSampleLinearFiltering*
Change-Id: Ib9b76c9433b07f5ce8a129779e77bc682bb341ac
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4684018
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-14 05:17:06 +00:00
Alexey Knyazev
817f4b8166 Restrict color writemasks for RGB9_E5 color buffers
Per-channel write operations to shared exponent
color buffers are loosely defined and may cause
driver validation errors.

Restricted the set of allowed color writemasks
for RGB9_E5 color buffers so that RGB channels
must be either all enabled or all disabled.

Added a Metal-specific adjustment to ignore
alpha writemask for RGB9_E5 color buffers.

Removed an unused function from
RenderPipelineColorAttachmentDesc.

Bug: angleproject:8043
Change-Id: I902c3b70ddc6d8e65069d98a4a02a82122f413a5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4685566
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-14 05:13:22 +00:00
Charlie Lao
6ffd0d2068 Vulkan: Clean up depth stencil feedback mode part 2
Right now the tracking of depth stencil buffer readOnly or feedback loop
is in FramebufferVk class. This really belongs to ContextVk, since it is
not a permanent state of framebuffer, but current state of context. This
CL moves it to ContextVk and changes to use BitSet instead of four
boolean.

Bug: b/289436017
Change-Id: I955c439259935f82eff30ddfff776a69723e5d0d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4679886
Commit-Queue: Charlie Lao <cclao@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
2023-07-14 03:27:29 +00:00
Charlie Lao
a33ec5ddb6 Vulkan: Clean up depthStencil feedback loop implementation Part1
This is first clean up effort for depth stencil feedback loop
implementation. This CL moves updateRenderPassStencilReadOnlyMode and
updateRenderPassDepthReadOnlyMode methods from FramebufferVk to
RenderPassCommandBufferHelper class. The method is actually updating
renderPass's state, not FramebufferVk's state. In the next CL,
FramebufferVk will be removed from the argument as well. With this
change, I also removes updateStartedRenderPassWithDepthMode() and
updateStartedRenderPassWithStencilMode() to use
updateStartedRenderPassWithDepthStencilMode() directly.

This CL is mechanical changes only, no behavior chnage is expected.

Bug: b/289436017
Change-Id: Id3960f973a7115c05ebea199cb8ef802e995941a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4679365
Commit-Queue: Charlie Lao <cclao@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
2023-07-14 03:22:25 +00:00
Yiwei Zhang
79ebd10a9a Vulkan: disable explicitlyCastMediumpFloatTo16Bit for Venus
Workaround for platforms shipping Venus until vk-gl-cts issue 4554 gets
resolved.

Bug: b/290425152
Test: CtsSkQPTestCases org.skia.skqp.SkQPRunner#gles_gradient_many_stops
Change-Id: Ia05d905a9b56264164ed3325e4966dd2976b1fe9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4684548
Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-14 00:22:18 +00:00
Shahbaz Youssefi
74cf6a3a60 Ensure lockless entry point validations only access private data
Bug: angleproject:8224
Change-Id: I19e867923b088879f9f37d0a3b4ff8b681470be0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4678352
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-13 23:38:48 +00:00
Geoff Lang
3a0da09d8b Metal: Cache compute pipelines for provoking vertex emulation
Remove ProvokingVertexComputePipelineCache and update
ProvokingVertexHelper to use the PipelineCache.

Bug: chromium:1329376
Change-Id: Ifca89fbb572d850c806b24f124fb86c65eec4f11
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4637204
Reviewed-by: Quyen Le <lehoangquyen@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2023-07-13 21:05:56 +00:00
Shahbaz Youssefi
927410a8c1 Prevent accidental misuse of ANGLE_ENABLED
... by removing it altogether.  This macro was only available when
features.h was included.  If that header was not included, the
preprocessor would automatically consider it 0, which has the opposite
effect from what was desired.

Bug: angleproject:8256
Change-Id: Ia141573c0c8b44eef1388f4c3ec73ef770cd2854
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4685226
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2023-07-13 20:28:44 +00:00
Geoff Lang
75254b989a Metal: Cache compute pipelines with render pipelines.
Support caching of compute pipelines in the same LRU cache as render
pipelines in mtl::PipelineCache.

Bug: chromium:1329376
Change-Id: I93bbfadb8f5c1461144f1c222362c174402cced1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4628673
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Quyen Le <lehoangquyen@chromium.org>
2023-07-13 19:39:28 +00:00
Dave Tapuska
fe08eee884 Fix Angle creating its own worker pool.
The WorkerPool was created on the first postTask and could create
a number of threads. We were seeing this on blink for iOS where
we would have expected using the delegate's worker pool. However
ANGLE_ENABLED was undefined because it wasn't included. This
caused the comparison of ANGLE_DELEGATE_WORKERS to not work.

Instead of including the header for ANGLE_ENABLED since that would
cause a dependency on libAngle, just use #if X instead, while
this also isn't the best because X can be undefined its a solution
for now.

Bug: angleproject:8256
Change-Id: I5aeb686dcc117feaba884cdea5c89e4b146cb57f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4679894
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-13 18:16:00 +00:00