This flush was added as an optimization to handle a specific use case
where many expensive GPU operations (clears and uploads) were queued
without being flushed. The GPU would be idle during these periods.
WaitUntilScheduled forced CPU/GPU synchronization when it was not
needed. We just want to make sure the work is flushed so the GPU can
pick it up later, not synchronize with anything external.
WaitUntilScheduled is used on iOS still because the Chrome waterfall
does not have coverage of iOS performance.
Bug: chromium:1466696
Change-Id: Ia8938eddf5be5ce586a91ad759d1563182176dba
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4717367
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
In old NV drivers, Vulkan pipeline cache will only
generate one single huge cache for one process
shared by all graphics piplines in the same process,
which can be huge.
This is temp solution for nvidia driver cache issue.
after driver version 520. nvidia fix the cache issue.
this might affect second running performance.
Bug: b/258207403
Change-Id: I3ea3e9196ad18fb1cec16c931eb744300d6cfdb9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4713207
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Removing the flush entirely caused performance regressions on a couple
of benchmarks because the GPU became idle waiting for work. Re-add
the flush but with NoWait so there is no CPU/GPU sychronization.
Bug: chromium:1466696, chromium:1467392
Change-Id: I5e2d1ca7b7a4590e3e668d2cd214d09d28c4b085
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4718007
Reviewed-by: Quyen Le <lehoangquyen@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Currently, ANGLE searches in the "module" directory for libvulkan
during init on CrOS. The library doesn't exist at this location
(/opt/google/chrome/libvulkan.so), and we should instead just call
dlopen(libvulkan.so) to search the system library paths.
Bug: b/292249282
Change-Id: I7ab4803fe294e69f0ab8533ebc2fa43e25f189eb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4716242
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Brian Ho <hob@chromium.org>
This change implements two new entry points added for
EGL_ANGLE_external_context_and_surface: glAcquireExternalContextANGLE
and glReleaseExternalContextANGLE.
These functions remove the need to overload eglMakeCurrent for the
purposes of syncing to and from the external context.
Bug: angleproject:5509
Change-Id: I5d46299ee0c8addaef7066914a8a8aacb0ea2c17
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4706027
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Peng Huang <penghuang@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Example:
% out/Android/angle_trace_tests --gtest_filter='*gacha_life' --prepare-only
...
Prepared traces: {'gacha_life'}
Can be used as a setup for running restricted_trace_perf.py
Bug: b/292249127
Change-Id: I901c086a19e1d182c64ec4150ced98c198e21c4d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4711826
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Roman Lavrov <romanl@google.com>
GL_RGBX8_ANGLE is the only format where the upload format is 3-channel
RGB, whilethe download format is 4-channel RGBX. As such, the internal
format corresponding to format+type expects 3-byte input/output. The
format is fixed here for readPixels to output 4 bytes per pixel.
Bug: chromium:1458046
Change-Id: Iec737ed64bade003cfab50dc5f595eb4875e81e4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4706957
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
We would allocate a MTLRenderPassDescriptor for validating an internal
error case only to throw it away immediately afterwards. This happened
on every new render pass.
This allocation/release amounts to about 10% of ANGLE's CPU time when
running Chrome.
Bug: chromium:1466696
Change-Id: I0bbe086c0b8006d2ff15ae57f25b591f791acb60
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4706925
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Some Android devices in the wild were hitting the assert that
maxClipDistances must be greater than 0 if ANGLE_clip_cull_distance
is exposed.
Protect against this by disabling various clip/cull extensions if
they don't meet the requirements for number of distances.
Bug: angleproject:7904
Change-Id: Ic6a5e959437fa7aad5302a12cf8c92d1d18024b2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4706684
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
The PointSizeAboveMaxIsClamped end2end test intends to render a point
with gl_PointSize that is 2x the implementation's max value to test if
this value is clamped correctly. However, when the max gl_PointSize is
large enough, like with AMD drivers, it results in the center of the
point being outside of the viewport which according to the spec can be
discarded.
Update the test to render to a framebuffer, instead of the default
window surface, one large enough to contain a point of implementation
defined max point size.
Bug: angleproject:2113
Test: PointSpritesTest.PointSizeAboveMaxIsClamped*
Change-Id: I724440495bf5a3c93c76cc28109937a56c45f274
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4697681
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
This changes the descriptor binding for the image from
VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE to
VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER for YCbCr source textures and
ensures that the copy pipelines and descriptor sets for YCbCr source
textures are created with the appropriate YCbCr samplers, and use the
`texture()` function instead of `texelFetch()` for YCbCr images.
Bug: angleproject:8252
Change-Id: Ife3e230d3669b275f4e0fab1922d75b6b6c4f8bd
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4675806
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
When running lots of traces, there can be a long pause
when syncing traces to the device.
Add a small update so it is clear that work is happening.
Example output:
I12:21:51.806619Z Syncing 1945_air_force trace (1/238)
I12:21:52.178401Z Syncing 20_minutes_till_dawn trace (2/238)
I12:21:52.463608Z Syncing 2_3_4_player_mini_games trace (3/238)
...
Test: angle_trace_tests
Bug: b/276742336
Change-Id: Id81d69b3fc678cb94c2e683a907c44950ead2117
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4690745
Reviewed-by: Roman Lavrov <romanl@google.com>
Commit-Queue: Cody Northrop <cnorthrop@google.com>
This change performs a copy to an intermediate texture for multiplanar
d3d11 textures before reading from the source texture. This is needed
as we cannot read a plane directly from a multiplanar d3d11 texture.
It also passes the correct format for the plane for multiplanar formats
when initializing the texture instead of getting the format using the
internal format.
We also add a unittest performing glReadPixels for NV12/P010/P016
formats.
Bug: angleproject:7998, chromium:1463924
Change-Id: I9a1708f5a846ace28ac3b6593ea80f1863348333
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4688118
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Auto-Submit: Saifuddin Hitawala <hitawala@chromium.org>
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
We had previously shipped both MSL 2.0 and 2.1 shaders to support
MacOS 10.13 (MSL 2.0 only) while also supporting the stencil blit
fast path that MSL 2.1 provides with the has_shader_stencil_output
feature.
Each configuration of precompiled shaders is ~300kb so we will drop
support for MacOS 10.13 and only ship the MSL 2.1 shaders.
Rework of the disablement for NVIDIA and GPU family 1 to be more
readable. The features themselves are always true because "disable on
NVIDIA" is always true and the check for "is NVIDIA" is moved to the
code which fails the initialization.
Bug: angleproject:8258
Change-Id: Icc8c69540e43fd2b0b237fffbfe170bb3422903f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4681130
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Both OpenGL ES and Vulkan spec allows implementations to limit
the number of output attachments when dual-source blending is enabled.
Account for this limit when setting gl_FragData array length by
re-declaring the gl_FragData array size to match
maxFragmentDualSrcAttachments value.
Bug: angleproject:5537
Test: EXTBlendFuncExtendedDrawTest.FragData/ES2_Vulkan
Change-Id: I5a462344f4c4faf850f56e9c5d4c392370d3d010
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4688396
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: mohan maiya <m.maiya@samsung.com>
Some backends generate a device loss (propagated to all contexts) while
querying the device status. The latter is held under a lock, and the
former would attempt to hold the lock when marking the calling context
with device loss.
Bug: chromium:1465262
Change-Id: I55fd96f3573732953daf2a305b0120dbcae6ea30
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4690063
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
If the underlying driver changes, reject program binaries from the old
versions. The driver is supposed to do this for us (on OpenGL, at
least) but this adds some extra protection.
Bug: angleproject:4981
Change-Id: Id9486d8e6f9136970c0d7c37d59dea5d43b0a50e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4685317
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
If the backend requires that a framebuffer is synchronized before
checking backend completeness, make sure all attachments are
synchronized too.
GL has completeness rules based on GL_BASE_LEVEL and
GL_MAX_LEVEL of texture attachments which are not syncrhonized until
the textures are. If they are left un-sychronized during completeness
checks, the driver will tell us that the framebuffer isn't complete.
Bug: chromium:1455725
Change-Id: I7c3bf6a38f63feaa863f4d8914c3655e286dd768
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4678286
Reviewed-by: Brian Ho <hob@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
This ensures that any resources that were partially initialized are
cleaned up.
This is a speculative fix for dual GPU macs not falling back to the
low power GPU. DisplayMtl leaks the metal device if it fails to
initialize due to unsupported GPU families or vendors.
Bug: chromium:1322521
Change-Id: I93930de8c07bb94318ac41c67513a3b1c8bd3bf0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4681842
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
This test uses narrow range encoding (as can be seen from the
color value for black) but the Cr component for red is greater
than 240. On some platforms with different clamping logic the
output color after conversion ends up not being red. Update the
input colors to account for different implementations.
Bug: b/210526871
Test: ImageTestES3.SourceYUVAHBTargetExternalYUVSampleLinearFiltering*
Change-Id: Ib9b76c9433b07f5ce8a129779e77bc682bb341ac
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4684018
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Per-channel write operations to shared exponent
color buffers are loosely defined and may cause
driver validation errors.
Restricted the set of allowed color writemasks
for RGB9_E5 color buffers so that RGB channels
must be either all enabled or all disabled.
Added a Metal-specific adjustment to ignore
alpha writemask for RGB9_E5 color buffers.
Removed an unused function from
RenderPipelineColorAttachmentDesc.
Bug: angleproject:8043
Change-Id: I902c3b70ddc6d8e65069d98a4a02a82122f413a5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4685566
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Right now the tracking of depth stencil buffer readOnly or feedback loop
is in FramebufferVk class. This really belongs to ContextVk, since it is
not a permanent state of framebuffer, but current state of context. This
CL moves it to ContextVk and changes to use BitSet instead of four
boolean.
Bug: b/289436017
Change-Id: I955c439259935f82eff30ddfff776a69723e5d0d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4679886
Commit-Queue: Charlie Lao <cclao@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
This is first clean up effort for depth stencil feedback loop
implementation. This CL moves updateRenderPassStencilReadOnlyMode and
updateRenderPassDepthReadOnlyMode methods from FramebufferVk to
RenderPassCommandBufferHelper class. The method is actually updating
renderPass's state, not FramebufferVk's state. In the next CL,
FramebufferVk will be removed from the argument as well. With this
change, I also removes updateStartedRenderPassWithDepthMode() and
updateStartedRenderPassWithStencilMode() to use
updateStartedRenderPassWithDepthStencilMode() directly.
This CL is mechanical changes only, no behavior chnage is expected.
Bug: b/289436017
Change-Id: Id3960f973a7115c05ebea199cb8ef802e995941a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4679365
Commit-Queue: Charlie Lao <cclao@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
... by removing it altogether. This macro was only available when
features.h was included. If that header was not included, the
preprocessor would automatically consider it 0, which has the opposite
effect from what was desired.
Bug: angleproject:8256
Change-Id: Ia141573c0c8b44eef1388f4c3ec73ef770cd2854
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4685226
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
The WorkerPool was created on the first postTask and could create
a number of threads. We were seeing this on blink for iOS where
we would have expected using the delegate's worker pool. However
ANGLE_ENABLED was undefined because it wasn't included. This
caused the comparison of ANGLE_DELEGATE_WORKERS to not work.
Instead of including the header for ANGLE_ENABLED since that would
cause a dependency on libAngle, just use #if X instead, while
this also isn't the best because X can be undefined its a solution
for now.
Bug: angleproject:8256
Change-Id: I5aeb686dcc117feaba884cdea5c89e4b146cb57f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4679894
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>