Switch from futures-executor to pollster (#84)
This commit is contained in:
parent
b55f75e157
commit
4991d2cddc
|
@ -21,7 +21,7 @@ include = [
|
||||||
[dependencies]
|
[dependencies]
|
||||||
thiserror = "1.0.15"
|
thiserror = "1.0.15"
|
||||||
wgpu = "0.5.0"
|
wgpu = "0.5.0"
|
||||||
futures-executor = "0.3"
|
pollster = "0.2"
|
||||||
ultraviolet = "0.4.6"
|
ultraviolet = "0.4.6"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
|
|
@ -557,7 +557,7 @@ impl<'req> PixelsBuilder<'req> {
|
||||||
/// Returns an error when a [`wgpu::Adapter`] cannot be found.
|
/// Returns an error when a [`wgpu::Adapter`] cannot be found.
|
||||||
pub fn build(self) -> Result<Pixels, Error> {
|
pub fn build(self) -> Result<Pixels, Error> {
|
||||||
// TODO: Use `options.pixel_aspect_ratio` to stretch the scaled texture
|
// TODO: Use `options.pixel_aspect_ratio` to stretch the scaled texture
|
||||||
let adapter = futures_executor::block_on(wgpu::Adapter::request(
|
let adapter = pollster::block_on(wgpu::Adapter::request(
|
||||||
&self
|
&self
|
||||||
.request_adapter_options
|
.request_adapter_options
|
||||||
.unwrap_or(wgpu::RequestAdapterOptions {
|
.unwrap_or(wgpu::RequestAdapterOptions {
|
||||||
|
@ -568,8 +568,7 @@ impl<'req> PixelsBuilder<'req> {
|
||||||
))
|
))
|
||||||
.ok_or(Error::AdapterNotFound)?;
|
.ok_or(Error::AdapterNotFound)?;
|
||||||
|
|
||||||
let (device, queue) =
|
let (device, queue) = pollster::block_on(adapter.request_device(&self.device_descriptor));
|
||||||
futures_executor::block_on(adapter.request_device(&self.device_descriptor));
|
|
||||||
let device = Rc::new(device);
|
let device = Rc::new(device);
|
||||||
let queue = Rc::new(RefCell::new(queue));
|
let queue = Rc::new(RefCell::new(queue));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue