Commit Graph
220 Commits
Author SHA1 Message Date
Mohan Maiya dd312cc612 Reland "Vulkan: Add support for EXT_texture_border_clamp"
This is a reland of 4b92e089c0
Initializes mPadding to 0 in SamplerDesc::update

Original change's description:
> Vulkan: Add support for EXT_texture_border_clamp
> Add support for GL_EXT_texture_border_clamp. This is implemented by
> using VK_EXT_custom_border_color.
>
> Bug: angleproject:3577
> Test: dEQP-GLES31.functional.texture.border_clamp*
> Change-Id: Ie9fa1eb5dd03b997b5ae182787641a53080a9e51
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2830192
> Reviewed-by: Jamie Madill <[email protected]>
> Reviewed-by: Shahbaz Youssefi <[email protected]>
> Commit-Queue: Mohan Maiya <[email protected]>

Bug: angleproject:3577
Change-Id: I8684242c4bce6e1a006dbe926defaa495fcc2282
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2911571
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Mohan Maiya <[email protected]>
2021-05-21 18:03:17 +00:00
Yuly Novikov 44fabb7b88 Revert "Vulkan: Add support for EXT_texture_border_clamp"
This reverts commit 4b92e089c0.

Reason for revert: breaks "Linux MSan Tests" bot
https://ci.chromium.org/ui/p/chromium/builders/ci/Linux%20MSan%20Tests/28489/overview

Original change's description:
> Vulkan: Add support for EXT_texture_border_clamp
>
> Add support for GL_EXT_texture_border_clamp. This is implemented by
> using VK_EXT_custom_border_color.
>
> Bug: angleproject:3577
> Test: dEQP-GLES31.functional.texture.border_clamp*
> Change-Id: Ie9fa1eb5dd03b997b5ae182787641a53080a9e51
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2830192
> Reviewed-by: Jamie Madill <[email protected]>
> Reviewed-by: Shahbaz Youssefi <[email protected]>
> Commit-Queue: Mohan Maiya <[email protected]>

Bug: angleproject:3577, angleproject:5996
Change-Id: I6b62f1a4a43fcfe2d0df2c73de24db83606ce430
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2911533
Reviewed-by: Yuly Novikov <[email protected]>
Commit-Queue: Yuly Novikov <[email protected]>
2021-05-21 03:36:57 +00:00
Shahbaz Youssefi 9bc837f64b Vulkan: Generate SPIR-V directly from the translator; Part 1
This is the first change in a series to generate SPIR-V directly from
the translator's AST, instead of the generating text GLSL and feeding it
to glslang.

This change implements the majority of the work needed to map AST types
to SPIR-V types, and declare types and interface variables in SPIR-V.
Additionally, it lays the infrastructure to conditionally enabling this
path in end2end tests.

No tests are currently enabled as the change doesn't actually generate
code for function bodies yet.

Bug: angleproject:4889
Change-Id: Iacb28b6907fd48c50e4cc5a0e7ad72f6eed241d4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2889603
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2021-05-19 19:03:10 +00:00
Mohan Maiya 4b92e089c0 Vulkan: Add support for EXT_texture_border_clamp
Add support for GL_EXT_texture_border_clamp. This is implemented by
using VK_EXT_custom_border_color.

Bug: angleproject:3577
Test: dEQP-GLES31.functional.texture.border_clamp*
Change-Id: Ie9fa1eb5dd03b997b5ae182787641a53080a9e51
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2830192
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Mohan Maiya <[email protected]>
2021-05-18 18:14:58 +00:00
Geoff Lang 5a0925def4 GL: Recreate textures on eglReleaseTexImage.
Texture data should be reset on eglReleaseTexImage but ANGLE sometimes
skipped this because it generated GL errors on Mac. Instead, delete
and recreate the native texture to make sure ANGLE doesn't hold any
references.

Bug: chromium:1181068
Change-Id: I1252b0900361852f66f73b8c9d20a29c53897ee4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2897544
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
2021-05-14 22:52:52 +00:00
Charlie Lao 09dad082c3 Vulkan: Add feature flag to flush at framebuffer boundary
Testing shows most app traces seeing performance improved on ARM GPU
when we flush at FBO boundary instead of one submit per frame. This
likely due to more frequent submission means less chance of GPU
starvation. This also helps ANGLE to detect GPU finish at finer grain
since the queue serial is per submission. Finer grain detection of
object completion means memory gets recycled quicker and mapBufferRange
able to hit fast code path more often. With this CL, manhattan 3.1
offscreen score also score improves 7%. This may also helps onscreen
performance if frame time is on the edge of 16ms by submit FBO rendering
earlier instead of been blocked by vkAcquireNextImage.

Bug: b/187993625
Bug: angleproject:5295
Change-Id: I2946a7159231d36019ace89805a69ac8e906ce94
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2888709
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Ian Elliott <[email protected]>
Commit-Queue: Charlie Lao <[email protected]>
2021-05-14 18:50:56 +00:00
Geoff Lang ce89d99fde GL: Flush after framebuffer change on Mac 9th gen Intel GPUs
Speculative fix for crashes during flush on Mac. Mirrors the
flush_on_framebuffer_change workaround in Chrome from
http://crbug.com/783979

Bug: chromium:1181068
Change-Id: Ic84b1bfc44babf27016b306393da308d504d7fd9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2859984
Reviewed-by: Peng Huang <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2021-04-29 18:01:07 +00:00
Geoff Lang ccd984ff39 Reland "Add a Vulkan feature to compress float32 vertex formats."
This reverts commit 8ace36f8c1.

Original change's description:
> Revert "Add a Vulkan feature to compress float32 vertex formats."
>
> Bug: b/167404532
> Bug: b/161716126
> Change-Id: I95157a006d5c1fd2d3c0c2c2be37fa0403c07f93
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2510011
> Reviewed-by: Tim Van Patten <[email protected]>
> Reviewed-by: Jamie Madill <[email protected]>
> Commit-Queue: Geoff Lang <[email protected]>

Bug: b/167404532
Bug: b/161716126
Change-Id: Ic6811fe3a7124e6eb1efe7c72a1a03a120217753
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2815260
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
2021-04-22 15:16:56 +00:00
Peng Huang be2f7b1cd2 Unbind fbo before context switching for PowerVR GPUs
Imagination GL drivers are buggy with context switching.
We need to ubind fbo to workaround a crash in the driver.

Bug: chromium:1187513
Change-Id: Ie5142b5f43a3f23a9743ba7af0d90567fedd00d3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2841083
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Peng Huang <[email protected]>
2021-04-21 01:03:24 +00:00
Amy Liu 9593517622 Handle the compression of big pipeline cache.
Big pipeline cache will cost much time to compress. Regarding the
perfomance, handle the compression of big pipeline cache in this way:
1)Return when the pipeline cache data is larger than 10M.
2)Use worker thread to complete compression.

Bug: angleproject:4722
Change-Id: I62eb69d8c46729261f0502af01450ec301c258f3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2788169
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2021-04-20 15:32:08 +00:00
Jonah Ryan-Davis 2d873e0c40 GL: Workaround to sanitize amdgpu renderer strings.
On Linux with the amdgpu driver, the GL_RENDERER string contains
precise kernel and DRM version info. We should sanitize this info
before using these strings for user privacy.

Bug: chromium:1181193
Change-Id: I047d1abf5b51412b4258a021761cc450385ef0fe
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2727658
Commit-Queue: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2021-04-13 22:05:34 +00:00
Geoff Lang 18c6d628c1 GL: Support VAOs without native VAOs.
Share the default VAO state between all frontend VAO when
there is no native VAO support. Forcefully sync state every
time a new frontend VAO is bound.

Bug: angleproject:5577, chromium:1167179
Change-Id: Ieaedb5108ad28fc78e7e58b74495639c5246bb05
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2665266
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Peng Huang <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2021-04-13 15:55:39 +00:00
Geoff Lang 065c232918 Reland "Vulkan: Add features to modify sampling parameters"
This reverts commit a51b57fa2d.

Original change's description:
> Revert "Vulkan: Add features to modify sampling parameters"
>
> Bug: b/167404532
> Change-Id: Iae19dfe165074e8c01216312bddd744c4fb504a4
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2510012
> Commit-Queue: Geoff Lang <[email protected]>
> Reviewed-by: Tim Van Patten <[email protected]>
> Reviewed-by: Jamie Madill <[email protected]>

Bug: b/167404532
Change-Id: I2c756b8eb0f61701ef6e33275e557bc199a4d3b4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2815259
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2021-04-13 15:36:39 +00:00
Nicolas Capens 15f4925ac3 Restore EGL_EXT_buffer_age for SwiftShader Vulkan
EGL_EXT_buffer_age was previously disabled for SwiftShader Vulkan
because of an Android test timing out on Cuttlefish when the buffer
age is queried. aosp/1672445 addresses the root cause of the timeout,
so EGL_EXT_buffer_age can be supported again.

Bug: b/182521420
Bug: angleproject:3529
Change-Id: I5949f721316855d9138eb9f657a6df4e7b49ed71
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2821750
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Nicolas Capens <[email protected]>
2021-04-13 03:05:35 +00:00
Ian Elliott b17a93175d Vulkan: damage rectangles must never be pre-rotated
Remove the SurfaceVk::present() code that rotated damage rectangles
and the feature flag that controlled that rotation.

The Vulkan specification was changed so that the rectangles provided
to the VK_KHR_incremental_present extension must never be pre-rotated.
The spec change requires the same behavior on all platforms (just in
case), even though Android is the only platform known to support
rotation.

FYI: the Vulkan spec change was merge request 4442.

Bug: b/182930524
Change-Id: I5128fd76e718f3d964c9091830bcc5886d265543
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2818826
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2021-04-10 02:08:58 +00:00
Charlie Lao e249239c54 Vulkan: Add featue flag to force highp to mediump in fragment shader.
Adding feature flag that forces highp in fragment shader to mediump. It
is disabled by default. You can enable it for experiment.

Bug: b/184850002
Change-Id: I73980be4ad160eb1b17a3a3ecfc09f2e4aeb468c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2815240
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Charlie Lao <[email protected]>
2021-04-09 20:26:21 +00:00
Jamie Madill 9a025fd448 Capture/Replay: add frontend feature to force capture limits
Some of the limits set when FrameCapture is enabled are reflected in
the serialized context. In order for capture/replay tests to pass
these limits may also be needed to be enforced when replaying. Add a
fronten feature enable_capture_limits for this and use it in the
capture replay test script.

Patch authored by [email protected].

Bug: angleproject:5750
Change-Id: I3d333d22fe65c12dd5aa5f263d19a2c1568541c2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2790301
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2021-03-28 19:26:30 +00:00
Shahbaz Youssefi d146222879 Vulkan: Use VK_EXT_multisampled_render_to_single_sampled
Additionally, makes the emulation path not require
independentResolveNone.  This was only used to select the NONE resolve
mode when the attachment format doesn't have either of depth or stencil
aspects, but it's ok to specify the same resolve mode for both aspects
even if one aspect is missing.

Bug: chromium:1088005
Change-Id: Ifc37cbf5331145179c5927853b996a0d62b871ee
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2743666
Reviewed-by: David Reveman <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2021-03-23 20:44:21 +00:00
Nicolas Capens 135385a1ae Disable EGL_EXT_buffer_age for SwiftShader Vulkan
Cuttlefish with SwANGLE failed to pass the android.graphics.cts.
BitmapTest#testDrawingHardwareBitmapNotLeaking test, due to a timeout in
dequeueBuffer (error = -110) during an EGL_BUFFER_AGE_EXT surface query.

This change conservatively works around the issue by leaving
EGL_EXT_buffer_age support disabled for SwiftShader.

Further investigation is required to check whether this timeout can also
occur with other Vulkan drivers, and if it can be addressed robustly.

Bug: b/182521420
Bug: angleproject:3529
Change-Id: I54e3767e74bf922f273d8860f9f4cfc8b6589536
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2774030
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Nicolas Capens <[email protected]>
2021-03-20 04:44:57 +00:00
Ian Elliott 92db3c689b Vulkan: Disable rotating damage rectangles on Android
This fixes visual problems with Android games that use
eglSwapBuffersWithDamageKHR().  In 90/270-degree cases, the damage
rectangles are being double-rotated, leaving them 90-degrees out of
alignment with the window.

On Android, VK_KHR_incremental_present is built on top of the same
platform code as eglSwapBuffersWithDamageKHR().  The platform code
rotates all damage rectangles (assuming they are
application-provided).  Therefore, ANGLE should not also pre-rotate
damage rectangles.

Test: Black Desert Mobile
Test: Grand Theft Auto: San Andreas
Test: Extreme Car Driving Simulator
Bug: b/181796746
Change-Id: I6510e7540bb00afc75863e8ae8a9ea3841d1641d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2744984
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
Commit-Queue: Ian Elliott <[email protected]>
2021-03-11 17:13:57 +00:00
Shrek Shao 2b55f876ed Reland "Workaround for Mac Intel drawArraysInstanced with first > 0"
This is a reland of 027bc47ca5

Original change's description:
> Workaround for Mac Intel drawArraysInstanced with first > 0
>
> Workaround by forcefully set instanced arrays (divisor > 0)
> as streaming attributes and apply extra offset at front. Recover
> those attribute bindings when first == 0 and other draw calls
> (drawElementsInstanced)
>
> Bug: chromium:1144207, chromium:1144247, chromium:1144373
> Change-Id: Ie7836cc71b45a290513f34f90d49bd15b14ddba8
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2661095
> Commit-Queue: Shrek Shao <[email protected]>
> Reviewed-by: Geoff Lang <[email protected]>

Bug: chromium:1144207
Bug: chromium:1144247
Bug: chromium:1144373
Bug: angleproject:5271
Change-Id: Id0b818b25a605376c98c2366c1f2029e2490c6cb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2704799
Commit-Queue: Shrek Shao <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2021-02-26 23:24:10 +00:00
Corentin Wallez 9558445975 Revert "Workaround for Mac Intel drawArraysInstanced with first > 0"
This reverts commit 027bc47ca5.

Reason for revert: InstancingTests fail on Mac FYI Release (Intel UHD 630), see https://ci.chromium.org/ui/p/chromium/builders/ci/Mac%20FYI%20Release%20(Intel%20UHD%20630)/1729/overview

Original change's description:
> Workaround for Mac Intel drawArraysInstanced with first > 0
>
> Workaround by forcefully set instanced arrays (divisor > 0)
> as streaming attributes and apply extra offset at front. Recover
> those attribute bindings when first == 0 and other draw calls
> (drawElementsInstanced)
>
> Bug: chromium:1144207, chromium:1144247, chromium:1144373
> Change-Id: Ie7836cc71b45a290513f34f90d49bd15b14ddba8
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2661095
> Commit-Queue: Shrek Shao <[email protected]>
> Reviewed-by: Geoff Lang <[email protected]>

Bug: chromium:1144207
Bug: chromium:1144247
Bug: chromium:1144373
Change-Id: Ia4a6026a8c446490346b373c33fe2b1724c1761f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2704052
Bot-Commit: Rubber Stamper <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: Corentin Wallez <[email protected]>
2021-02-18 09:33:31 +00:00
Shrek Shao 027bc47ca5 Workaround for Mac Intel drawArraysInstanced with first > 0
Workaround by forcefully set instanced arrays (divisor > 0)
as streaming attributes and apply extra offset at front. Recover
those attribute bindings when first == 0 and other draw calls
(drawElementsInstanced)

Bug: chromium:1144207, chromium:1144247, chromium:1144373
Change-Id: Ie7836cc71b45a290513f34f90d49bd15b14ddba8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2661095
Commit-Queue: Shrek Shao <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2021-02-18 04:31:49 +00:00
Peng Huang 46203e322b Workaround context lost for Adreno 42x and 3xx
Bug: chromium:1171371
Change-Id: I8c2e13f3f35bf1f780526ad1d9d483226ce5ea34
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2688901
Commit-Queue: Peng Huang <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2021-02-12 21:16:30 +00:00
Alexey Knyazev 1094d324cb GL: Add allow_etc_formats workaround
Enable ETC2/EAC formats on newer Intel GPUs.

Bug: angleproject:1552
Change-Id: I240b07d6d81d48e1e03dfcd56aad6fa9f1d7817f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2690952
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Alexey Knyazev <[email protected]>
2021-02-12 18:41:07 +00:00
Jamie Madill a8a2a71b3a Vulkan: Support y-flip with no driver support.
We can reuse the surface rotation matrix code to do the y-flip.
This requires the SPIR-V transformation support. Because not
all rotations are encoded into the table we can only support
rotation with the driver support for y-flip (currently).

Includes some very minimal regression testing. This work is
targeted towards supporting vk-portability implementations
which are not as up-to-date with Vulkan features.

Bug: angleproject:5596
Change-Id: I270fa1efc03267551d28df33ddac9972e1343d60
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2665892
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Ian Elliott <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2021-02-10 17:03:45 +00:00
Kenneth Russell 572afd90bd Disable SH_SCALARIZE_VEC_AND_MAT_CONSTRUCTOR_ARGS workaround.
It causes incorrect compilation of some shaders. The original graphics
driver bugs that motivated enabling it have been fixed, at least on
one of the platforms (macOS).

Tested with new WebGL conformance test in
https://github.com/KhronosGroup/WebGL/pull/3214 .

Bug: chromium:1165751
Change-Id: Iee9747769ca918aab143592d6cf158ce02a75ee0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2661024
Commit-Queue: Kenneth Russell <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2021-02-02 01:08:29 +00:00
Shahbaz Youssefi ea71c6b634 Vulkan: Emulate R32F images with R32UI
GL requires that imageAtomicExchange be supported for r32f formats.
However VK_FORMAT_FEATURE_STORAGE_*_ATOMIC_BIT is nearly unsupported
everywhere without some Vulkan extension that brings in unnecessary
support.

This GL feature is emulated by transforming the shader to use r32ui for
all images that originally specified r32f.  floatToUintBits and
uintBitsToFloat is used to maintain correct usage of the image* builtin
functions.

Bug: angleproject:5535
Change-Id: Ie607089935d3283b3ffa054f4b4385b81fb8f53d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2635453
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2021-01-20 18:29:28 +00:00
Shahbaz Youssefi 60015ff672 Vulkan: Redo RewriteStructSamplers
This transformation is split into two.  The first transformation solely
takes out the samplers out of structs, and potentially generates array
of array of samplers.  A second transformation is added that takes any
array of array of opaque uniforms and flattens it.

A follow up change will simplify RewriteAtomicCounters which also
handles array of arrays (which is no longer possible), and removes
dependency on shaderStorageBufferArrayDynamicIndexing.

Bug: angleproject:2703
Bug: angleproject:3881
Bug: angleproject:4071
Bug: angleproject:4211
Change-Id: I352bb2bbe65ac49f4d7d753c0ba3160fa3cc925a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2628138
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2021-01-16 17:40:29 +00:00
Kenneth Russell 011e0ad186 Promote RGBA4444 and RGB565 to RGB[A]8 on macOS with AMD GPUs.
There are bugs in Apple's OpenGL driver when uploading to textures of
these formats via pixel buffer objects.

Because automatic graphics switching might activate the AMD GPU at any
time, use this workaround on dual-GPU MacBook Pros even if the Intel
GPU is active.

Fixes the following WebGL 2.0 conformance tests:

  deqp/functional/gles3/texturespecification/
    teximage2d_pbo_2d_00.html
    teximage2d_pbo_2d_01.html
    texsubimage2d_pbo_2d_00.html
    texsubimage2d_pbo_2d_01.html
    texsubimage2d_pbo_cube_01.html

Bug: angleproject:5469
Change-Id: I7d65dc5f664159b4b59d46400a8d9c492f67040b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2595245
Commit-Queue: Kenneth Russell <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-12-18 23:21:21 +00:00
Mohan Maiya da8c226140 Vulkan: Enable FramebufferVk cache on Apple
This effectively reverts ff60aba. The crash no longer
occurs on Apple.

Bug: angleproject:4442
Change-Id: I4aa745c80a482eb99311f3810e34124afe950cfe
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2588429
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Mohan Maiya <[email protected]>
2020-12-13 16:59:31 +00:00
Ian Elliott 968fccb200 Vulkan: Use VK_EXT_device_memory_report extension
This CL can enable and use the VK_EXT_device_memory_report extension.

This is disabled by default.  To enable, link with the required
extension, enable one or both of two features, AND build with the
following GN arg:

  angle_enable_trace = true

The two added  features are:

- logMemoryReportStats provides per-swap statistics
- logMemoryReportCallbacks provides per-callback logging

If either or both of the features are enabled, if the
VK_EXT_device_memory_report extension is available, it is enabled.

Bug: b/173636655
Change-Id: Ic5cf6c06efdb34f2313ef143853b3cc90f55faa5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2543506
Commit-Queue: Ian Elliott <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Courtney Goeltzenleuchter <[email protected]>
2020-12-03 00:18:38 +00:00
Anders Leino 4e913d3437 Vulkan: Work around Nvidia depth clamping bug
In GL ES, depth is always clamped to [0,1].
The same is true in Vulkan, but not for implementations affected by
Nvidia bug 3171019. This patch implements a workaround.
The workaround introduced test failures on Linux with Nvidia Quadro P400
and driver version 418.56, so it's only applied conditionally, and as a
result the test failure expectations are not removed completely.

Bug: angleproject:3970
Change-Id: I0d9f855d7f3df72fea4af9f9b134ae3177cf820d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2514377
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-11-26 15:17:47 +00:00
Shahbaz Youssefi 9041ca0c34 Limit testing of in-progress work to ANGLE's build of dEQP
A new feature is added, exposeNonConformantExtensionsAndVersions, which
is set by ANGLE's build of dEQP to allow exposing ES3.2 or extensions
that are not yet entirely conformant.  This would allow ANGLE to expose
WIP extensions for regression testing without affecting partners that
test ANGLE with dEQP's standalone build.

Bug: angleproject:3647
Change-Id: Id1e6219f26b41d3f8cdc9763131b8052227761c5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2552926
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Sunny Sun <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-11-24 15:26:32 +00:00
Shahbaz Youssefi 4e5a50b6ee Vulkan: Drop dependency to VK_EXT_shader_atomic_float
This VK extension exposes features that are not necessary for
GL_OES_shader_image_atomic.  Instead, support for necessary features for
VK_FORMAT_R32_SFLOAT is used to determine support for this GL extension.

Bug: angleproject:5342
Change-Id: Ia504cba69ffe51cfd7da69df28f58563cb1f0744
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2536908
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Mohan Maiya <[email protected]>
2020-11-20 07:06:02 +00:00
Charlie Lao 8930f18245 Vulkan: Add feature flag to fallback rotation to use driver uniform
It appears that older Qualcomm driver has some serious performance issue
with specialization constant. This does not happen with latest
development driver. This adds a feature flag to pick driver uniform path
for older driver.

Bug: b/173636783
Change-Id: Ia494fedbb1e0e69fbd8c44f8457c1bc30bc9fa4b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2547809
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Ian Elliott <[email protected]>
Commit-Queue: Charlie Lao <[email protected]>
2020-11-20 00:00:07 +00:00
Jamie Madill 49c132827b Vulkan: Merge async command queue features.
This merges the 'commandProcessor' and 'asyncCommandProcessing'
features into one new 'asyncCommandQueue' features.

Conceptually the command processor is asynchronous use of the
CommandQueue. This renaming updates the code to reflect the usage.

Bug: b/172704839
Change-Id: I1d7ca1187f802eed48823a01b57fb520527f2540
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2525144
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Courtney Goeltzenleuchter <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2020-11-13 01:54:18 +00:00
Jamie Madill ce7bdd0ba9 Vulkan: Merge CommandQueue and TaskProcessor.
Bug: b/172704839
Change-Id: I43a40e6a3e1eb00a7ddebfba6e915437aa69aeb6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2525141
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Courtney Goeltzenleuchter <[email protected]>
2020-11-13 01:50:08 +00:00
Jamie Madill 2e74c4526b Vulkan: Make feature names consistent.
This gives the features the exact same name as the member variable.
It fixes a bunch of inconsistencies between the variable name and the
external string identifier.

Ideally these could be auto-generated from JSON.

Bug: b/172704839
Change-Id: Id75c01db544672234435c3dd727c927027b9236d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2524541
Reviewed-by: Courtney Goeltzenleuchter <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2020-11-09 20:13:35 +00:00
Courtney Goeltzenleuchter 7616dfbd1c Vulkan: Allow Android properties to override features
Can enable/disable ANGLE feature via Android properties:
debug.angle.feature_overrides_enabled and
debug.angle.feature_overrides_disabled which take a string of ':'
separated feature strings.

Bug: b/170328907
Change-Id: I815b42c5cfae85a39f0f753eabd56e264ea38baf
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2514200
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-11-06 22:51:36 +00:00
Mohan Maiya 23d1f9b43b Vulkan: Add support for VK_KHR_image_format_list extension
GLES sRGB extensions allows for a texture to be respecified, with say
the sRGB_override extension, which will require us to reinterpret the
data in the texture in sRGB colorspace (or linear depending on the
format of the texture).

If the underlying ICD supports VK_KHR_image_format_list extension we
create a texture's backing VkImage with the
VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT enabled since we already know the
format we might need to reinterpret the texture as.

Bug: angleproject:3609
Bug: angleproject:4561
Bug: angleproject:5281
Change-Id: Ia4bed596ed3000f8af1a8fd73fb8e6c2cb9b5d6e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2513110
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2020-11-04 15:33:15 +00:00
Le Hoang Quyen 9ff063e9c0 Metal: fix max varyings, copyImage between mips, depth fmt
- GLSLTest_ES3.MaxVaryingWithFeedbackAndGLline failed before because
  gl_Position takes up one slot from max varyings on Metal back-end.
  FIXED

- Previously, copyImage() between mips of the same texture would fail.
  Due to the read RenderTargetMtl is released before the copy happens.
  FIXED

- GL_DEPTH_COMPONENT24 texture data upload didn't work due to the source
  32 bit depth data wasn't handled properly.  FIXED

- D24S8 format will be disabled on AMD for now, it will be converted to
  D32S8 instead.

Bug: angleproject:2634
Bug: angleproject:5235
Bug: angleproject:5242
Change-Id: Ie7082f0545c0885ce5ec72df8a7ec4ee5d5de4b1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2494525
Commit-Queue: Le Hoang Quyen <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-11-04 12:27:56 +00:00
Le Hoang Quyen cb6176f3a8 Metal: Support tri-fan & line-loop with primitive restart
Triangle fan:
- If primitive restart is NOT enabled and there is no active render
  pass, use Compute Shader to generate indices.
- If primitive restart is enabled, use CPU to generate indices.

Line loop:
- If draw non-instanced without primitive restart, generate and
  draw only one additional last segment (fastest).
- If draw instanced, primitive restart is NOT enabled, and there is no
  active render pass, use Compute Shader to generate indices (OK).
- Otherwise, use CPU to generate indices (slowest).

Also Disable OcclusionQueriesTest.ClearNotCounted failure on NVIDIA.

Bug: angleproject:2634
Bug: angleproject:5307
Change-Id: Ia5529825807a964f5fcb2a4af8844778896cd42a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2435859
Commit-Queue: Le Hoang Quyen <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2020-11-04 10:13:16 +00:00
Xinghua Cao dc1c1cb562 Restrict to translate uniform block to StructuredBuffer
We had translated an uniform block only containing a large array member
into StructuredBuffer instead of cbuffer on D3D backend for slow fxc
compile performance issue with dynamic uniform indexing.
Now we add more conditions to restrict the translation. Only indexing
operator is allowed to operate on this uniform block variable. And we
also restrict the types of uniform block's member.

Bug: angleproject:3682
Change-Id: I992b7890d84fcaa6169722af6d7e14785526d48a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2351728
Commit-Queue: Xinghua Cao <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Jiajia Qin <[email protected]>
2020-11-04 03:52:43 +00:00
Geoff Lang a51b57fa2d Revert "Vulkan: Add features to modify sampling parameters"
Bug: b/167404532
Change-Id: Iae19dfe165074e8c01216312bddd744c4fb504a4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2510012
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-11-04 00:50:43 +00:00
Courtney Goeltzenleuchter 6bc362c415 Allow single threaded CommandProcessor
In replacing the legacy CommandQueue code with the threading
capable CommandProcessor it would be good to be able to run the
CommandProcessor in a single-thread environment. This CL changes the
meaning of the feature flags for the commandProcessor and
asynchronousCommandProcessing so that enabling commandProcess only
changes the code paths to use the command processor but work it still
done as part of the submitting thread (e.g. ContextVk).
Enabling asynchronousCommandProcessing will cause a separate worker
thread to be spawned which will asynchronously process the commands.
This allows us to switch to the CommandProcessor without threading and
then enable threading once performance issues are resolved.

Bug: b/161912801
Bug: b/170329600
Change-Id: I534862b109a7e7708108190b7c3e894071d4c2ed
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2483580
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Commit-Queue: Courtney Goeltzenleuchter <[email protected]>
2020-11-03 03:23:42 +00:00
Le Hoang Quyen 8a50b42b01 Metal: Convert index & vertex format on GPU when possible.
- When converting vertex buffer:
  - if there is no render pass active, use compute shader to convert.
  - if there is a render pass active and device supports explicit memory
    barrier then convert the buffer in vertex shader with direct buffer
    write and insert a memory barrier.
  - if there is a render pass active and device doesn't support explicit
    memory barrier then convert the buffer on CPU.

Bug: angleproject:2634
Change-Id: I5346e3a2adb855f40e46a3912d9db404a4482e0f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2434025
Commit-Queue: Le Hoang Quyen <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
2020-10-31 22:03:13 +00:00
Geoff Lang 8ace36f8c1 Revert "Add a Vulkan feature to compress float32 vertex formats."
Bug: b/167404532
Bug: b/161716126
Change-Id: I95157a006d5c1fd2d3c0c2c2be37fa0403c07f93
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2510011
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2020-10-30 15:14:37 +00:00
Mohan Maiya e895ced6d4 Vulkan: Add OES_shader_image_atomic support
Add support for shader builtins and enable the extension.

Bug: angleproject:3578
Tests: dEQP-GLES31.functional.*image_atomic*
Change-Id: Idd45b2ee62efe1474c6c5947c77da64ff2221bf6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2505540
Commit-Queue: Mohan Maiya <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2020-10-29 20:43:25 +00:00
Geoff Lang f02a6e0c7f Work around Mac glGenerateMipmap with missing levels bug.
Some Mac GL drivers fail to generate mipmaps if level zero is not set
before the texture is first used, all mipmap data is black.

To work around this, whenever a texture level is allocated, ensure that
level zero is also allocated with at least a 1x1 image.

Bug: angleproject:5223
Change-Id: If1a728e017dec600c77a54f7ae185b719aaaae84
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2497569
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2020-10-28 21:18:54 +00:00