Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibGfx+LibWeb: Add support for Vulkan EGL contexts #3245

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ADKaster
Copy link
Member

This almost works(?) but fails like so to actually open the WebGL context on https://twgljs.org/examples/primitives.html:

INFO: EGL ERROR: : Internal Vulkan error (-1000158000): Unknown vulkan error code, in ../../src/libANGLE/renderer/vulkan/vk_helpers.cpp, initExternal:6342.
VERIFICATION FAILED: egl_image != EGL_NO_IMAGE_KHR at /home/andrew/ladybird-org/ladybird-browser/Libraries/LibWeb/WebGL/OpenGLContext.cpp:209

Where -1000158000 is VK_ERROR_INVALID_EXTERNAL_HANDLE.

In order to test this, I needed to get my own local checkout of angle and set LD_LIBRARY_PATH. The vcpkg provided build segfaults in eglInitialize on my AMD GPU system.

The steps for that are as follows:

  1. clone depot_tools git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
  2. I added a function to temporarily prepend depot_tools to my path to my bashrc:
with_depot() {
  PATH=/home/andrew/ladybird-org/depot_tools:$PATH $@
}

exact path varies

  1. clone angle using gclient:
cd ..
mkdir angle
cd angle
with_depot fetch angle
  1. configure angle to use vulkan and skip a few heavy deps:
with_depot gn gen out/Debug
with_depot gn args out/Debug
<paste the following args.gn into the editor>

args.gn

# Set build arguments here. See `gn help buildargs`.

angle_build_tests = false
angle_enable_swiftshader = false
angle_enable_vulkan = true
angle_enable_wgpu = false
angle_expose_non_conformant_extensions_and_versions = true
  1. build angle
with_depot ninja -C out/Debug
  1. Run ladybird with custom angle
LD_LIBRARY_PATH=$PWD/../angle/out/Debug ./Build/release/bin/Ladybird https://twgljs.org/examples/primitives.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant