ENABLE(WEBGL_WEBGPU) build flag and WebGLOnWebGPUEnabled preference
Component: WebGL | 7b5ab04
Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
+WebGLOnWebGPUEnabled:
+ type: bool
+ status: internal
+ humanReadableDescription: "Run WebGL with ANGLE in the Web Process on WebGPU, which runs in the GPU Process"
+ condition: ENABLE(WEBGL_WEBGPU)
+ defaultValue: false
+ disableInLockdownMode: true
+ sharedPreferenceForWebProcess: true
Source/cmake/WebKitFeatures.cmake
+ WEBKIT_OPTION_DEFINE(ENABLE_WEBGL_WEBGPU "Toggle the WebGL implementation that runs ANGLE in the Web Process on its WebGPU backend" PRIVATE OFF)
+ WEBKIT_OPTION_DEPEND(ENABLE_WEBGL_WEBGPU ENABLE_WEBGL)
+ WEBKIT_OPTION_DEPEND(ENABLE_WEBGL_WEBGPU ENABLE_WEBGPU)
현재 WebGL은 일반적으로 GPU Process 안에서 ANGLE을 실행합니다. ANGLE은 GL 호출을 native API로 변환하는 translation layer입니다. 이때 Web Process는 GL command를 IPC로 GPU Process에 전달하는 역할만 담당합니다.
이번 commit은 이 구조를 반대로 나누기 위한 기반 작업입니다. 먼저 ENABLE(WEBGL_WEBGPU) build flag가 추가되었습니다. 기본값은 off이며, WebGL과 WebGPU가 모두 활성화되어 있어야 사용할 수 있습니다. 함께 WebGLOnWebGPUEnabled preference도 추가되었는데, internal 설정이고 기본값은 off입니다. Lockdown Mode에서는 비활성화됩니다. 다만 실제 runtime 코드는 아직 포함되지 않았습니다.
Current: Planned (WEBGL_WEBGPU):
WebContent -> GL cmds (IPC) WebContent -> ANGLE -> WebGPU backend
-> GPU Process -> ANGLE -> Metal -> WebGPU cmds (IPC) -> GPU Process -> Metal
Significance
WebGL의 WebContent-GPU 간 trust boundary가 GL command stream에서 WebGPU command stream으로 옮겨갈 예정. 기존에 GL IPC 표면을 대상으로 tooling을 만들어 둔 연구자라면 이 변화를 눈여겨볼 필요가 있습니다.