372 Commits
Author SHA1 Message Date
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 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
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 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
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
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
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 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
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
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 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
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
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
Antonio Caggiano a8a04ce16e Vulkan: Add supportsPresentation feature
Some platforms do not support presentation through any Vulkan queue. In
this case we should not transition the color image layout to present.

Bug: angleproject:7217
Change-Id: I71cad0e52bc1fdb531de5a34e917a1862a4cf070
Signed-off-by: Antonio Caggiano <[email protected]>
Suggested-by: Sungyong Choi <[email protected]>
Suggested-by: Shahbaz Youssefi <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3853598
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-09-16 04:36:22 +00:00
Geoff Lang 09446a6bfd Metal: Upload the last texture row separately on AMD.
Speculative fix for crashes seen when uploading texture data on AMD.
Port of the unpackLastRowSeparatelyForPaddingInclusion workaround from
the GL backend.

Currently constrained to client data 2D uploads to non-compressed
textures.

Bug: angleproject:7573
Change-Id: Idd036b92619d309e5b2a8062043e8644f4d5b2e0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3870655
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Gregg Tavares <[email protected]>
2022-09-09 21:52:27 +00:00
Gregg Tavares 662226a324 Metal: Preemptively Start Provoking Vertex CmdBuffer on AMD
There seems to be a bug in older AMD drivers and this appears
to work around it

Bug: angleproject:7635
Change-Id: I1b22e4b7d5d1ce0d405e422d08d33eeeb731050a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3877666
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Kenneth Russell <[email protected]>
2022-09-06 22:34:13 +00:00
Ian Elliott 9aeb6311a0 Revert "Extra buffer logging/checking on Android Cuttlefish"
This reverts commit 5cb05e0482ed1a2c4048f76c1a7fd444849410d8.

The root cause was found, and this extra logging/checking is no longer
needed.

Bug: b/236098131
Bug: b/245339714
Change-Id: Ibefbeec30be974788789650f2dc86696a6eba11a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3862408
Auto-Submit: Ian Elliott <[email protected]>
Reviewed-by: Jason Macnak <[email protected]>
Commit-Queue: Jason Macnak <[email protected]>
2022-09-06 19:06:33 +00:00
Chris Dalton d0fad24cef Add noncoherent PLS tests
Coherent pixel local storage is so widely supported now that we have a
testing gap on the noncoherent version. This change adds backend
features to disable the extensions we use for fragment synchronization
and tests that disable them.

Bug: angleproject:7279
Change-Id: If71a1a1016922cb9e3b68024dd2616483c700395
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3866163
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2022-09-01 16:30:59 +00:00
Shahbaz Youssefi 5bcfad04de Vulkan: Add a handful of features
This commit bunches a couple of features in one to reduce merge
conflicts.

Bug: angleproject:4836
Bug: angleproject:5845
Bug: angleproject:7162
Bug: angleproject:7319
Bug: angleproject:7604
Change-Id: Icbb33f5b6d61822c5f4a61f08078bb2de4e7d2fe
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3856646
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Auto-Submit: Shahbaz Youssefi <[email protected]>
2022-08-25 19:55:27 +00:00
Mohan Maiya aa2a558ec2 Vulkan: Add support for setting timestamp surface attribute
On Android the EGL wrapper handles most of the functionality required
by EGL_ANDROID_get_frame_timestamps. However if for some reason the
swapchain is recreated, the timestamp state would be lost resulting in
stuttering.

Introduce EGL_ANGLE_timestamp_surface_attribute extension that adds
support for toggling the EGL_TIMESTAMPS_ANDROID attribute of a surface.
Cache this state and recreate the swapchain accordingly.

Bug: angleproject:7489
Test: EGLSurfaceTest.TimestampSurfaceAttribute*
Test: dEQP-EGL.functional.get_frame_timestamps*
Change-Id: I3660f7137c006d904164d243a682a4ff520eabd8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3753396
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Ian Elliott <[email protected]>
Commit-Queue: mohan maiya <[email protected]>
2022-08-24 00:03:00 +00:00
Shahbaz Youssefi 952d6e8f8b Vulkan: Workaround ARM driver bug with dynamic vertex strides
According to ARM, vkCmdBindVertexBuffers2EXT is broken when more than
one attribute binding is involved.  In this change, the vertex strides
dynamic state is avoided altogether on ARM.

Bug: fuchsia:107106
Change-Id: Ie41fc07037083214d2dc99e4ed062485384911c5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3844640
Reviewed-by: Cody Northrop <[email protected]>
Reviewed-by: Yuxin Hu <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-08-22 22:17:01 +00:00
Lingfeng Yang caf2b4279b Vulkan: Add feature to use PASS_THROUGH for EGL_NONE color spaces
This is a temporary solution to fix media tests until ANGLE
also has the ability to query the "preferred color space" from
Surfaces.

Bug: b/235995022
Test: Launch Cuttlefish with this change and the feature enabled
      with aosp/2167231
Test: cts -m CtsMediaCodecTestCases
          -t android.media.codec.cts.EncodeDecodeTest
Test: cts -m CtsMediaCodecTestCases
          -t android.media.codec.cts.DecodeEditEncodeTest
Change-Id: I17d1a2c1701cd1707b34f5bf2f222e9ad57c7a61
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3770291
Reviewed-by: Yiwei Zhang <[email protected]>
Commit-Queue: Jason Macnak <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Lingfeng Yang <[email protected]>
2022-08-22 16:47:59 +00:00
Shahbaz Youssefi 4330a827ba Reland "Vulkan: Use VK_EXT_primitive_topology_list_restart"
This reverts commit 29d18b3031.

Reason for revert: Fixed VVL suppressions not working

Original change's description:
> Revert "Vulkan: Use VK_EXT_primitive_topology_list_restart"
>
> This reverts commit e79c9cd630.
>
> Reason for revert: Causing timeouts on some headless tests: anglebug.com/7579
>
> Original change's description:
> > Vulkan: Use VK_EXT_primitive_topology_list_restart
> >
> > From ANGLE's point of view, there is nothing to do with this extension
> > other than enable a feature that silences a validation error.
> >
> > Bug: angleproject:3832
> > Change-Id: I094343d09c322e2848a65a5bc775d0f21388fb46
> > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3562380
> > Reviewed-by: Jamie Madill <[email protected]>
> > Commit-Queue: Shahbaz Youssefi <[email protected]>
> > Reviewed-by: mohan maiya <[email protected]>
>
> Bug: angleproject:3832
> Change-Id: Ifec7c9eaea1d3a949f15e0b6d868742f53cf8377
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3838391
> Commit-Queue: Shahbaz Youssefi <[email protected]>
> Reviewed-by: Geoff Lang <[email protected]>
> Auto-Submit: Shahbaz Youssefi <[email protected]>

Bug: angleproject:3832
Change-Id: Ia79b1f3b716f0df1991f605704135b4af48fb639
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3841366
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2022-08-19 15:27:46 +00:00
Shahbaz Youssefi 29d18b3031 Revert "Vulkan: Use VK_EXT_primitive_topology_list_restart"
This reverts commit e79c9cd630.

Reason for revert: Causing timeouts on some headless tests: anglebug.com/7579

Original change's description:
> Vulkan: Use VK_EXT_primitive_topology_list_restart
>
> From ANGLE's point of view, there is nothing to do with this extension
> other than enable a feature that silences a validation error.
>
> Bug: angleproject:3832
> Change-Id: I094343d09c322e2848a65a5bc775d0f21388fb46
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3562380
> Reviewed-by: Jamie Madill <[email protected]>
> Commit-Queue: Shahbaz Youssefi <[email protected]>
> Reviewed-by: mohan maiya <[email protected]>

Bug: angleproject:3832
Change-Id: Ifec7c9eaea1d3a949f15e0b6d868742f53cf8377
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3838391
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Auto-Submit: Shahbaz Youssefi <[email protected]>
2022-08-18 19:59:36 +00:00
Eddie Hatfield 955adb7757 Cache compiled shader
By storing the compiled shader in the blob cache, the time to
recompile the same shader is reduced.

Based on work by <[email protected]>

Bug: angleproject:7036
Change-Id: I884ae40e715c49a9ccd12903012e8327811e3557
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3808235
Commit-Queue: Cody Northrop <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
2022-08-18 05:28:46 +00:00
Shahbaz Youssefi e79c9cd630 Vulkan: Use VK_EXT_primitive_topology_list_restart
From ANGLE's point of view, there is nothing to do with this extension
other than enable a feature that silences a validation error.

Bug: angleproject:3832
Change-Id: I094343d09c322e2848a65a5bc775d0f21388fb46
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3562380
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: mohan maiya <[email protected]>
2022-08-16 17:44:48 +00:00
Chris Dalton 4a636cdd41 Require all PLS formats to consume exactly 4 bytes of storage
D3D 11.0 UAVs only support R32_FLOAT, R32_UINT, R32_SINT formats.

EXT_shader_pixel_local_storage explicitly states that all PLS variables
consume exactly 4 bytes.

ESSL images can only have both read and write access if their format is
r32f, r32i, r32ui. (We were able to circumvent this via aliasing, but it
was a huge source of bugs.)

There is a large precedent for only supporting 4 bytes of storage in the
capabilities we use for PLS, so this CL removes support for all PLS
storage formats that are not 4 bytes. It also implements an "R32" mode
for PLS, that does manual packing and unpacking of r32* image formats.
If the application wants larger formats, it can always define multiple
PLS planes and piece them together.

Next up we ought to be able to support rg16* types with more
packing/unpacking.

With aliasing gone, and with a bit of tweaking, the PLS tests now pass
on the Pixel 4 GLES bot.

Bug: angleproject:7279
Bug: angleproject:7388
Bug: angleproject:7524
Bug: angleproject:7527
Change-Id: I6b8f62c2428ade6cb5413e33360d734e55dda0eb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3782579
Reviewed-by: Stephen White <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Chris Dalton <[email protected]>
2022-08-11 18:05:32 +00:00
Chris Dalton fa3d7d5cd0 Make PLS coherent on Vulkan
Uses the VK_EXT_fragment_shader_interlock extension to make the shader
image implementation of PLS coherent on Vulkan.

This extension is supported on AMD, Apple, NVIDIA, and Intel.

Bug: angleproject:7279
Change-Id: Ic0253eb20932eb6be0b1f433ba454e48b57be2f5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3813816
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Chris Dalton <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2022-08-11 18:02:42 +00:00
Shahbaz Youssefi 876da4ae9c Vulkan: Query support for VK_KHR_imageless_framebuffer
In preparation for using it.

Bug: angleproject:7553
Change-Id: I579af8ce2c0dd1d58bf750ee494e06a071b798fa
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3823620
Auto-Submit: Shahbaz Youssefi <[email protected]>
Reviewed-by: Amirali Abdolrashidi <[email protected]>
Commit-Queue: Amirali Abdolrashidi <[email protected]>
2022-08-10 22:46:41 +00:00
Shahbaz Youssefi f7d4c6145d Vulkan: Use VK_EXT_primitives_generated_query
This Vulkan extension implements OpenGL's primitives generated query.
The heavy lifting in ANGLE's implementation was done when this query was
emulated with pipeline statistics query.  This change simply switches
pipeline statistics query usage to this dedicated query when available.

Bug: angleproject:5430
Change-Id: I5d2c7d64e4627bcbd33d428d6a7c836b1129e5fd
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3813815
Reviewed-by: Charlie Lao <[email protected]>
Reviewed-by: Ian Elliott <[email protected]>
Commit-Queue: Yuxin Hu <[email protected]>
2022-08-10 18:18:03 +00:00
Shahbaz Youssefi 493b5aff70 Vulkan: Workaround ARM bug with stencil write mask
Bug: angleproject:7556
Change-Id: I0aa17c178071cc15d8ee15f700b0c4932819c72a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3821367
Reviewed-by: Ian Elliott <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
2022-08-10 16:02:25 +00:00
Amirali Abdolrashidi 8050079c11 Vulkan: Remove basicGLLineRasterization
* Removed basicGLLineRasterization from the ANGLE features.
* Removed "viewport" from the extended driver uniform classes.

Bug: angleproject:2830
Bug: angleproject:7558
Change-Id: I289b1e2b536a6bd0c1ab24844835221e617a296d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3818165
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-08-09 18:28:28 +00:00
Chris Dalton 861149c7ac Make PLS coherent on desktop OpenGL
Implements ANGLE_shader_pixel_local_storage_coherent using fragment
shader synchronization extensions:

  NV_fragment_shader_interlock
  INTEL_fragment_shader_ordering
  ARB_fragment_shader_interlock

With these extensions combined, we get coherency all 3 big desktop
vendors: NVIDIA, Intel, and AMD.

Bug: angleproject:7279
Change-Id: Ie20b251fb772898e89994b799640f1f2806581eb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3773990
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2022-08-04 14:04:26 +00:00