1006 Commits
Author SHA1 Message Date
Alexey Knyazev 067ace47d0 Add ANGLE_clip_cull_distance extension
Added an extension spec.

Trivially exposed it on GL, Vulkan, and D3D11.

Adjusted tests and validation to allow no cull
distance support for this extension string.

Removed extra built-in variable definitions.

Bug: angleproject:7904
Change-Id: Ic60772dfe28132c316eaa29aadc1afd66e3b0fa7
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4114290
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Alexey Knyazev <[email protected]>
2022-12-23 01:57:59 +00:00
Shahbaz Youssefi 301ed54556 Vulkan: Pass context to layout getters
In preparation for a change that optionally uses read/write
depth/stencil layouts.  Context is used to test for the
supportsMixedReadWriteDepthStencilLayouts feature to know whether those
layouts are supported or that a fallback must be chosen.

Bug: angleproject:7899
Bug: b/192477489
Change-Id: I1453dc9d060453a3806ad0f261b94368fe01fb29
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4116735
Auto-Submit: Shahbaz Youssefi <[email protected]>
Reviewed-by: Amirali Abdolrashidi <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
Commit-Queue: Charlie Lao <[email protected]>
2022-12-21 23:06:42 +00:00
Alexey Knyazev 91a5635a2e Support arbitrary clip and cull distance array sizes
Removed limitSimultaneousClipAndCullDistanceUsage cap.

Enhanced HLSL translator to support all valid combinations
of clip and cull distances.

Validate that these arrays are sized explicitly or by using
only constant indices; adjusted link program error message.

Enhanced tests to cover all possible combinations of
implicit and explicit array sizes for both built-ins.

Bug: angleproject:4452
Change-Id: I704db6dc3c8951e5ba482a3e4dad09e5b0182f9c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4111645
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Alexey Knyazev <[email protected]>
2022-12-20 06:04:32 +00:00
Alexey Knyazev 28e7adca96 GL: Implement clip distance state emulation
Pass the current set of enabled clip distances
to vertex shaders via an internal uniform and
dynamically set disabled elements to zero.

Bug: angleproject:7880
Change-Id: I709d31dc7ca0606decf49adf674460a941837683
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4094314
Commit-Queue: Alexey Knyazev <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2022-12-20 05:05:49 +00:00
Amirali Abdolrashidi cd5400952a Vulkan: Add memory log at allocation error
* Added logging memory allocation information in handleError() in the
  event of an error from ANGLE_VK_TRY.
  * Used for the handleError() in ContextVk.

* Updated the name and message of the function to log allocations.
  * checkForCurrentMemoryAllocations()

* Added logging memory heap stats, including budget and usage.
  * logMemoryHeapStats()
  * In the renderer, added the feature flag indicating whether the
    platform supports the memory budget extension.
    * Uses VK_EXT_memory_budget.
  * Added the enum class MemoryLogSeverity, which is used to select
    the severity level of the memory log.

* Added logging pending memory allocation information.
  * logPendingMemoryAllocation()
  * If the last unsuccessful memory allocation was unsuccessful, its
    information will be added to the log.

Bug: b/262029018
Change-Id: I97343c1553936aed23d763f3e0c00d495f9ee810
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4089531
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
Commit-Queue: Amirali Abdolrashidi <[email protected]>
Reviewed-by: Kaiyi Li <[email protected]>
2022-12-19 19:59:41 +00:00
Shahbaz Youssefi ea36cf1c9a Vulkan: Feature for VK_EXT_rasterization_order_attachment_access
This change just adds the feature.  A follow up change will actually
start using the extension.

Bug: angleproject:7899
Bug: b/192477489
Change-Id: I19c078ebe57a7819b3aa3e95d4436cefa34ba85b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4113912
Reviewed-by: Amirali Abdolrashidi <[email protected]>
Auto-Submit: Shahbaz Youssefi <[email protected]>
Commit-Queue: Amirali Abdolrashidi <[email protected]>
2022-12-19 19:09:44 +00:00
Gregg Tavares be9e8e7b03 Add EGL_ANGLE_wait_until_work_scheduled extension
We're changing eglReleaseTexImage so it calls
flushCommandBuffer(mtl::NoWait) instead of
flushCommandBuffer(mtl::WaitUntilScheduled)
and then adding an extension to allow us to
WaitUntilScheduled.

This is because Chrome calls eglReleaseTexImage for
every canvas and having it WaitUntilScheduled per call
is very slow. So instead we'll call eglWaitUntilWorkScheduledANGLE
once which will effectively wait just once.

Bug: angleproject:7890
Change-Id: I87bc9f9a1a7f4a0f99d93736cc3083799e76afeb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4109311
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Gregg Tavares <[email protected]>
2022-12-17 02:33:59 +00:00
Shahbaz Youssefi 77c95de4b3 Vulkan: Threaded monolithic pipeline creation
With this change, once a pipeline is created out of libraries, a task is
scheduled (if necessary) to asynchronously create a corresponding
monolithic pipeline.  Once the task is complete, the linked pipeline
handle is replaced by the monolithic one, gaining back any performance
that might have been lost due to the use of libraries.

Bug: angleproject:7369
Change-Id: I525fb1e09f8bedc61b9dbef19f9cce7026ff9c53
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4031151
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Yuxin Hu <[email protected]>
2022-12-14 15:43:47 +00:00
Shahbaz Youssefi db9ffea3e8 Vulkan: Remove the unused shadowBuffer feature
Bug: angleproject:4339
Change-Id: I4f4524ba597af25bd6da3792bd7a85ae1b52962e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4089448
Reviewed-by: Yuxin Hu <[email protected]>
Commit-Queue: Yuxin Hu <[email protected]>
Auto-Submit: Shahbaz Youssefi <[email protected]>
2022-12-09 18:08:58 +00:00
Chris Dalton eb1a13d8cf Improve PLS load and store op tokens
Define more new tokens that are more clearly named, as opposed to
recycling tokens that were meant for a different purpose.

Bug: angleproject:7279
Change-Id: I840e5ea168235c49eec2693b2231c2d329027b0e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4082057
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
2022-12-09 15:32:37 +00:00
Chris Dalton 9bd9c1c2ae Workaround for AMD [[raster_order_group()]] bug
Metal [[raster_order_group()]] does not work for read_write textures on
AMD when the render pass doesn't have a color attachment on slot 0. To
work around this we attach one of the PLS textures to
GL_COLOR_ATTACHMENT0, if there isn't one already.

Bug: angleproject:7792
Bug: angleproject:7803
Bug: angleproject:7818
Change-Id: I7567ed28ed30c7e3ca23dc52778ed90f2fdff965
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4004529
Reviewed-by: Kyle Piddington <[email protected]>
Commit-Queue: Chris Dalton <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
2022-12-01 21:29:53 +00:00
Chris Dalton 8ee1b89fc5 Refactor pixel local storage options
The various different PLS options were getting scattered and unruly. We
are also in need of more backend-specific PLS options that would be
difficult to add as-is. This CL refactors them into a single
"ShPixelLocalStorageOptions" struct that gets initialized all in one
place, and shared between the compiler and the backends.

Bug: angleproject:7279
Change-Id: Ic58dccb8d1ba350a0b6cc5848ce15bd687e30fad
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4006715
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Chris Dalton <[email protected]>
2022-12-01 08:05:59 +00:00
Chris Dalton a4db947717 Implement pixel local storage with metal::read_write textures
Metal's programmable blending feature isn't available on non-Apple
Silicon, so on these devices we have to polyfill pixel local storage
using read_write textures, which can also be coherent if
raster_order_groups are supported.

This change leverages the existing PLS transformation to images, and
implements just enough shader image functionality in Metal to support
the pixel local storage usecase. Missing shader image features are
marked with UNIMPLEMENTED().

Bug: angleproject:7279
Bug: angleproject:7792
Bug: angleproject:7794
Bug: angleproject:7797
Bug: angleproject:7803
Change-Id: Ia96a714693d352d57351a1bae4f45437dde000e4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3993363
Reviewed-by: Kenneth Russell <[email protected]>
Reviewed-by: Quyen Le <[email protected]>
Commit-Queue: Chris Dalton <[email protected]>
Reviewed-by: Kyle Piddington <[email protected]>
2022-12-01 07:28:04 +00:00
Shahbaz Youssefi fa37af38ba Translator: Support SSO's built-in redeclaration
EXT_separate_shader_objects requires that gl_Position and gl_PointSize
be redeclared in the vertex shader.  This is not adopted by GLES3.2, but
is nevertheless required to be supported if the shader enables this
extension explicitly.

Bug: angleproject:6590
Change-Id: I3428851ff9f00fb63573e4322bb62fe04bf0a095
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3757918
Auto-Submit: Shahbaz Youssefi <[email protected]>
Reviewed-by: Amirali Abdolrashidi <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-12-01 03:28:25 +00:00
Yuxin Hu 1434697fad Add a vk feature flag to only enable precision match fixer on IMG
According to
https://gitlab.khronos.org/vulkan/vulkan/-/merge_requests/5273,
RelaxedPrecision does not need to match in the interface matching
rules. However, removing the precision match is causing triangle
clipping issues on IMG hardware. This change adds a feature
flag to only run the code path that applies precision match in
SpirV if the hardware is IMG.

This is a follow-up change to https://crrev.com/c/4049421.
Instead of adding back the code path that handles varying
precision mismatch for every hardware, only enabling the code
path if the vendor is IMG.

Test:
On Pixel6:
$ adb shell setprop debug.angle.feature_overrides_enabled
varyingsRequireMatchingPrecisionInSpirv
$ out/AndroidDebug/angle_end2end_tests
--gtest_filter="GLSLTest_ES3.MismatchPrecision*" --verbose

Bug: angleproject:7488
Change-Id: Ia0155f14d523195df2f47b852ed6642918270e2a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4054100
Commit-Queue: Yuxin Hu <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
2022-11-29 19:14:21 +00:00
Alexey Knyazev 27727e501a Fix ProvokingVertex typos
Aligned the parameter name with the upstream specs

Moved ValidateProvokingVertexANGLE to validationESEXT.cpp

Bug: angleproject:2829
Change-Id: I820a90c20ef0a1873640c933b1de52526cac7e70
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4043701
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Alexey Knyazev <[email protected]>
2022-11-22 22:20:58 +00:00
Shahbaz Youssefi 68b47e58aa Vulkan: Initial support for VK_EXT_graphics_pipeline_library
When available, this change uses VK_EXT_graphics_pipeline_library to
create pipelines.  Currently, it is only used when
graphicsPipelineLibraryFastLinking is available.  This restricts the use
of this extension to devices where monolithic pipelines are not any more
performant than linked libraries.

A future change adds support for other implementations by providing
async pipeline creation.

Bug: angleproject:7369
Change-Id: I1e3b7ac4aa56e75c7d6f4d0d5ea91cb0b862e581
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4031489
Reviewed-by: Charlie Lao <[email protected]>
Reviewed-by: Amirali Abdolrashidi <[email protected]>
Reviewed-by: Steven Noonan <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-11-22 19:04:34 +00:00
Shahbaz Youssefi 70cf232224 Vulkan: Move async pipeline cache sync feature to backend
Bug: b/246683126
Change-Id: I194e488e04580cee7055c0674091f1228984edf9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4031486
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Solti Ho <[email protected]>
Reviewed-by: Amirali Abdolrashidi <[email protected]>
Auto-Submit: Shahbaz Youssefi <[email protected]>
2022-11-18 06:01:34 +00:00
Alexey Knyazev 44d8fef850 Add ANGLE_provoking_vertex spec
Renamed provoking vertex enums to use _ANGLE suffix.
The newly defined enums alias those from the
desktop OpenGL extensions.

Updated tests to use the new enum names.

Bug: angleproject:2829
Change-Id: I72b686773536d3d54a653114cee5292007510a55
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4013700
Commit-Queue: Alexey Knyazev <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
2022-11-14 21:51:47 +00:00
Shahbaz Youssefi 9c019cb367 Vulkan: Features for graphics pipeline library
Bug: angleproject:7369
Change-Id: I561cc095dcf2d4c71d24de8a6ca08d45567ad937
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4014519
Auto-Submit: Shahbaz Youssefi <[email protected]>
Commit-Queue: Charlie Lao <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
Reviewed-by: Amirali Abdolrashidi <[email protected]>
2022-11-08 21:47:17 +00:00
Shahbaz Youssefi 78e28cb8f7 Vulkan: Remove glslang fallback
ANGLE's SPIR-V generator is battle tested by now.

Bug: angleproject:6210
Change-Id: I2ed88642e3ede435e3f906fbd701133be6873fb7
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4002868
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2022-11-08 14:42:58 +00:00
Shahbaz Youssefi 5b2181969a Metal: Remove compilation through SPIR-V
Direct metal generation is stable.

Bug: angleproject:6081
Change-Id: If9e76f61ad38f2fc9963f0181dfd03c99ffa3e2b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4003675
Auto-Submit: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
2022-11-07 21:53:21 +00:00
Chris Dalton 9bda9a79b4 Add Store Ops to pixel local storage
Browsers will need the ability to pre-empt pixel local storage, which
means every plane will need a backing store to dump to. Store Ops allow
the app to still avoid memory transactions at the end of PLS even if
their plane has a backing texture.

Bug: angleproject:7279
Change-Id: I3a3efa21773f87c03cd346a996e3c638028c68ab
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3974652
Commit-Queue: Chris Dalton <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
2022-11-04 23:13:35 +00:00
Chris Dalton 3605b399e0 Move PLS clear values back into context state
The API that required packing raw data into a buffer was un-ergonomic
for developers and difficult to implement for WebGL vendors.

Bug: angleproject:7279
Change-Id: If7c98908c285462c5775e8e2d8811883be139f64
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3972376
Commit-Queue: Chris Dalton <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2022-11-04 00:55:08 +00:00
Kenneth Russell 3226cce3a6 Update EGL_ANGLE_metal_shared_event_sync implementation.
Rename the extension's .txt file to match the current name of the
extension.

Update function signatures to take EGLSync rather than EGLSyncKHR. The
two types are conceptually incompatible. This extension requires the
use of eglCreateSync rather than eglCreateSyncKHR because the latter
takes an array of EGLInt, but EGLAttrib is needed to express pointers
(to MTLSharedEvents) in the attribute list.

Revise ContextMtl::flush to use WaitUntilScheduled on older operating
systems not supporting MTLSharedEvent.

Bug: angleproject:7809
Change-Id: I39197616dc3e1e7ec6dc68dd83b4fde05184debf
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4000941
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Kenneth Russell <[email protected]>
2022-11-03 22:04:21 +00:00
Chris Dalton 5e95a4d9b7 Add an EXT_shader_pixel_local_storage impl of PLS
Translates ANGLE_shader_pixel_local_storage shaders directly to
EXT_shader_pixel_local_storage.

Polyfills load/store operations using internal fullscreen draws.

Since the ANGLE extension needs the ability to preserve all active PLS
planes to textures, we can only support this extension when the backend
context also has access to ES 3.1 shader images.

Bug: angleproject:7279
Bug: angleproject:7771
Change-Id: Id348bde412efcc081ff29ee05ec59ad652f77569
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3966075
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2022-11-03 14:41:47 +00:00
Shahbaz Youssefi 1b88c41f28 Vulkan: Remove the disableFifoPresentMode feature
Workaround was added for old Intel bots, no longer applicable.

Bug: angleproject:3153
Change-Id: Ib248927fbb1be33d8bd89a0c8185761f7f1ed6fa
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3993361
Reviewed-by: Yuly Novikov <[email protected]>
2022-11-02 15:12:56 +00:00
Chris Dalton 9f693aa383 Implement an allow list for PLS
In order to guarantee no data is lost while using the
EXT_shader_pixel_local_storage extension, we need to restrict
applications to a small subset of commands while pixel local storage is
active. This CL implements the allow list for GL entrypoints using
wildcard matching inside the code generator, and adds custom validation
for the more specific restrictions that go into effect when PLS is
active.

Bug: angleproject:7279
Change-Id: I5dd48bd93c10e8775f32be32a4fcf17855eb2f0e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3932552
Reviewed-by: Kenneth Russell <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Chris Dalton <[email protected]>
2022-11-01 16:32:11 +00:00
Alexey Knyazev 805e00b815 D3D11: Add clip and cull distance support
Added gl_ClipDistance and gl_CullDistance
support to HLSL translator.

Added enabled clip distance GL state emulation.

Added limitSimultaneousClipAndCullDistanceUsage
limitation.

Expanded and optimized related end2end tests.

Bug: angleproject:4452
Change-Id: Id66312505254ceff43d5258d486ddcdb0462db47
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3990944
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Alexey Knyazev <[email protected]>
2022-10-31 19:41:57 +00:00
Greg Schlomoff 81a244de0a Adding a class to perform ASTC texture decompression on the CPU
This significantly improves performance by caching and re-using the ASTC
decoder context, and using multi-threaded decompression.

This code was originally written for gfxstream.

Bug: b/250688943
Change-Id: I1727447907f2e25cf9b854ffcc9ccfc04db2fb91
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3929008
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-10-25 18:33:46 +00:00
Jamie Madill 53fd00c592 Add missing function prototypes to ANGLE ext headers.
Bug: angleproject:7752
Change-Id: I316e181c61fe1daf3611c58b4db0321678d9eba2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3963365
Reviewed-by: Cody Northrop <[email protected]>
2022-10-19 10:57:59 +00:00
Alexey Knyazev fec93f40d3 GL: Support clip and cull distance extensions
Use EXT_clip_cull_distance on OpenGL ES to expose
APPLE_clip_distance; use ARB_cull_distance on OpenGL
to expose EXT_clip_cull_distance.

Added disableClipCullDistance OpenGL workaround.

Bug: angleproject:4452
Change-Id: I458cad29c10b9d9193c5233e24bac53361ba104e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3956075
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Alexey Knyazev <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2022-10-19 01:08:04 +00:00
Gregg Tavares 968041b547 Metal: Optimized BufferSubData per device
Adds a staging buffer path which means there are 4 paths
for bufferSubData.

1. direct copy

   * get a pointer to the buffer
   * copy the new data to the buffer
   * if the buffer is managed, tell metal which part was updated

2. use a shadow copy

   * copy the data to a shadow copy
   * copy the entire shadow to a new buffer
   * start using the new buffer

3. use a new buffer

   * get a new buffer (or unused)
   * put the new data in the new buffer
   * blit any unchanged data from the old buffer to the new buffer
   * start using the new buffer

4. use a staging buffer

   * get a staging buffer
   * put the new data in the staging buffer
   * blit from the staging buffer to the existing buffer.

Further, there are 3 types of memory storage modes.
Managed, Staged, Private.

Based on the GPU type different storage modes and different
paths in different sitatutions are more performant.

So, add feature flags to select paths by GPU.

Bug: angleproject:7544
Change-Id: I741dd1874201043416374194bd2001ded8dbd9b4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3842641
Reviewed-by: Kyle Piddington <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Reviewed-by: Quyen Le <[email protected]>
Commit-Queue: Gregg Tavares <[email protected]>
2022-10-18 00:09:11 +00:00
Charlie Lao e8f9355c33 Vulkan: Add forceWaitForSubmissionToCompleteForQueryResult flag
Add forceWaitForSubmissionToCompleteForQueryResult feature flag and
enable it for ARM.

Also force host wait if async submission is enabled.

Bug: b/253522366
Change-Id: Ie2d7373930f1a2b3fc761d2f8d2df8fa84983c54
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3954044
Commit-Queue: Charlie Lao <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
2022-10-14 19:52:18 +00:00
Charlie Lao 76f377c5ac Vulkan: Break renderpass when switch from query to non-query
getQueryResult will wait for query result to be available, which means a
potential CPU bubble if the result is not yet available. On tiler GPUs
it will at least wait for renderpass to complete. Usually query enabled
draws are very tiny (usually just draw a point to see if it is occluded
or not), and query disabled draws are expensive. Some apps do issue a
glFlush when switch from query draw to non-query draw, but app like
dead_by_daylight does not issue such flush.  In order to reduce the
bubble, this CL ends renderpass and issue a flush  when we switch from
query enabled draws to non-query enabled draw so that the result will be
available much earlier, this reduce the CPU bubble. This result in
dead_by_daylight frame time improves from 5.45ms to 3.5ms (35%
improvement).

Bug: b/250706693
Change-Id: Ia3a32a9fb336e6f256809b3cad83f61a45415fb1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3931739
Reviewed-by: Yuxin Hu <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Auto-Submit: Charlie Lao <[email protected]>
Commit-Queue: Charlie Lao <[email protected]>
2022-10-11 21:55:15 +00:00
Shahbaz Youssefi b3b855d26c Vulkan: Features for two exts
- VK_EXT_graphics_pipeline_library
- VK_EXT_pipeline_protected_access

Bug: angleproject:7369
Bug: angleproject:7714
Change-Id: I42b5b5a2758b32625dc12352d521cfa1dff1aa90
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3939919
Reviewed-by: Charlie Lao <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
Auto-Submit: Shahbaz Youssefi <[email protected]>
2022-10-10 21:30:00 +00:00
Chris Dalton 2d31fe9825 Implement PLS on Apple Silicon
Implements a subset of EXT_shader_framebuffer_fetch in the Metal
translator that is sufficient to support pixel local storage. Metal's
"programmable blending" feature is available on all Apple family GPUs
beginning with version 2.

Support for non-Apple GPUs will come later via readWrite textures,
which can also be coherent by annotating them with
[[raster_order_goup(0)]].

Bug: angleproject:7279
Change-Id: Ic74f6c0d21e87eb919e1f487163388d08d126857
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3916794
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Chris Dalton <[email protected]>
Reviewed-by: Gregg Tavares <[email protected]>
2022-10-06 16:35:15 +00:00
Chris Dalton a7dc51f246 Add a framebuffer fetch implementation of PLS
The framebuffer fetch implementation works by attaching PLS backing
textures to the framebuffer, and then rewriting PLS uniforms as "inout"
fragment variables. The compiler's existing machinery takes it from
there and makes it work on GL and Vulkan, and soon Metal.

EXT_shader_framebuffer_fetch is now the preferred backend for pixel
local storage, but we also use EXT_shader_framebuffer_fetch_non_coherent
if shader images can't be coherent. This is especially interesting for
Vulkan, since noncoherent framebuffer fetch is possible without any
extensions.

Bug: angleproject:7279
Bug: angleproject:7683
Bug: angleproject:7684
Bug: angleproject:7724
Change-Id: I33f3b2c6df9a5709969d9165c448ea71b096c9e1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3900142
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Chris Dalton <[email protected]>
2022-10-01 17:20:13 +00:00
Hailin Zhang 836cc5e2ce Vulkan: add etc to bc compute transcoding.
use compute shader to transcode etc format to bc format.

Bug: b/243398683
Change-Id: Idbd0820a2df8d92fe690055dae2933bc559e9bfd
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3888501
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
Commit-Queue: Hailin Zhang <[email protected]>
2022-09-30 23:05:12 +00:00
Chris Dalton a81679bc83 Support EXT_shader_framebuffer_fetch on GLES
All the frontend functionality for EXT_shader_framebuffer_fetch is
already present, but only supported on Vulkan. This change wires it up
for the native GLES backend as well.

Bug: angleproject:7279
Bug: angleproject:7703
Change-Id: Ie1fce79e08a78662c8af65d33f3d8417c96cf58e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3920577
Commit-Queue: Chris Dalton <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2022-09-30 21:38:32 +00:00
Robert Mader bf22843c48 EGL: Update EGL headers
In order to implement EGL_EXT_device_drm_render_node

Bug: angleproject:7686
Change-Id: If9b0e2852a816071bad79c103f1e291dd43eb45c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3913209
Commit-Queue: Shahbaz Youssefi <[email protected]>
Auto-Submit: Robert Mader <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2022-09-28 19:26:17 +00:00
Shahbaz Youssefi 01285f16ab Remove Platform.h
Overloaded name.  Causing trouble with gles1's platform.h on
case-insensitive file systems despite the different case.

Bug: angleproject:3408
Change-Id: Icc1644a4c6a9c9076a2bbafbfb1d6eac578b731a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3920895
Reviewed-by: Cody Northrop <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-09-27 03:58:48 +00:00
Shahbaz Youssefi 163e56e444 Allow feature overrides to end in * (wildcard)
Makes it easier to apply overrides to features with long names.  Also
works around Android's limit of 92 characters for debug properties.

Bug: b/238024366
Change-Id: I8f417287f92b2439de1a7b7d6abbaf9e61b405e8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3906222
Reviewed-by: Amirali Abdolrashidi <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Yiwei Zhang <[email protected]>
2022-09-27 01:43:08 +00:00
Geoff Lang 25bad36c1a Metal: Remove unpackLastRowSeparatelyForPaddingInclusion
This speculative fix did not work.

Bug: angleproject:7573
Change-Id: I345db1746f8725d82420aabffb37c8dd01230a34
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3915182
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Gregg Tavares <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
2022-09-26 17:45:08 +00:00
Geoff Lang 70e5e90fb2 Metal: Avoid locking IOSurfaces in glReadPixels on AMD.
The AMD driver tends to crash when locking IOSurfaces. Avoid this by
using the copyIOSurfaceToNonIOSurfaceForReadOptimization feature to do
a texture-texture copy before reading back data to the CPU.

This is a *speculative* fix due to seeing crashes in the
ClientLockIOSurface function in the AMD driver.

Bug: angleproject:7573
Change-Id: Ia120f2a96eed65431b5f8a99cf1da7d7e85da639
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3915181
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Gregg Tavares <[email protected]>
2022-09-26 15:43:07 +00:00
Geoff Lang 2aa52da7e4 Metal: Upload IOSurface data with staging buffers on AMD
Crashes have been seen in the AMD driver when locking IOSurfaces. Avoid
this by always using a staging buffer and doing a GPU-GPU copy for
uploading client side data to IOSurfaces.

Bug: angleproject:7573
Change-Id: I4d981a24554a755a7248199699b486d98cbad83d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3915180
Commit-Queue: Kenneth Russell <[email protected]>
Reviewed-by: Gregg Tavares <[email protected]>
2022-09-25 03:30:36 +00:00
Dan Glastonbury d2a58f00af EGL: Implement eglCopyMetalSharedEventANGLE
Add eglCopyMetalSharedEventANGLE function to the
ANGLE_metal_shared_event_sync extension. This brings the extension on
par with the EGL_ANDROID_native_fence_sync extension.

eglCopyMetalSharedEventANGLE allows for copying the Metal event object
from EGLSync objects implemented by the ANGLE Metal renderer. This
function follows Objective-C convention for "copy" methods and increases
the retain count of the Metal event object. The EGL API user is thus
responsible for ensuring to release the returned object to avoid memory
leaks.

Test: angle_end2end_tests --gtest_filter=EGLSyncTestMetalSharedEvent.*
Bug: angleproject:7561
Change-Id: I8c35b559014b85cb8c6a0e76ac2ab7891eed5da0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3881423
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Kenneth Russell <[email protected]>
Reviewed-by: Quyen Le <[email protected]>
2022-09-23 22:01:09 +00:00
Dan Glastonbury a89f678f8a EGL: Implement ANGLE_metal_shared_event_sync on metal
Implement creation of fence sync object taking an external
MTLSharedEvent and optional value to use when signaling completion of
prior commands.

Extended end2end test suite with metal shared event test cases.

Test: angle_end2end_tests --gtest_filter=EGLSyncTestMetalSharedEvent.*
Bug: angleproject:7561
Change-Id: I0e72b5417275a20a24e535670ceb995ecc87abcb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3865060
Reviewed-by: Quyen Le <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Kenneth Russell <[email protected]>
2022-09-21 01:42:23 +00:00
Shahbaz Youssefi ba3b451595 Vulkan: Implement GL_ANGLE_logic_op
Enabled if the logicOp device feature is available.  According to
gpuinfo, it's pretty much universal except for ARM.

Bug: angleproject:7654
Change-Id: I4808b519fdd6273b2f8c1bb17f59517eb65bfe8d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3898317
Reviewed-by: Yuxin Hu <[email protected]>
Reviewed-by: Amirali Abdolrashidi <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-09-20 14:16:52 +00:00
Shahbaz Youssefi de73f7cd7d Introduce GL_ANGLE_logic_op
This extension exposes the desktop GL glLogicOp function as a GLES
extension.  This is supported by Vulkan through the logicOp feature as
well.

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

Bug: angleproject:3862
Change-Id: I7ed436cdf401437157ca9724168849b4c819b91b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3898310
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Amirali Abdolrashidi <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2022-09-20 04:02:18 +00:00