Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@dnfield
Copy link
Contributor

@dnfield dnfield commented Jun 3, 2022

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.

fixes flutter/flutter#90425

@flutter-dashboard flutter-dashboard bot added the embedder Related to the embedder API label Jun 3, 2022
RunEngineBenchmarks(build_dir, engine_filter)

variants_to_skip = ['host_release', 'host_profile']
<<<<<<< HEAD
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad merge.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doh

TestGLSurface::TestGLSurface(SkISize surface_size)
: surface_size_(surface_size) {
display_ = ::eglGetDisplay(EGL_DEFAULT_DISPLAY);
PFNEGLGETPLATFORMDISPLAYEXTPROC egl_get_platform_display_EXT =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In GL and EGL, that the proc address is available doesn't mean that the extension is available as well. Please perform an extensions check for EGL_EXT_platform_base perhaps and also for any Angle specific extensions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do

};

display_ = egl_get_platform_display_EXT(
EGL_PLATFORM_ANGLE_ANGLE, reinterpret_cast<void*>(EGL_DEFAULT_DISPLAY),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this actually work? I would have expected this to be ::eglGetDisplay(EGL_DEFAULT_DISPLAY)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. But maybe it's cheating? I can use the get display call

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the ANGLE folks this is actually expected behavior - the eglGetPlatformDisplayEXT call expects a native display pointer, which is not what is returned by eglGetDisplay.

@dnfield
Copy link
Contributor Author

dnfield commented Jun 9, 2022

Most recent issues:

  • Linux tests appear to be failing due to eglInitialize failing on the SwANGLE display.
  • ANGLE depends on the Fuchsia GN SDK, and hard codes its location. We don't have that. I'm thinking we don't need this for Fuchsia though, so going to see if I can just exclude ANGLE on Fuchsia for now.

@jason-simmons
Copy link
Member

I was able to run embedder_unittests on Linux with this patch by configuring ANGLE to use a headless display.

In flutter/tools/gn set:
gn_args['angle_vulkan_display_mode'] = 'headless'

@dnfield
Copy link
Contributor Author

dnfield commented Jun 10, 2022

I was able to run embedder_unittests on Linux with this patch by configuring ANGLE to use a headless display.

In flutter/tools/gn set: gn_args['angle_vulkan_display_mode'] = 'headless'

So I had just tried the same and it's working, but something is still off with the way the test script runs from exe.unstrippes

@dnfield
Copy link
Contributor Author

dnfield commented Jun 10, 2022

I think we probably also have to make that only happen for tests somehow. I can achieve the same with extensions in the test display setup, I think

@jason-simmons
Copy link
Member

ANGLE and the Vulkan loader depend on directory paths and configuration files.

To run embedder_unittests from exe.unstripped:

  • symlink libvulkan.so.1 into exe.unstripped
  • in the environment, set VK_DRIVER_FILES=/path/to/engine/src/out/host_debug_unopt/vk_swiftshader_icd.json

libvulkan.so.1 must be in the same directory as the embedder_unittests executable because ANGLE is configured to build with ANGLE_USE_CUSTOM_LIBVULKAN. Alternatively ANGLE could be built with other settings that will search the system library paths.

@dnfield
Copy link
Contributor Author

dnfield commented Jun 10, 2022

Yeah ANGLE is trying to load this from the module directory. I tried af ew different options to get it to load from the system but that didn't make things better. I finally went with just symlinking the files.

I'm making the test display config specifically request headless rather than configuring angle for headless - just in case we want to use this outside of headless test contexts at some point and don't want to be confused about it.

@dnfield
Copy link
Contributor Author

dnfield commented Jun 21, 2022

Landed and updated the buildroot dep.

@dnfield dnfield changed the title swiftshader roll, swangle, update tests, still needs work Roll SwiftShader, ANGLE, use SwANGLE in test harnesses Jun 21, 2022
@skia-gold
Copy link

Gold has detected about 1 new digest(s) on patchset 49.
View them at https://flutter-engine-gold.skia.org/cl/github/33814

@skia-gold
Copy link

Gold has detected about 2 new digest(s) on patchset 50.
View them at https://flutter-engine-gold.skia.org/cl/github/33814

@dnfield dnfield added autosubmit Merge PR when tree becomes green via auto submit App and removed needs tests labels Jun 23, 2022
@skia-gold
Copy link

Gold has detected about 2 new digest(s) on patchset 51.
View them at https://flutter-engine-gold.skia.org/cl/github/33814

@auto-submit
Copy link
Contributor

auto-submit bot commented Jun 23, 2022

  • This commit is not mergeable and has conflicts. Please rebase your PR and fix all the conflicts.

1 similar comment
@auto-submit
Copy link
Contributor

auto-submit bot commented Jun 23, 2022

  • This commit is not mergeable and has conflicts. Please rebase your PR and fix all the conflicts.

@skia-gold
Copy link

Gold has detected about 1 new digest(s) on patchset 55.
View them at https://flutter-engine-gold.skia.org/cl/github/33814

@dnfield
Copy link
Contributor Author

dnfield commented Jun 23, 2022

I'm going to land this on red if the only failure is the currently failing Android test.

I'm doing this because bots keep overwriting the license hash on me and making it difficult to get this landed, and this patch can't be affecting android tests.

deps = [
"//flutter/shell/platform/embedder:embedder",
"//third_party/glfw",
"//third_party/vulkan-deps/vulkan-headers/src:vulkan_headers",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like after this landed, my gn would complain

ERROR at //flutter/examples/vulkan_glfw/BUILD.gn:15:5: Can't load input file.
    "//third_party/vulkan-deps/vulkan-headers/src:vulkan_headers",

I looked under third_party and couldn't find a folder vulkan-deps. Maybe I am missing anything, would be great if someone can instruct on how I can resolve this error? Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to gclient sync again.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that was faaaaaassssst, thanks a lot Dan!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App embedder Related to the embedder API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use SwANGLE (OpenGL on SwiftShader Vulkan) instead of SwiftShader OpenGL in the unit-tests harnesses.

6 participants