gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
12.72k stars 933 forks source link

Use a separate context per origin #6582

Closed DemiMarie closed 18 hours ago

DemiMarie commented 20 hours ago

Is your feature request related to a problem? Please describe. The Linux GPU driver developers have stated in no uncertain terms that sharing a GPU context between origins is a browser bug. The GPU context is the unit of security and out of bounds accesses by a shader cannot access or tamper with other contexts.

Describe the solution you'd like WGPU should use a separate context per web origin. This is the GPU equivalent of CPU site isolation.

Describe alternatives you've considered Continue relying on the correctness of shader compilers and Naga-inserted bounds checks.

Additional context See dri-devel IRC archives for more information.

cwfitzgerald commented 18 hours ago

This should be a bugzilla ticket then, this project doesn't control the integration with Firefox, just the actual validation and execution.