mirror of
https://github.com/sotrh/learn-wgpu.git
synced 2024-11-10 01:10:28 +00:00
.. | ||
README.md |
News
Updating to 0.4 from 0.3
There are a few things that have changed:
- The use of
Instance
has been removed. Creating aSurface
and requesting anAdapter
are done as follows.
let surface = wgpu::Surface::create(window);
let adapter = wgpu::Adapter::request(&wgpu::RequestAdapterOptions {
..Default::default()
}).unwrap(); // needs to be unwrapped
- The
request_device
method now returns a(Device, Queue)
tuple. This means that you can borrow theQueue
mutably while using theDevice
immutably. Because of this change, submittingCommandBuffer
s to the queue uses thesubmit
method on theQueue
directly.
self.queue.submit(&[
encoder.finish()
]);
- The
create
method onSurface
takes in any struct that implements theHasRawWindow
trait, instead of aRawWindowHandle
. This means that theraw-window-handle = "0.3"
line inCargo.toml
is no longer needed.
I don't know if this is a change from 0.4, but you use wgpu = "0.4"
line in dependencies instead of the [dependencies.wgpu]
as wgpu will determine the best back end for you.