mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Add WebGPU identity management
Issue: https://github.com/servo/servo/issues/24706#issuecomment-557891841
This commit is contained in:
parent
ea32495504
commit
b26598d470
6 changed files with 72 additions and 13 deletions
|
@ -5,6 +5,7 @@
|
|||
use crate::compartments::InCompartment;
|
||||
use crate::dom::bindings::codegen::Bindings::GPUBinding::GPURequestAdapterOptions;
|
||||
use crate::dom::bindings::codegen::Bindings::GPUBinding::{self, GPUMethods, GPUPowerPreference};
|
||||
use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowBinding::WindowMethods;
|
||||
use crate::dom::bindings::error::Error;
|
||||
use crate::dom::bindings::refcounted::{Trusted, TrustedPromise};
|
||||
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
|
||||
|
@ -120,6 +121,7 @@ impl GPUMethods for GPU {
|
|||
Some(GPUPowerPreference::High_performance) => wgpu::PowerPreference::HighPerformance,
|
||||
None => wgpu::PowerPreference::Default,
|
||||
};
|
||||
let id = self.global().as_window().Navigator().create_adapter_id();
|
||||
|
||||
match self.wgpu_channel() {
|
||||
Some(channel) => {
|
||||
|
@ -128,6 +130,7 @@ impl GPUMethods for GPU {
|
|||
.send(WebGPURequest::RequestAdapter(
|
||||
sender,
|
||||
wgpu::RequestAdapterOptions { power_preference },
|
||||
id,
|
||||
))
|
||||
.unwrap();
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue