Commit Graph
67 Commits
Author SHA1 Message Date
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
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
Bo Liu 57ccd974ba Make limit_max_texture_size_to_4096 webgl only
Bug: chromium:1319451
Change-Id: I7dedeb8d738c1070e650650e893d57984a9e7956
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3739439
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2022-08-03 20:59:36 +00:00
Lingfeng Yang 6142b83979 Vulkan: EXT_YUV_target: add vk feature
This Vulkan feature will be set to true once we detect support
from underlying Vk driver (method TBD).

Bug: b/223456677
Change-Id: I5003068c3119f43befb92579d4b656e3a9346363
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3788564
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Chris Forbes <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
Commit-Queue: Lingfeng Yang <[email protected]>
2022-07-28 22:50:41 +00:00
Shahbaz Youssefi be70844665 Vulkan: Remove the bindEmptyForUnusedDescriptorSets workaround
Only applied to older Qualcomm-based phones.

Bug: angleproject:2727
Change-Id: I37a611e2ff79d898eff9401467407543f3c690b8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3785290
Reviewed-by: Charlie Lao <[email protected]>
Auto-Submit: Shahbaz Youssefi <[email protected]>
Reviewed-by: Yuxin Hu <[email protected]>
Commit-Queue: Yuxin Hu <[email protected]>
2022-07-25 22:12:34 +00:00
Chris Dalton 15cc001307 Add a GL_ANGLE_shader_pixel_local_storage extension
Plumbs through "GL_ANGLE_shader_pixel_local_storage" and
"GL_ANGLE_shader_pixel_local_storage_coherent" extension strings
advertised by ANGLE and stubs out an initial spec document. This change
doesn't add any new procedures or shader constructs, but it does allow
the PLS tests to start checking for the real extension strings and
requiring the GL_ANGLE_shader_pixel_local_storage extension.

Bug: angleproject:7279
Change-Id: I36877fe4117185a2121f803288123cd69a447cf3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3739590
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Chris Dalton <[email protected]>
2022-07-15 20:39:03 +00:00
Amirali Abdolrashidi d9763c60d3 Disable mutable texture upload on Win/Intel devs
After adding the mutable texture upload CL, we are experiencing
some instances of flakiness in the form of lost context/device
errors in the perf tests in Win/Intel cases.

* Added mutableMipmapTextureUpload as an ANGLE feature, which is
used to determine if onMutableTextureUpload() should be called.
  * It is disabled on Windows when using an Intel GPU.
* Disabled the related unit tests on Win/Intel cases.

Bug: angleproject:7308
Bug: b/202744914
Change-Id: Ib8c1bddc39cc4354468831a4a599a7c343d05f0e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3764460
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
2022-07-15 02:51:43 +00:00
Alexey Knyazev 5897d6f594 GL: Add emulateCopyTexImage2D workaround
Using texImage2D + copyTexSubImage2D seems to be
more stable than using copyTexImage2D directly.

Added missing HALF_FLOAT fix to the code path that
requires target texture initialization.

Fixed target texture dimensions when initialization
is not required.

Fixes Apple GPU crashes in:
* CopyTexImageTest.DeleteAfterCopyingToTextures
* conformance/textures/misc/texture-copying-and-deletion.html
* conformance/textures/misc/texture-copying-feedback-loops.html

Bug: angleproject:5038
Bug: angleproject:5360
Bug: chromium:1130703
Change-Id: I5cce087983601e768902f01b3462ec2106e2500a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3749921
Commit-Queue: Kenneth Russell <[email protected]>
Reviewed-by: Gregg Tavares <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
2022-07-13 19:10:51 +00:00
Ian Elliott d88f790635 Extra buffer logging/checking on Android Cuttlefish
This adds a feature that will be enabled on Android Cuttlefish
systems, to catch a rare crash.

Test: Visual inspection of logcat output
Bug: b/236098131
Change-Id: Ie35d7e017f69b36da9caf3e47c31fcc71846caed
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3726963
Reviewed-by: Cody Northrop <[email protected]>
Commit-Queue: Ian Elliott <[email protected]>
2022-07-12 20:41:20 +00:00
Mohan Maiya 9070e279a8 Vulkan: Handle platforms that have imprecise float division issues
Even when the dividend and divisor have the same value
some platforms do not return 1.0f. We need to emit sepcial
division code on such platforms.

Bug: angleproject:3586
Tests: KHR-GLES31.core.blend_equation_advanced.blend*HSL*
Change-Id: Ibb81f57c959ae2c8edb6d361bf6241c019dfb988
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3738439
Reviewed-by: Charlie Lao <[email protected]>
Commit-Queue: mohan maiya <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2022-07-05 19:12:13 +00:00
Shahbaz Youssefi e50351cb06 Vulkan: Don't close render pass on framebuffer fetch
For applications that use framebuffer fetch in the same RP as
non-fetch programs, we can save some extra RenderPasses by always
creating our RP objects with input attachments enabled.  This works
almost identically except for needing to use the images in a
"GENERAL" layout instead of "COLOR_ATTACHMENT_OPTIMAL".  According
to partners it is possible to achieve performance parity even with
GENERAL layout.

To remove any potential negative impacts of using the GENERAL layout,
the context enters this always-framebuffer-fetch mode only and as soon
as a framebuffer fetch program is created.  Applications that don't use
framebuffer fetch are thus unaffected.

This eliminates 20 render passes in the Genshin Impact trace (out of
about 58).  On a Pixel 6 the resulting benchmark score speeds up by
~25%.  For Real Racing 3, the speed up is ~30%.

Based on change by [email protected]

Bug: angleproject:7375
Change-Id: Ib6c73e95d06229f8545d502b388ee2a55a582323
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3697308
Reviewed-by: Charlie Lao <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-06-24 04:08:17 +00:00
Shahbaz Youssefi 97a6e58194 Vulkan: Useful implementation of program binaries
ANGLE already serializes the pipeline state for the sake of
OES_get_program_binary.  This serialization had limited usefulness
however, since the Vulkan driver hasn't actually created any pipelines
yet (which is a costly part of program creation).

Simultaneously, ANGLE deferred Vulkan pipeline creation to draw time,
which causes hitching.

In this change, a handful of Vulkan pipelines are precreated at
link time; those at least that are sure to create different blobs in the
pipeline cache (different spec consts or SPIR-V generation).  These
pipelines are created in the program executable's cache.  The cache is
then merged into the shared renderer cache (for potential blob reuse by
other programs).

With this, two goals are achieved:

- Most pipelines created at draw time hit the pipeline cache, avoiding
  costly compilation.
- When the program binary is retrieved, the contents of the program
  executable's pipeline cache is also returned.  On reload, the cache is
  recovered, resulting in faster startup.

Bug: angleproject:5881
Change-Id: I46c5451a7d0b16dffd40e44015e094640886880b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3671977
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-06-16 19:20:36 +00:00
Ian Elliott 0f8f760d97 Disable KHR_no_error for Android/SwiftShader
Speculatively fix crash in Skia on ANGLE that has been happening.
In addition, prevent other crashes in the future.

Bug: b/220069903
Change-Id: I01b9896a6feb8be524849dafbc1df9526fc98754
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3694160
Commit-Queue: Ian Elliott <[email protected]>
Auto-Submit: Ian Elliott <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2022-06-09 19:58:50 +00:00
Yuxin Hu 5fbb04176e Vulkan: Handling VK_EXT_load_store_op_none on ARM
There is a bug on at least one ARM device when either
depth or stencil load op is none. Add a temporary work
around to avoid this case for ARM driver until
angleproject:7370 is addressed. Also add a test to
reproduce the deqp test failures with simiplied draw calls.

Bug: angleproject:7370
Bug: angleproject:7351
Change-Id: I74ac49a75f85b1e006ed3b1d77f234f63d314ae0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3671696
Reviewed-by: Charlie Lao <[email protected]>
Commit-Queue: Yuxin Hu <[email protected]>
Reviewed-by: Ian Elliott <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2022-06-09 18:36:40 +00:00
Shahbaz Youssefi 4ea62009c9 Vulkan: Prefer driver uniforms over spec consts
On hardware that's not seeing any benefit from specialization constants,
this change switches to using driver uniforms to reduce the number of
pipelines created.

Bug: angleproject:7406
Bug: b/173636783
Change-Id: Ic1ea1b389b0b27169427643f811370943195f331
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3692270
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-06-08 03:45:11 +00:00
Geoff Lang d670b5a36b GL: Disable texture border clamp on imagination.
IMG GPUs generate INVALID_ENUM when setting the texture border color.

Bug: angleproject:7405
Change-Id: I04a28d36943c143ad5e18bf80e618230b116a632
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3692265
Reviewed-by: Peng Huang <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2022-06-07 17:49:48 +00:00
Shahbaz Youssefi 53ec886e41 Vulkan: Externally synchronize the pipeline cache
In preparation for a future change that requires this as it may perform
pipeline cache merges during creation of pipelines.

Bug: angleproject:5881
Change-Id: Ic7921b781aa773ae23b60a0bb6fa2111b1fc401e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3679479
Reviewed-by: Charlie Lao <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-06-03 02:55:34 +00:00
Brandon Schade eb282de025 Vulkan: Add feature to use VK_FILTER_LINEAR for YUVConversionInfo
VK_FILTER_NEAREST is default for chromaFilter in ConversionInfo.
Add feature to allow VK_FILTER_LINEAR to be used instead. This
feature controls the quality when sampling YUV images.

Bug: angleproject:7382
Change-Id: I3f67d7620d94b5b33c42754adfef84b97c798637
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3684351
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Trevor Black <[email protected]>
Reviewed-by: mohan maiya <[email protected]>
Commit-Queue: Brandon Schade <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2022-06-02 22:41:44 +00:00
Gregg Tavares 94320a83a1 Metal: Validate total bits used in color attachments
Metal has 2 limits for color attachments. 1 the number of
attachments supported. 2 the total number of bits it can
write per pixel. So for example Apple4 through Apple8 GPUs
can have 8 attachments but only 512bits of output. That
means you can attach 8 RGBA8 textures (256bits), but you
can't attach 8 RGBA32UI textures (1024bits).

If there are too many bits then return
FRAMEBUFFER_UNSUPPORTED from checkFramebufferStatus
and INVALID_FRAMEBUFFER_OPERATION from draws

Bug: angleproject:7280
Change-Id: I935aebad4d57664f59a60be20a927d6b69afb4ff
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3674322
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Gregg Tavares <[email protected]>
2022-06-02 17:45:34 +00:00
Gregg Tavares 8a0351a5aa Metal:Dynamically choose max draw buffers.
The code was hard coded to 4 which is lower than OpenGL's 8.
This implementation keeps a hard coded array of size 8 in
rx::mtl::RenderPassDesc and rx::mtl::RenderPipelineOutputDesc
but only uses up to the display's limit.

Bug: angleproject:7280
Bug: angleproject:5730
Change-Id: Idd7e64dc47697882b44540804159566158e1e924
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3671695
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Gregg Tavares <[email protected]>
2022-06-02 01:45:03 +00:00
Shahbaz Youssefi 28b4c378da Vulkan: Pipeline creation feedback in perf counters
Bug: angleproject:5881
Change-Id: I42917cab3c97abb50a14035972a96728dcb990b9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3672851
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
2022-06-01 20:54:23 +00:00
Shahbaz Youssefi 7c83a3635d Vulkan: Dynamic state for rasterizer discard enable
Interaction with primitives generated query are tested by those tests
added in
https://chromium-review.googlesource.com/c/angle/angle/+/2976181

Bug: angleproject:5906
Change-Id: I0ab9f54995504be770a93bf13337a5ffe20bf7eb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3651582
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Yuxin Hu <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-05-20 21:42:34 +00:00
Mohan Maiya 2fdd7bfd1c Vulkan: Support binding 2D slice of a 3D texture to an image unit
Support binding a 3d texture as a 2d texture by specifying that it is
non-layered during glBindImageTexture and expose support for
EGL_KHR_gl_texture_3D_image when VK_EXT_image_2d_view_of_3d vulkan
extension is supported.

Tests: ComputeShaderTest.BindImageTexture3D
       dEQP-GLES31.functional.image_load_store.3d.*single_layer
Bug: angleproject:7320
Change-Id: Ie2f0dfcdf302a4aa58990f74329ca36e62cd3902
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3648586
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: mohan maiya <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2022-05-18 17:12:48 +00:00
Shahbaz Youssefi 4e5da2d28f Vulkan: Dynamic state for cull mode
Bug: angleproject:5906
Change-Id: I3d7b888e7999d4892ff71d636ea16a2edcf7a27f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3642800
Reviewed-by: Yuxin Hu <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-05-15 01:14:23 +00:00
Shahbaz Youssefi 31321cb738 Vulkan: Remove suppressions and workarounds for old AMD/Windows
The old AMD/Windows bots are decomissioned.  This change removes
suppressions and workarounds that were added for that bot.

Bug: angleproject:2463
Bug: angleproject:2809
Bug: angleproject:2847
Bug: angleproject:3243
Bug: angleproject:4720
Bug: angleproject:6123
Bug: angleproject:6652
Bug: angleproject:7144
Bug: angleproject:7227
Bug: chromium:1224996
Change-Id: I333ed6d76dfa2916b713ccb49127deceb5b1b551
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3634728
Reviewed-by: Yuly Novikov <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-05-09 21:42:14 +00:00