Commit Graph
913 Commits
Author SHA1 Message Date
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
Amirali Abdolrashidi 3b988fef30 Vulkan: Remove enableLineRasterEmulation
* Removed the Bresenham line raster emulation specialization
constant, along with related variables and functions.

Bug: angleproject:7366
Change-Id: If17c8ce9b459ad801bae8e887e5674bd9a3ff2bf
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3680860
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
2022-06-07 16:21:28 +00:00
Shahbaz Youssefi ce3c0fe901 Vulkan: Make depth-correction uniform controlled
This change makes sure SPIR-V transformations are not required for depth
correction, having the number of potential pipelines.

Bug: angleproject:5881
Change-Id: If3f66b34bdd1127ae588cbc822ea7cf01fa8621f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3691801
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
2022-06-07 03:13:47 +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 23f213d136 Vulkan: Make drawable size uniform
As a specialization constant, it's impossible to predict the value the
drawable size may take, which in turn makes it impossible to warm up the
Vulkan pipeline cache at link time.

Bug: angleproject:7366
Change-Id: Ia3d1860a4fcb8e3078fdcb8d02a2e0cd173ea028
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3671976
Reviewed-by: Charlie Lao <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-05-30 15:12:52 +00:00
Shahbaz Youssefi 2df17a1273 Vulkan: Pack driver uniforms
Previously 5 vec4s were used for driver uniforms + 2 vec4s if
specialization constants couldn't be supported.

The driver uniforms are rearranged and packed such that only 2 vec4s are
normally used, which include fallback for specialization constants as
well.  In the future, most of the specialization constants may turn into
uniforms, and this change prepares for that.

Additional uniforms are used (3 vec4s) only if common extensions are
missing; transform feedback and bresenham lines.

This change makes it more practical for driver uniforms to be turned
into push constants.  Additionally, these uniforms could potentially be
loaded and cached at the beginning of the shader for more efficient
memory access.

On Pixel6, with this change, the traces show no difference in wall time.
On most traces, CPU time shows up to ~7% improvement.

Bug: angleproject:7366
Change-Id: I0f47f863955af06a19c69d1f1d7c45b97d95476e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3668151
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
2022-05-27 17:32:30 +00:00
Shahbaz Youssefi 98c2e169c1 Vulkan: Reduce pre-rotation spec const to bool
The specialization constant now only dictates whether x and y should be
swapped.  The complete 8 possible states of rotation and y-flip are
achieved by using this swap in combination with a driver uniform for x
and y flip.

Swapping is still a specialization constant to avoid degrading
performance of dFdx/dFdy which otherwise would need both to be evaluated
instead of one.  On platforms which don't support pre-rotation, the
specialization constant will never change and driver uniforms entirely
govern y-flip.  On platforms that do support pre-rotation, only two
variations of the pipeline are needed.

Bug: angleproject:7366
Change-Id: I73f84e89fa9349d2098fa5b21573aee57d93a30c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3663151
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Lingfeng Yang <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
2022-05-27 17:15:50 +00:00
Amirali Abdolrashidi fea195678e Vulkan: Remove removeEarlyFragmentTestsOpt flag
* Removed removeEarlyFragmentTestsOptimization and the related
SPIRV transformation and variables.
* Removed mUsesEarlyFragmentTestsOptimization.
* Removed SH_EARLY_FRAGMENT_TESTS_OPTIMIZATION.
* Merged updateUsesEarlyFragmentTestsOptimization() into
updateFragmentInoutRange().

Bug: angleproject:7347
Change-Id: I7299bd4e8ab5363e5cf06eb48419d4f469106e12
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3648217
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Amirali Abdolrashidi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
2022-05-25 18:42:58 +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
Yiwei Zhang e316203a6a Vulkan: add forceContinuousRefreshOnSharedPresent feature
Android EGL wrapper filters EGL_FRONT_BUFFER_AUTO_REFRESH_ANDROID,
making it impossible for angle to provide an implementation for
EGL_ANDROID_front_buffer_auto_refresh. Thus angle currently is only
able to choose demand refresh for swapcahin present mode. This change
adds a feature to force angle to create the swapchain with continuous
refresh mode without affecting angle internal tracking for shared
present.

This feature will be enabled on integrations without the auto_refresh
hint passthrough to angle, as well as before the platform allows angle
to implement EGL_ANDROID_front_buffer_auto_refresh on its own.

Bug: b/229267970
Test: angle_end2end_tests --gtest_filter="EGLSingleBufferTest*"
Test: smooth draw with gpu accelerated low latency stylus in ChromeOS
Change-Id: I29d72830d4e3d9fd5cdd44b8e1ce51fd7d9789fa
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3633358
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-05-08 01:16:32 +00:00
Amirali Abdolrashidi 38a53d654c Revert "Remove limit_max_texture_size_to_4096 workaround"
This reverts commit bcc03bd622.

Reason for revert: ANGLE autoroller fails on some Pixel 4 web conformance tests.

Original change's description:
> Remove limit_max_texture_size_to_4096 workaround
>
> Chromium will apply workaround to gpu command buffer clients only. So
> removing it from angle which is no longer needed.
>
> See crbug.com/1319451 and in particular crrev.com/c/3626252
>
> Bug: chromium:1319451
> Change-Id: I723e525600aa7b93e784c98348e060a503c09657
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3618501
> Reviewed-by: Geoff Lang <[email protected]>
> Reviewed-by: Lingfeng Yang <[email protected]>
> Reviewed-by: Vasiliy Telezhnikov <[email protected]>
> Commit-Queue: Shahbaz Youssefi <[email protected]>

Bug: chromium:1319451
Change-Id: I0db424e97ebb0f9141076b409667aa49faeb2ec4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3630919
Bot-Commit: Rubber Stamper <[email protected]>
Commit-Queue: Amirali Abdolrashidi <[email protected]>
2022-05-06 18:10:51 +00:00
Bo Liu bcc03bd622 Remove limit_max_texture_size_to_4096 workaround
Chromium will apply workaround to gpu command buffer clients only. So
removing it from angle which is no longer needed.

See crbug.com/1319451 and in particular crrev.com/c/3626252

Bug: chromium:1319451
Change-Id: I723e525600aa7b93e784c98348e060a503c09657
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3618501
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Lingfeng Yang <[email protected]>
Reviewed-by: Vasiliy Telezhnikov <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-05-05 19:12:31 +00:00
Shahbaz Youssefi 5113ae8ef0 Vulkan: Explicitly enable per-sample shading if sample used
The Vulkan spec is not explicit about the `Sample` decoration implicitly
enabling per-sample shading.  While this is being corrected in the spec,
the ARM Vulkan driver does not have this implicit behavior.

A workaround is added such that the usage of the `sample` qualifier is
reported, and used to explicitly enable per-sample shading through the
API.

Bug: angleproject:6876
Change-Id: Idb8345aacdcfa45cb37fefcd30aa5405168d21e3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3615738
Reviewed-by: Charlie Lao <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2022-05-03 03:37:33 +00:00
Alexey Knyazev f7615d0ade OpenGL: Add allow_astc_formats workaround
Enable ASTC on Mesa only for supported hardware

Bug: angleproject:7259
Change-Id: I872ebdead1206ee911c5e0f0f10b6985022dbe47
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3621055
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Alexey Knyazev <[email protected]>
2022-05-02 18:47:55 +00:00
Shahbaz Youssefi 4dc4c0f051 Remove whitespace from features json files
Bug: angleproject:6435
Change-Id: I7f653a9836180d0f2e0198302e11ae2b0ca49d3b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3621315
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-05-02 16:56:22 +00:00
Alexey Knyazev 454efd1d54 Add forceDepthAttachmentInitOnClear frontend workaround
AMD on D3D11 skips depth buffer updates in some cases.

Bug: angleproject:7246
Bug: angleproject:7200
Change-Id: I27bbea30fbf4173470063a670b9c43a805286c39
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3608092
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Alexey Knyazev <[email protected]>
2022-04-27 22:29:57 +00:00
Shahbaz Youssefi 3b65b80379 Vulkan: Work around Qualcomm imprecision with dithering
On qualcomm, sometimes the output is ceil()ed instead of round()ed.
With ditering emulation affecting values, some dEQP tests fail due to
the excessive change in value when dithering bumps the value slightly
over to the next quantum.

In this change, a workaround is added to round() the value before
outputting it.

Bug: angleproject:6953
Change-Id: Iae7df5ca20055b4db3185c6153f3c0bf4ba07f68
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3611064
Reviewed-by: Yiwei Zhang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-04-27 19:47:13 +00:00
Gregg Tavares 1a144edfeb Metal:ReadPixels AMD Copy Texture to Buffer optimization
On AMD GPUs it's faster to copy a texture to a buffer
for read back than to read via a texture.

For reading from a normal texture 24-27ms -> 6-9ms
For reading from a IOSurface texture 17-20ms -> 7-10ms

Bug: angleproject:7117
Change-Id: I7c7f276a3121e87f5c52a1a4287d13203a6b1b37
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3584423
Reviewed-by: Kenneth Russell <[email protected]>
Reviewed-by: Kyle Piddington <[email protected]>
Commit-Queue: Gregg Tavares <[email protected]>
2022-04-26 19:23:16 +00:00
Mohan Maiya ea76cb0f5e Vulkan: Add entry points for GL_QCOM_shading_rate
Bug: angleproject:7172
Change-Id: I837d2697d95c44f47a2fab7411cfd87a4ec65e90
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3599873
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: mohan maiya <[email protected]>
2022-04-25 18:24:55 +00:00
Shahbaz Youssefi 400d9fe43c Rename feature files to *_autogen.h
To clarify further that they are not to be edited by hand.

Bug: angleproject:6435
Change-Id: Iaf79706d2b688a43b3ebb65700cfbdd71a49a742
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3603842
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-04-25 15:32:55 +00:00
Charlie Lao 3b38b37907 Vulkan: Add feature avoid HOST_VISIBLE and DEVICE_LOCAL combination
Discrete GPUs device local memory usually is not CPU accessible. This
adds a feature flag to control that.

Fixed bug in BufferVk that when mapRangeImpl is called from angle
internal, unmapImpl was using front end mapping parameters that is
incorrect. We have to cache the mapping parameters in the backend to
hangle the mapRangeImpl/unmapImpl calls from internal.

Fixed the test bug in ComputeShaderTest.BufferImageBufferMapWrite that
we are calling glMapBufferRange with GL_MAP_READ_BIT but are actually
writing to the map pointer. This should result in undefined behavior per
spec.

Fixed the test bug in GLSLTest.* that VerifyBuffer calls
glMapBufferRange, but was giving incorrect length which result in data
only been partially copied. This bug was hidden due to previously all
buffers are CPU accessible and there is no copy needed.

Fixed the test bug in ReadPixelsPBOTest.* and ReadPixelsPBONVTest.* that
calls glMapBufferRangeEXT, but was giving incorrect length which result
in data only been partially copied. This bug was hidden due to
previously all buffers are CPU accessible and there is no copy needed.

Added new skipped syncval messages. Because this CL triggers a
copyToBuffer call for some of the buffers and that changes the syncval
message signature for the same reasons (i.e, feedback loop or synval
does not know the exact range of buffer been used for vertex buffers
etc).

Bug: angleproject:7047
Change-Id: I28c96ae0f23db8e5b51af8259e5b97e12e8b91f2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3597711
Reviewed-by: Yuxin Hu <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Charlie Lao <[email protected]>
2022-04-22 16:20:31 +00:00
Shahbaz Youssefi fcec69045d Generate feature variable names from display names
The json file now only contains the feature display name.  The variable
name is automaticaly derived.

For consistence with Chromium and other Chromium-based projects, the
display name is now always snake_case, and that's what's specified in
the json files.  This also makes camelCase variable name generation
trivial (as opposed to the other way around).

Feature overrides now accept both snake_case and camelCase names to
ensure compatibility with existing scripts.  This is done by removing _
and comparing override names with feature names in lower case.

Bug: angleproject:6435
Change-Id: I0b6ed2bbf5c312bc4f4be7b3c7d55dbaca2a9886
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3584630
Reviewed-by: Amirali Abdolrashidi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-04-20 05:05:22 +00:00
Gregg Tavares 8718783526 Metal: For readPixels copy IOSurface to non-IOSurface texture
For intel GPU/Drivers, it's faster to copy an IOSurface texture
to a non-IOSurface texture and read from the copy than it is
to read directly from the IOSurface texture.

Bug: angleproject:7117
Change-Id: I786009444480f75be6feb05f09f87fb45a3186b1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3573078
Reviewed-by: Kenneth Russell <[email protected]>
Reviewed-by: Kyle Piddington <[email protected]>
Commit-Queue: Gregg Tavares <[email protected]>
2022-04-14 03:16:10 +00:00
Shahbaz Youssefi c5271e8e69 Vulkan: Emulate GL_KHR_blend_equation_advanced
Based on a change by Brandon Schade <[email protected]>

In the translator, when advanced blend is enabled, an input attachment
is added.  Based on the listed advanced blend equations, emulation code
is added that performs those equations' functions.  The blend equation
itself is passed through a driver uniform.

Note that the advanced blend extension only allows a single output to
use advanced blend, and that should be at location 0.

In the Vulkan backend, when advanced blend is used, the driver uniform
to select the equation is updated and normal blending is disabled.

Bug: angleproject:3586
Change-Id: Icc42e8be238d34fca149087eb9cfe616a7643a6b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3575738
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Yuxin Hu <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-04-13 19:02:22 +00:00
Shahbaz Youssefi 8074061d24 Remove feature override platform methods
Instead, the tests now use the enable() functions to override the
feature at platform level.

This fixes the forceFallbackFormat feature mistakenly not having been
tested.

Bug: angleproject:6435
Change-Id: I605e4133407282bd52232887b595af0d2c13575d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3577369
Reviewed-by: Yuly Novikov <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-04-13 04:25:59 +00:00
Shahbaz Youssefi 797e627e64 Autogenerate list of features as enum
The WithX() and WithNoX() helpers are removed and replaced with enable()
and disable() member functions that take the name of the feature (as a
Feature::X enum constant).  This has two benefits:

- Adding tests that override a feature no longer requires additional
  helper functions to be written.
- There's no mistaking the feature name.

This change doesn't yet fix the main issue in anglebug.com/6435, but
does fix the following helpers using an old feature name (so they were
ineffective):

- WithMetalForcedBufferGPUStorage
- WithNoVulkanViewportFlip

A follow up would remove the old way of overriding features in tests and
replaces them with the new way.

Bug: angleproject:6435
Change-Id: Ida02b26ec72bc40d7a8938c76a93815bb903ca05
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3580982
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-04-12 03:42:40 +00:00
Shahbaz Youssefi eeb3965353 Autogenerate features
Features are now specified in a json file and autogenerated.  This is in
preparation for more autogeneration to support feature override in
tests.

This change doesn't yet fix the issues in anglebug.com/6435 and should
be a no-op.

Bug: angleproject:6435
Change-Id: Icdb63a94dc37b5fef0a356e0fc0b49937e083c8a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3579941
Reviewed-by: Yuly Novikov <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-04-12 03:20:38 +00:00
Nathan Zabriskie 9d486a85e8 GL: Unbind textures from FBO after calls to frameBufferTexture2D
OOPR canvas uncovered an Nvidia driver bug in which binding a texture
level > 0 to a framebuffer and then later binding a renderbuffer to
the same FBO causes the FBO to be marked as having an incomplete
attachment. This CL expands UnbindResources() in BlitGL.cpp to unbind
textures in addition to RBOs and adds new calls to unbind in functions
that call framebufferTexture2D.

Also adds a GL workaround--alwaysUnbindFramebufferTexture2D--
that forces FramebufferGL to first unbind any existing attachments
using framebufferTexture2D before attaching a new render buffer.

Bug: angleproject:5536
Change-Id: I46c115b3895f8fccb251dbf4531d5c1bd4705ebc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3527465
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Vasiliy Telezhnikov <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Commit-Queue: Jonah Ryan-Davis <[email protected]>
2022-04-06 20:42:44 +00:00
Geoff Lang be53aea817 Reland: Emulate RGB10 (no alpha) on desktop OpenGL.
The OpenGL ES extension GL_EXT_texture_type_2_10_10_10_REV
requires RGB and RGBA formats to be supported but Desktop OpenGL
does not support RGB. Emulate it with the existing
emulatedAlphaChannel path in TextureGL.

Bug: chromium:1300575
Change-Id: I5efea52d3da628cf82b43fece23894e6f47df650
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3533141
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2022-03-29 14:50:53 +00:00
Shahbaz Youssefi 20e7bbb7ab Vulkan: Fix invalidate of attachments with emulated format
Some image formats may be emulated such that the emulated format has
more channels than the original.  ANGLE clears the image once so that
these extra channels contain valid values, and carefully ensures they
are never modified.

For swapchain images with such formats, as they are automatically
invalidated at the end of the frame, a workaroud was added to make sure
they are re-cleared in the beginning of the next frame.  This however
doesn't fix the issue of glInvalidateFramebuffer resulting in the
contents of attachments with such formats to be discarded (even if the
following render pass clears it, the contents are invalid in between).

This change instead makes sure invalidate of images with emulated
formats that have extra channels are handled appropriately:

- On IMR hardware, the invalidate is dropped altogether as it provides
  little to no benefit.
- On TBR hardware, a clear is automatically staged on the invalidated
  image.

The latter replaces the workaround that was added to make the following
render pass use loadOp=CLEAR, by adding a clear that's respected
regardless of what the future usage is.

This change also paves the way for a future change where the invalidate
of color attachments is tracked in render passes similarly to how
depth/stencil currently is.  With this change, the image is no longer in
an inconsistent state where its contents are considered invalid, even
though some channels are meant to remain valid.

Bug: angleproject:6860
Change-Id: Iec5b4854dfbe3a0bf93cd5aa82c19fe116065744
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3536389
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-03-22 19:28:14 +00:00
Kimmo Kinnunen 9637185c3d Add ForceGPUSwitch to EGL_ANGLE_power_preference
eglHandleGPUSwitch() does not work with WebKit sandbox profile.
The root cause is that we do not know the
primary display, and as such we do not know which GPU drives this.

Add eglForceGPUSwitchANGLE(display, gpuIDHigh, gpuIDLow).
This lets the caller figure out the GPU in another process. Then
the caller can just set the GPU in the sandboxed process.

Add tests that are disabled by default until the runner and the
infrastructure supports running the tests with automatic switching
enabled.

Bug: angleproject:7092
Change-Id: I316ee431156596effbdb89659a5e24291719a204
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3516274
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Kenneth Russell <[email protected]>
2022-03-19 01:15:06 +00:00
Geoff Lang 44e84661a4 Revert "Emulate RGB10 (no alpha) on desktop OpenGL."
This reverts commit 6404be2def.

Reason for revert: Extension was not fully enabled due to test bug.

Original change's description:
> Emulate RGB10 (no alpha) on desktop OpenGL.
>
> The OpenGL ES extension GL_EXT_texture_type_2_10_10_10_REV
> requires RGB and RGBA formats to be supported but Desktop OpenGL
> does not support RGB. Emulate it with the existing
> emulatedAlphaChannel path in TextureGL.
>
> Bug: chromium:1300575
> Change-Id: I0e6d1044afbc55cf6d4f987cc98b357ff11ff006
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3517346
> Reviewed-by: Jonah Ryan-Davis <[email protected]>
> Reviewed-by: Jamie Madill <[email protected]>
> Commit-Queue: Geoff Lang <[email protected]>

Bug: chromium:1300575
Change-Id: Ib3810a18888544f1700a1f648a5094c19973d86d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3533139
Reviewed-by: Geoff Lang <[email protected]>
Bot-Commit: Rubber Stamper <[email protected]>
2022-03-17 17:18:39 +00:00
Shahbaz Youssefi 98bb4f32de Vulkan: Implement advanced blend through extension
This change exposes GL_KHR_blend_equation_advanced if
VK_EXT_blend_operation_advanced is supported.  No emulation is yet
implemented.

Bug: angleproject:3586
Change-Id: Ie7a442c22e028e3aa45ccef52db320e205664d49
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3487951
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-03-17 03:54:21 +00:00
Geoff Lang 6404be2def Emulate RGB10 (no alpha) on desktop OpenGL.
The OpenGL ES extension GL_EXT_texture_type_2_10_10_10_REV
requires RGB and RGBA formats to be supported but Desktop OpenGL
does not support RGB. Emulate it with the existing
emulatedAlphaChannel path in TextureGL.

Bug: chromium:1300575
Change-Id: I0e6d1044afbc55cf6d4f987cc98b357ff11ff006
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3517346
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2022-03-10 20:11:36 +00:00
Gregg Tavares 2e7cfa9b1f Metal: Fix WebGL CTS fbomultisample tests failing in Metal
These tests were failing in Metal:
deqp/functional/gles3/fbomultisample.2_samples.html
deqp/functional/gles3/fbomultisample.4_samples.html
deqp/functional/gles3/fbomultisample.8_samples.html

This CL only fixed the tests failing on AMD. Intel still fails.
See: https://anglebug.com/7079

Bug: angleproject:7049
Change-Id: I745672bba2e9b8b1d34c7a81e07410889eddd35f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3482157
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Gregg Tavares <[email protected]>
2022-03-07 08:36:03 +00:00
Mohan Maiya f9ade9fb4a Vulkan: Add feature to create pipeline during glLinkProgram
Creating the pipeline will trigger the compilation of shaders to byte
code thus warming up Vulkan shader caches. Typically most apps call into
glLinkPrograms during app loadtime and the goal is to improve cache hit
rate and reduce CPU workload during game play.

Bug: angleproject:7046
Test: ProgramBinary*CreatePipelineDuringLink*
Change-Id: I71351d45a9aa84e220ca38503735e94cff1dcf98
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3478354
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: mohan maiya <[email protected]>
2022-03-04 21:52:41 +00:00
Jeff Vigil 51967b4fcf Vulkan: Fix enabling external fences and semaphores
These capabilities are Instance extensions
need fixed to enable Native fences for Android

Bug: angleproject:7009
Change-Id: I9f07dc88cabd52712ebde28ba938662d7773c8b5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3457743
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: mohan maiya <[email protected]>
2022-03-02 01:03:58 +00:00
Ian Elliott 5e87ae0a7d Use VK_ANDROID_surfaceless_query for EGLConfig formats
That extension allows DisplayVkAndroid::generateConfigs() to query the
swapchain formats (but not yet colorspaces) before ANGLE is given any
VkSurfaceKHR.  This is used for creating EGLConfig's with GL_RGB10_A2
and GL_RGBA16F.

Bug: b/203826952
Change-Id: I55302c98641fbce93f7af428087430763676bdb4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3492482
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Trevor David Black <[email protected]>
Commit-Queue: Ian Elliott <[email protected]>
2022-03-01 20:29:21 +00:00
Shahbaz Youssefi 1e773db907 Vulkan: Shader support for KHR_blend_equation_advanced
Translator can accept the layout qualifiers for the advanced blend
equation.  No emulation code is currently generated, and ANGLE will
initially rely on the corresponding Vulkan extension.

Based on change by Brandon Schade <[email protected]>

Bug: angleproject:3586
Test: angle_unittests --gtest_filter=*KHRBlendEquationAdvanced*
Change-Id: I3b728c5f144386d7030bbbb301ddb07daa1492b9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3481309
Reviewed-by: Brandon Schade <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-02-23 20:16:50 +00:00
Mohan Maiya 671fcf732d Vulkan: Add a feature to retain SPIR-V debug info
Add a feature to retain debug info in SPIR-V blob. It is enabled
when validation layers are enabled.

Bug: angleproject:5901
Change-Id: Iccdff31ae0f12fc95d59d20e43e94b6f3d1ae00e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2850388
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: mohan maiya <[email protected]>
2022-02-17 17:22:02 +00:00
Shahbaz Youssefi d285d6a729 Vulkan: Use VK_EXT_depth_clip_control
Bug: angleproject:6679
Change-Id: Iea3b7a2d8db630dcea19836732de8f9e0a7a568f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3298356
Reviewed-by: mohan maiya <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-02-11 18:19:49 +00:00
Alexey Knyazev a3c785fc10 GL: Remove avoid_dxt1_srgb_texture_format feature
The workaround was removed in https://crrev.com/c/2627425

Bug: angleproject:5543
Change-Id: Idf3d3c47b035e0cc505b5b54fcc3ab608d6838b9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3455786
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2022-02-11 15:33:50 +00:00
Charlie Lao 419bca3f51 Vulkan: Use Vulkan API directly for BufferPool's buffer allocation
There are two motivations in this CL. 1) There are two layers of
suballocator right now. BufferPool provides first suballocation. It
tries to allocate from one of the buffers in the pool. If that failed,
it try to create a new BufferBlock (i.e, a VkBuffer). Right now that
calls into VMA which creates another pool to allocate a buffer. We
really only need one layer of suballocation. And 2) Because we uses VMA
to do actual VkBuffer allocation, we have to use Allocator object. But
VMA can not handle external buffers, so we end up having a BufferMemory
class just to handle two different cases. This CL attempts to clean up
this by let ANGLE calling into vulkan driver directly for the actual
buffer allocation, just like we did for VkImages. By doing so, we able
to remove BufferHelper::mMemory data member as well as BufferMemory
class all together. External memory is now treated exactly the same at
BufferHelper.

Bug: b/205337962
Change-Id: I7c183ab0fd7d9aceb6cf416b0214c300798bc010
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3402740
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Charlie Lao <[email protected]>
2022-02-10 20:24:40 +00:00