Граф коммитов

555 Коммитов

Автор SHA1 Сообщение Дата
Eddie Hatfield 916a35dd0a Merge getTempPath and CreateTemporaryFile
Also includes moving these two (and some helpers) to
common/system_utils.h

Bug: angleproject:5095
Change-Id: I7d2fcbd27a67dc13215265ac5b5e8391b15a980b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3733519
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Eddie Hatfield <eddiehatfield@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2022-07-06 19:57:02 +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 <cclao@google.com>
Commit-Queue: mohan maiya <m.maiya@samsung.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2022-07-05 19:12:13 +00:00
Geoff Lang 785353fd35 Support Desktop OpenGL context creation in end2end tests
Validation of Desktop GL versions and profile masks is unimplemented.

Bug: angleproject:7360
Change-Id: Ifae94215b6aada895c2b02318a1d05c9515e9b96
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3664916
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2022-06-29 21:25:15 +00:00
Gert Wollny fd9301c1d8 Capture/Replay: Capture egl surface related calls
Creation from a pbuffer and generalized destruction are
implemented, as well as binding and releasing a TexImage
and making the context current with explicit draw and
read surfaces given.

Bug: angleproject:4964
Bug: angleproject:6180
Bug: angleproject:6512
Change-Id: Id8be6486125d45341905f3aabdbae4366cd568b7
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3711741
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2022-06-29 15:07:05 +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 jmadill@chromium.org

Bug: angleproject:7375
Change-Id: Ib6c73e95d06229f8545d502b388ee2a55a582323
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3697308
Reviewed-by: Charlie Lao <cclao@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2022-06-24 04:08:17 +00:00
Jamie Madill ca96cba9c5 Make ReadEntireFileToString return a std::string.
Note: this makes the method unavailable for export from angle_util,
which is probably why it was designed the way it was in the first
place. However, we import the test utils source file as a static
lib into each test executable and test shared module, so it works.

Bug: angleproject:7404
Change-Id: Ia957268882c2b8529643660d7d4f34d142c0dc43
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3708602
Commit-Queue: Roman Lavrov <romanl@google.com>
Reviewed-by: Roman Lavrov <romanl@google.com>
2022-06-17 14:22:15 +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 <jmadill@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2022-06-16 19:20:36 +00:00
Roman Lavrov 153d8db9de Turn missing {trace_name}.json trace files into test failures.
Before this change, a missing or broken trace json file results in all
trace tests "disappear" from the list with only ERR in logs. After this
change, a missing or broken trace json will result in that specific test
FAIL status and error in logs.

Note that this also allows for inconsistency between
restricted_traces.json and trace json files on the device because we're
no longer requiring for trace json to be loaded unless the test is
actually being run.

Bug: angleproject:7410
Change-Id: I07532dc0bf85a0d2fcaf425ce8d4a589473a898d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3690734
Commit-Queue: Roman Lavrov <romanl@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2022-06-15 17:52:05 +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 <ianelliott@google.com>
Auto-Submit: Ian Elliott <ianelliott@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
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 <cclao@google.com>
Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Reviewed-by: Ian Elliott <ianelliott@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
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 <jmadill@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2022-06-08 03:45:11 +00:00
Faye Zhang 06ff0e3cb0 Implement GL_EXT_base_instance
Added new extension GL_EXT_base_instance to registry_xml.py
and auto-generated the entry point function calls for the
following functions introduced by the extension:
* GL_DrawElementsInstancedBaseVertexBaseInstanceEXT
* GL_DrawElementsInstancedBaseInstanceEXT
* GL_DrawArraysInstancedBaseInstanceEXT

Bug: angleproject:6983
Change-Id: I36167faf3ca98e42acf787dbf09ee7052e15e358
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3691952
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Commit-Queue: Faye Zhang <ffz@google.com>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
2022-06-07 23:58:38 +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 <penghuang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2022-06-07 17:49:48 +00:00
Rohit Rao 4b911686c6 Converts from sprintf() to snprintf().
sprintf() is deprecated in Xcode 14, so update to safer equivalents in
order to keep the compiler happy on iOS and macOS.

Bug: chromium:1331345
Change-Id: Id5348088bf69cbd360d9251e6323596cb710666d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3690747
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2022-06-07 12:38:38 +00:00
Lubosz Sarnecki ebdbae9b7a crash_handler_posix: Fix symbol path resolution.
Use POSIX realpath function to resolve absolute paths of modules.
Fix incorrect path resolution for libVkLayer_khronos_validation.so,
which is given a relative path from the executable directory instead of
cwd.
Leave the treatment of overlapping paths in place, which is only
required if a backtrace is triggered during the runtime of
ScopedVkLoaderEnvironment.

Remove symlink resolution, as it is done by using realpath.
Print warning if symbol path cannot be resolved.

This fixes the following error:
/usr/bin/addr2line: '/home/user/angle/angle/angledata/../
libVkLayer_khronos_validation.so': No such file

Bug: angleproject:7311
Change-Id: I46f4af93a4a27d8d09c3786933dbbb8390aa34eb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3644584
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2022-06-03 08:19:34 +00:00
Lubosz Sarnecki cdad936363 crash_handler_posix: Use execvp.
To avoid using an absolute path for the addr2line executable, use execvp
instead of execv to make the shell search for the executable in the
PATH.

Bug: angleproject:7310
Change-Id: I777e5f369011d910afffe86f8fb2372dc333a665
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3644582
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
2022-06-03 07:34:26 +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 <cclao@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
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 <jmadill@chromium.org>
Reviewed-by: Trevor Black <vantablack@google.com>
Reviewed-by: mohan maiya <m.maiya@samsung.com>
Commit-Queue: Brandon Schade <b.schade@samsung.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
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 <kbr@chromium.org>
Commit-Queue: Gregg Tavares <gman@chromium.org>
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 <kbr@chromium.org>
Commit-Queue: Gregg Tavares <gman@chromium.org>
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 <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
2022-06-01 20:54:23 +00:00
Shahbaz Youssefi b0d75fb5c1 Vulkan: Use 64-bit counters
Some upcoming counters don't fit in 32 bits.

Bug: angleproject:5881
Change-Id: I2de8a603cabdb5f7417c29d5f37a50899485d6d3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3679488
Commit-Queue: Charlie Lao <cclao@google.com>
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
2022-06-01 20:40:43 +00:00
Yuxin Hu 2f0b6429b4 Revert "util/X11Window: Set PMinSize and PMaxSize hints."
This reverts commit a78eca2cab.

Reason for revert: We suspect this CL is causing rendering issues on Linux swiftshader bots: https://bugs.chromium.org/p/angleproject/issues/detail?id=7336. Some trace test only has part of the screen rendered: https://angle-gold.skia.org/detail?test=raid_shadow_legends&digest=a4eb4b3f306f31798c5e86dcf34d0f35. Revert it to check if it helps the resolving the render issues on bots.

Original change's description:
> util/X11Window: Set PMinSize and PMaxSize hints.
>
> Before this patch replay windows were down-sized to match the default
> screen size in case their extent was greater than the screen size.
>
> Setting a PMinSize on XSizeHints resolves the issue on modern window
> managers. Tested with GNOME Shell 41.3 with both native X11 and Wayland
> (over XWayland) backends.
> Setting PMaxSize was also requried to pass the
> BlitFramebufferANGLETest tests.
>
> This fixes retracing with correct extents and resolves a VVL performance
> warning.
>
> Bug: angleproject:6808
> Bug: angleproject:7083
> Change-Id: I00ee149ec02efe08c5801e4231913049d31e262b
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3507514
> Reviewed-by: Cody Northrop <cnorthrop@google.com>
> Reviewed-by: Jamie Madill <jmadill@chromium.org>
> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>

Bug: angleproject:6808
Bug: angleproject:7083
Bug: angleproject:7336
Change-Id: Ibe15e549d1f1965f0c3832190f02144bb63da16a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3661210
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2022-05-24 14:33:27 +00:00
Antonio Caggiano f6c1493397 dEQP: Support Wayland
Improve ANGLE native display factory by supporting creation of a Wayland
native display.

Bug: angleproject:7065
Change-Id: I0882d8666b1d07ced0804b99d1998ca45f4ad73b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3525753
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2022-05-24 02:46:50 +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 <jmadill@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2022-05-20 21:42:34 +00:00
Jamie Madill 3da24b5cd3 Move trace loader code to a common location.
With that Capture/Replay will be able to make use of the same
code.

CL authored by gert.wollny@collabora.com.

Bug: angleproject:4964
Change-Id: Ie1ba663169a34929f5a169ab74c7042e9fd5deb0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3645441
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2022-05-20 15:59:54 +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 <syoussefi@chromium.org>
Commit-Queue: mohan maiya <m.maiya@samsung.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
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 <yuxinhu@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2022-05-15 01:14:23 +00:00
Jamie Madill 389ae6b9ae Add extension for read-only DS feedback loops.
This will facilitate testing. Also moves some feedback loop tests
from FramebufferTest to a specialized test class.

Bug: angleproject:4778
Bug: angleproject:4969
Change-Id: I61235f2663a58644bf506254a869f550f1706de3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3634726
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2022-05-12 16:23:31 +00:00
Gert Wollny 029a4c9483 util: Add calls for createImage* and destroyImage* to GLWindow
This adds the interface to the GLWindowBase, an implementation to
EGLWindow, and placeholder functions to WGLWindow.

Bug: angleproject:4964
Change-Id: Ia13f5237500cece9564910c95c6c5eea67ca022d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3637559
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Gert Wollny <gert.wollny@collabora.com>
2022-05-11 09:00:00 +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 <ynovikov@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
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 <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
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 <geofflang@chromium.org>
> Reviewed-by: Lingfeng Yang <lfy@google.com>
> Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>

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 <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
2022-05-06 18:10:51 +00:00
Lubosz Sarnecki a78eca2cab util/X11Window: Set PMinSize and PMaxSize hints.
Before this patch replay windows were down-sized to match the default
screen size in case their extent was greater than the screen size.

Setting a PMinSize on XSizeHints resolves the issue on modern window
managers. Tested with GNOME Shell 41.3 with both native X11 and Wayland
(over XWayland) backends.
Setting PMaxSize was also requried to pass the
BlitFramebufferANGLETest tests.

This fixes retracing with correct extents and resolves a VVL performance
warning.

Bug: angleproject:6808
Bug: angleproject:7083
Change-Id: I00ee149ec02efe08c5801e4231913049d31e262b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3507514
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
2022-05-06 09:42:52 +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 <geofflang@chromium.org>
Reviewed-by: Lingfeng Yang <lfy@google.com>
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2022-05-05 19:12:31 +00:00
Peter Kasting 2ce60b52a2 Fixes for C++20 support.
* The compiler grew smart enough to warn about value changes due to
  casting to float inside floatToNormalized().  Make it smart enough to
  realize this isn't a problem by using constexpr if.
* Types on both sides of a comparison operator should be the same.
* Structs with user-declared constructors are no longer aggregates.
  Provide a constructor and call it.
* std::result_of<F(x)> is gone, use std::invoke_result<F, x> instead.

Bug: chromium:1284275
Change-Id: I6487bb18c65837a6d7d2661f65e097dc6a7605b6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3630478
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
2022-05-05 18:25:09 +00:00
Antonio Caggiano 9ad43bdd2a Re-land: "Vulkan: Support Wayland"
Implement DisplayVkWayland and WindowSurfaceVkWayland. Get window size
from native window and check egl config is just empty. An EGL wayland
test is added for testing rendering and buffers swapping.

Re-land fixes:
- link failure in systems with no libwayland installed.
- XCB display availability check.

Bug: angleproject:6902
Change-Id: I5daecf3591493308ac71a7dd3bc0802f492e6fed
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3621059
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2022-05-03 16:29:24 +00:00
Yuly Novikov 4bbc55f4cd Revert "Re-land: "Vulkan: Support Wayland""
This reverts commit e0dd196a0e.

Reason for revert: blocks ANGLE roll into Chromium

Original change's description:
> Re-land: "Vulkan: Support Wayland"
>
> Implement DisplayVkWayland and WindowSurfaceVkWayland. Get window size
> from native window and check egl config is just empty. An EGL wayland
> test is added for testing rendering and buffers swapping.
>
> Re-land fixes link failure in systems with no libwayland installed.
>
> Bug: angleproject:6902
> Change-Id: I4f091d4f479a537d0390caedce88a5d39f8b356f
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3608088
> Reviewed-by: Jamie Madill <jmadill@chromium.org>
> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
> Commit-Queue: Jamie Madill <jmadill@chromium.org>

Bug: angleproject:6902, angleproject:7260
Change-Id: I7e92bf811b191eee6679d577006cddc0e1286fad
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3621057
Auto-Submit: Yuly Novikov <ynovikov@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
2022-05-03 09:34:04 +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 <cclao@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
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 <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
2022-05-02 18:47:55 +00:00
Antonio Caggiano e0dd196a0e Re-land: "Vulkan: Support Wayland"
Implement DisplayVkWayland and WindowSurfaceVkWayland. Get window size
from native window and check egl config is just empty. An EGL wayland
test is added for testing rendering and buffers swapping.

Re-land fixes link failure in systems with no libwayland installed.

Bug: angleproject:6902
Change-Id: I4f091d4f479a537d0390caedce88a5d39f8b356f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3608088
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2022-05-02 14:34:11 +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 <jmadill@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
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 <zzyiwei@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2022-04-27 19:47:13 +00:00
Shahbaz Youssefi 7d31a47fc7 Vulkan: Optimize away eglSwapBuffers for single buffer surfaces
For single buffer surfaces, eglSwapBuffers serves two purposes:

- Switch to/from single buffer mode
- Implicitly issue a glFlush

Simultaneously, for single buffer surfaces, glFlush serves three
purposes:

- Submit the commands
- Call queue present (if necessary)
- Throttle the CPU

In this mode, ContextVk::flush() already redirects to the surface,
calling WindowSurfaceVk::swapImpl() which calls back to
ContextVk::flushImpl() (to submit the commands), calls queue present and
throttles the CPU.

If the application calls eglSwapBuffers(), the exact same thing happens
(i.e. WindowSurfaceVk::swapImpl() is called to the same effect).
Calling swapImpl() leads to an addition of the corresponding submit
serial to the "swap history".  The CPU throttling code always throttles
the CPU to the serial of two swaps ago.

Unnecessary calls to eglSwapBuffers() (when there is no command to be
flushed) in single buffer mode would thus lead to the CPU throttled to
the end of the last submission, effectively turning into a glFinish().

In this change, eglSwapBuffers() in single buffer mode, when not
switching to/from this mode, is redirected to glFlush() as it's
functionally equivalent.  Simultaneously, ContextVk now tracks whether
it has any pending commands for submission at all, and skips glFlush()
altogether if there are none.  Together, this results in the unnecessary
eglSwapBuffers() to become no-op.

Bug: b/229908040
Change-Id: I0e3b4a8b7eb4f6b0e0ed22260644825fc67dd330
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3603841
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2022-04-27 17:57:37 +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 <kbr@chromium.org>
Reviewed-by: Kyle Piddington <kpiddington@apple.com>
Commit-Queue: Gregg Tavares <gman@chromium.org>
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 <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: mohan maiya <m.maiya@samsung.com>
2022-04-25 18:24: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 <yuxinhu@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Charlie Lao <cclao@google.com>
2022-04-22 16:20:31 +00:00
Jamie Madill 768c7d47e9 Revert "Re-land: "Vulkan: Support Wayland""
This reverts commit f6cdd02fb4.

Reason for revert: Still warns about extra dependency on wayland.
https://ci.chromium.org/ui/p/chromium/builders/try/linux-rel/990820/overview

Original change's description:
> Re-land: "Vulkan: Support Wayland"
>
> Implement DisplayVkWayland and WindowSurfaceVkWayland. Get window size
> from native window and check egl config is just empty. An EGL wayland
> test is added for testing rendering and buffers swapping.
>
> Re-land fixes link failure in systems with no libwayland installed.
>
> Bug: angleproject:6902
> Change-Id: I706af14620d6298275009f5caf93b0e60339219b
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3578765
> Auto-Submit: Antonio Caggiano <antonio.caggiano@collabora.com>
> Reviewed-by: Jamie Madill <jmadill@chromium.org>
> Commit-Queue: Jamie Madill <jmadill@chromium.org>

Bug: angleproject:6902
Change-Id: I11b1fe473fceb2fddb85bd562b769d18426ce07b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3600378
Auto-Submit: Jamie Madill <jmadill@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2022-04-21 18:26:35 +00:00
Antonio Caggiano f6cdd02fb4 Re-land: "Vulkan: Support Wayland"
Implement DisplayVkWayland and WindowSurfaceVkWayland. Get window size
from native window and check egl config is just empty. An EGL wayland
test is added for testing rendering and buffers swapping.

Re-land fixes link failure in systems with no libwayland installed.

Bug: angleproject:6902
Change-Id: I706af14620d6298275009f5caf93b0e60339219b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3578765
Auto-Submit: Antonio Caggiano <antonio.caggiano@collabora.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2022-04-20 15:56:54 +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 <abdolrashidi@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2022-04-20 05:05:22 +00:00