Kaushik already did most of the great work. This patch gets us to a point where
all the playgrounds tests pass and the common performance optimizations are in
place. All known non-compute Impeller features should be implemented. There are
iOS only performance optimizations that haven’t been opted into because these
are behind define guards. These need to be generalized. Without that, the
performance of this backend will lag behind that of the Metal backend but only
because it is not an apples to apples comparison.
The general rubric was to keep the code and concepts as similar to the Metal
backend as possible.
The list of updates, all to the Vulkan Impeller backend:
* MSAA is wired up.
* Depth and stencil attachments and pipeline states are wired up.
* Got rid of Vulkan specific hacks in the inline pass context that were
preventing clips from working.
* Storage modes for both device buffer and texture allocation are respected.
This includes optimal usage of tile memory for device transient attachments.
* Host coherent memory for textures is no longer a requirement with explicit
mapping management and write flushes.
* Texture uploads should be optimized for the UMA case without needing a staging
buffer. That entire pipeline has been reworked.
* Textures track their current layout and ensure they get to the right layout
based on usage without redundant transitions.
* Cube textures are now supported.
* Mipmapping has been reworked to correct image layout errors. With the new
texture layout transition management, blit passes should be a whole lot easier
to read and reason about.
* Allocator allocations are named using Vulkan debug utilities and the allocator
(VMA). Comes in handy when chasing leaks. All of which are chased down.
* Left some handy utilities in there to debug resource leaks after context
shutdown. These are validation errors.
* Debug groups are pushed around render pass command encoding as well as the
entire pass contents. This mimics the behavior of the Metal backend and it
should be easy to map traces using both backends in Xcode and RenderDoc.
* Command buffer submission allows for tracking the life cycles of all resources
referenced in the command stream and ensuring that the objects stay alive till
past the submission of the command buffer. All use-after-free issues due to
this class of issue have been chased down.
* Command pools are now context global instead of being created per pass.
* Descriptor pool are now context global instead of being created per pass.
Individual descriptor types are now reference counted and returned to the pool
when not needed. The pool is still fixed size though (and hence relatively
large).
* All instances of global waitIdle on the device are removed during normal
operation. The only times a waitIdle may happen is during swapchain recreation
and context destruction.
* Swapchain adapt to them going out of date with the underlying surface and
seamlessly resize as necessary on the next drawable acquisition.
* Playgrounds are resizable.
* Pipeline front face and cull modes are respected.
* Clears for all attachments are respected.
* Maximum textures sizes supported on the device are respected instead of
hardcoding the minimum Vulkan requirement.
Fixes https://github.com/flutter/flutter/issues/112388
Fixes https://github.com/flutter/flutter/issues/112648
Fixes https://github.com/flutter/flutter/issues/112647 and a few other issues...
Eliminates an undef of VK_USE_PLATFORM_METAL_EXT that works around some
unguarded `@available` checks for macOS 10.13. Our minimum macOS SDK is
now macOS 10.14 so we can safely assume Metal support since it's a
requirement for macOS 10.14.
Issue: https://github.com/flutter/flutter/issues/114445
Roll Swiftshader, ANGLE, and Vulkan deps.
Updates license bot for new locations of licenses and new files
in roll.
Converts unit test harnesses to use SwANGLE, which is the
supported way of using SwiftShader as a software backend for GLES.
Updates goldens due to swiftshader changes.
Fixes up include paths to avoid directly including third_party
code by that name, which is unlikely to work in other build
environments.
Includes upstream patches to ANGLE and SwiftShader to build in our
windows environments, as well as patches to Skia to support
defining the location of VulkanMemoryAllocator and a patch to ANGLE
to support opting into a newer version of VMA.
This updates Flutter engine to use the upstream FUCHSIA
buffer extension collection. It removes the obsolete
vkSetBufferCollectionConstraints() and replaces it with
vkSetBufferCollectionImageConstraints().
This option will be the default in Skia soon. Per discussion in #26067, let’s be explicit about disabling it for the time being, and we can revisit the flag in the future if desirable.
Corrects uses of setup as a verb to 'set up', leaves noun/noun-phrase
forms of setup as 'setup'. Also settles on 'teardown' as opposed to
tear-down for consistency across the codebase.
A few other minor comment/wording corrections.
The old way of allocating images meant that one would have to make
sure that Scenic and Flutter were using exactly the same pixel
formats. This patch removes the old image allocation and replaces
it with a sysmem API that uses buffer collections instead. This
permits a smooth negotiation of formats between the two systems.
This breaks linting on other targets that include skia headers that do
ifdef checks on SK_VULKAN.
This reverts commit 939c3de58aa3ebeed23221b84883aa7bd7365f2e.
When linting flutter/vulkan/vulkan_window.cc, the call to
GrDirectContext::MakeVulkan is undefined when SK_VULKAN is not defined,
triggering a lint error.
Bug: https://github.com/flutter/flutter/issues/68331
In an upcoming patch, we'll enable enforcement that all FLUTTER_NOLINT
comments include an issue link. This migrates the remaining uses to that
format.
Bug: https://github.com/flutter/flutter/issues/68273
This removes most of the remaining FLUTTER_NOLINT comments and opts
these files back into linter enforcement.
I've filed https://github.com/flutter/flutter/issues/68273 to require
that all FLUTTER_NOLINT comments be followed by a GitHub issue URL
describing the problem to be fixed.
Previously Skia did not require the clients to pass in the usage flags and Skia would just assumed they contained specific ones depending on how the client wrapped the VkImage. Now Skia allows the client to pass in the specific usage flags used so that Skia knows exactly what type of operations are legal without having to guess/assume what the client did.
Also update to set the sample count as well while I'm in here.
Skia is removing the deprecated legacy display setting globals and
associated kLegacyFontHost_InitType. This change replaces all such uses
with default surface properties with no special flags and an unknown
pixel geometry. Flutter never set the associated globals, leaving them
with their initial default values, which were no special flags and
horizontal RGB pixel geometry. The values used here are different but
this change should make no difference as Flutter never mentions
SkFont::kSubpixelAntiAlias to take advantage of the pixel geometry.
Cleans up header order/grouping for consistency: associated header, C/C++ system/standard library headers, library headers, platform-specific #includes.
Adds <cstring> where strlen, memcpy are being used: there are a bunch of places we use them transitively.
Applies linter-required cleanups. Disables linter on one file due to included RapidJson header. See https://github.com/flutter/flutter/issues/65676
This patch does not cover flutter/shell/platform/darwin. There's a separate, slightly more intensive cleanup for those in progress.
This fixes lint errors in the vulkan directory. This might be a little more controversial, but the reason that the lints were failing here was because of an include path problem that I think I solved.
This is part of a larger effort to expose the difference between GrDirectContext,
which runs on the GPU thread and can directly perform operations like uploading
textures, and GrRecordingContext, which can only queue up work to be delivered
to the GrDirectContext later.
Tweak the primary flutter build rule so that fuchsia is more similar to
other platforms in how tests and the shell are built.
Only embedder_unittests and GLFW tests are disabled on Fuchsia now.
TEST: Ran unittests on host/fuchsia; workstation on fuchsia
BUG: fxb/53847, fxb/54056
This is required by some Vulkan 1.0 drivers. For example,
MoltenVK through goldfish ICD when running in the emulator.
Co-authored-by: David Reveman <reveman@google.com>
* Update flutter to use new skia flushing/submit api
This has no functional change, just moving to the new api calls.
* Update vulkan_swapchain.cc
* Update embedder_external_view_embedder.cc