Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only start WebGPU thread if an adapter is requested #25030

Merged
merged 2 commits into from Jan 13, 2020
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Fix returned error types in WebGPU

  • Loading branch information
zakorgy committed Jan 13, 2020
commit 430248e9c819c0889811c2d25ba1ebad5d00f745
@@ -132,9 +132,7 @@ impl GPUMethods for GPU {
))
.is_err()
{
promise.reject_error(Error::Type(
"Failed to send adapter request to constellation...".to_owned(),
));
promise.reject_error(Error::Operation);
}
promise
}
@@ -153,10 +151,7 @@ impl AsyncWGPUListener for GPU {
);
promise.resolve_native(&adapter);
},
response => promise.reject_error(Error::Type(format!(
"Wrong response received for GPU from WebGPU thread {:?}",
response,
))),
_ => promise.reject_error(Error::Operation),
}
}
}
@@ -102,12 +102,10 @@ impl GPUAdapterMethods for GPUAdapter {
.send(WebGPURequest::RequestDevice(sender, self.adapter, desc, id))
.is_err()
{
promise.reject_error(Error::Type(
"Failed to send RequestDevice message...".to_owned(),
));
promise.reject_error(Error::Operation);
}
} else {
promise.reject_error(Error::Type("No WebGPU thread...".to_owned()))
promise.reject_error(Error::Operation);
};
promise
}
@@ -127,9 +125,7 @@ impl AsyncWGPUListener for GPUAdapter {
);
promise.resolve_native(&device);
},
_ => promise.reject_error(Error::Type(
"Wrong response type from WebGPU thread...".to_owned(),
)),
_ => promise.reject_error(Error::Operation),
}
}
}
@@ -180,7 +180,7 @@ impl GPUDeviceMethods for GPUDevice {
id,
wgpu_descriptor,
))
.unwrap();
.expect("Failed to create WebGPU buffer");
} else {
unimplemented!()
};
@@ -218,7 +218,7 @@ impl GPUDeviceMethods for GPUDevice {
id,
wgpu_descriptor.clone(),
))
.unwrap()
.expect("Failed to create WebGPU buffer");
} else {
return vec![js_val.get()];
};
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.