Lay groundwork for directly rendering to the canvas without a cpu roundrip (#1291)

* Add Texture handle type

* Add Texture View to shader inputs

* Implement basic rendering pipeline

* Render first texture using render pipeline

* Fix output color space

* Precompute the rendering pipeline

* Move gpu context creation to editor api

* Port gpu-executor nodes to node registry

* Fix canvas nodes and make code compile for non wasm targets

* Pin wasm-bindgen version

* Disable miri temoporarily for better ci times

* Fix formatting

* Remove unsafe block

* Bump wasm-pack version

* Bump wasm-bindgen version

* Add gpu feature guard for push node

* Make Into node async
This commit is contained in:
Dennis Kobert 2023-06-07 17:13:21 +02:00 committed by Keavon Chambers
parent 0c93a62d55
commit 45b04f4eb9
33 changed files with 1574 additions and 339 deletions

View file

@ -6,6 +6,7 @@ pub struct Context {
pub device: Arc<Device>,
pub queue: Arc<Queue>,
pub instance: Arc<Instance>,
pub adapter: Arc<wgpu::Adapter>,
}
impl Context {
@ -16,9 +17,9 @@ impl Context {
// `request_adapter` instantiates the general connection to the GPU
let adapter = instance.request_adapter(&wgpu::RequestAdapterOptions::default()).await?;
let limits = adapter.limits();
//let limits = adapter.limits();
log::trace!("Adapter limits: {:?}", limits);
//log::trace!("Adapter limits: {:?}", limits);
// `request_device` instantiates the feature specific connection to the GPU, defining some parameters,
// `features` being the available features.
@ -27,7 +28,7 @@ impl Context {
&wgpu::DeviceDescriptor {
label: None,
features: wgpu::Features::empty(),
limits,
limits: Default::default(),
},
None,
)
@ -42,6 +43,7 @@ impl Context {
Some(Self {
device: Arc::new(device),
queue: Arc::new(queue),
adapter: Arc::new(adapter),
instance: Arc::new(instance),
})
}