mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Fixing some style related issues in WebGPU.
Changed the Requests/Response from tuples to named struct variants and also sorted in alphabetical order. Replaced the ID generator functions from `globalscope` with a single function, which returns a `RefMut` and can call the appropriate method to generate resource IDs.
This commit is contained in:
parent
0f9b04680a
commit
000a5d543d
10 changed files with 561 additions and 472 deletions
|
@ -115,7 +115,7 @@ impl GPUMethods for GPU {
|
|||
},
|
||||
None => wgpu::instance::PowerPreference::Default,
|
||||
};
|
||||
let ids = global.wgpu_create_adapter_ids();
|
||||
let ids = global.wgpu_id_hub().create_adapter_ids();
|
||||
|
||||
let script_to_constellation_chan = global.script_to_constellation_chan();
|
||||
if script_to_constellation_chan
|
||||
|
@ -135,13 +135,17 @@ impl GPUMethods for GPU {
|
|||
impl AsyncWGPUListener for GPU {
|
||||
fn handle_response(&self, response: WebGPUResponse, promise: &Rc<Promise>) {
|
||||
match response {
|
||||
WebGPUResponse::RequestAdapter(name, adapter, channel) => {
|
||||
WebGPUResponse::RequestAdapter {
|
||||
adapter_name,
|
||||
adapter_id,
|
||||
channel,
|
||||
} => {
|
||||
let adapter = GPUAdapter::new(
|
||||
&self.global(),
|
||||
channel,
|
||||
DOMString::from(format!("{} ({:?})", name, adapter.0.backend())),
|
||||
DOMString::from(format!("{} ({:?})", adapter_name, adapter_id.0.backend())),
|
||||
Heap::default(),
|
||||
adapter,
|
||||
adapter_id,
|
||||
);
|
||||
promise.resolve_native(&adapter);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue