commit | 4e84b17d8db5dac18174d3e011f6e2be1a663521 | [log] [tgz] |
---|---|---|
author | Brian Ho <hob@chromium.org> | Fri Oct 18 23:09:52 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Fri Oct 18 23:09:52 2019 |
tree | 835effd2f95567f8b2537d0ce30f10fd8d43889b | |
parent | 5ac8eab20013d1570443f6a5e9c3baad3950c250 [diff] |
gpu: Add a flag for specifying the GrContext type Currently, setting the use-vulkan flag both initializes Vulkan and enables Vulkan compositing/raster. WebGPU-on-Linux sets the use-vulkan flag so it can use Vulkan for rendering, but it also requires a bunch of other flags [1] despite having no dependencies on other Vulkan efforts. As such, we would like to be able to decouple WebGPU's development from that of the larger Vulkan-on-Chrome effort. The core issue is that while use-vulkan initializes the VkInstance, it also sets the |vulkan_context_provider| [2] for the GrContext. Vulkan Chrome codepaths then check for the existence of the |vulkan_context_provider| to decide whether the GrContext is Vulkan and thus, enable Vulkan compositing/raster. This CL adds a new gr-context-type flag so the type of the GrContext can be explicitly set instead of implied via the existence of |vulkan_context_provider| and |metal_context_provider|. For WebGPU, we can simply set --use-vulkan=true and --gr-context-type=gl to get the VkInstance without any side effects. [1] https://bugs.chromium.org/p/chromium/issues/detail?id=976495#c21 [2] https://cs.chromium.org/chromium/src/gpu/command_buffer/service/shared_context_state.h?l=69&rcl=b405097b146118b345e2802b20d7df5d9a5ea908 BUG=996470,976495,1009029 TEST=unit tests and ran chrome with various permutations of the Vulkan flags Change-Id: I49cf84c65f58044446eadffabdaef7ab4db517d5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829863 Commit-Queue: Brian Ho <hob@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Reviewed-by: Greg Kerr <kerrnel@chromium.org> Reviewed-by: Ben Pastene <bpastene@chromium.org> Reviewed-by: Jonathan Ross <jonross@chromium.org> Reviewed-by: Eric Karl <ericrk@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Cr-Commit-Position: refs/heads/master@{#707579}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .