mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-24 10:28:12 +08:00
Desktop: Execute editor and node graph natively (#2955)
* Desktop: Execute editor and node graph natively * Remove decouple execution feature * Disable feature gate for native communication functions * Avoid ininite message loop on an infinite canvas * Add any lint exception * Build evaluation loop * Fix texture passing message * Cleanup * More cleanup --------- Co-authored-by: Timon Schelling <me@timon.zip>
This commit is contained in:
co-authored by
Timon Schelling
parent
07802204f2
commit
08ec1d08f6
+1
-40
@@ -56,46 +56,7 @@ pub(crate) enum FrameBufferError {
|
||||
InvalidSize { buffer_size: usize, expected_size: usize, width: usize, height: usize },
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub(crate) struct WgpuContext {
|
||||
pub(crate) device: wgpu::Device,
|
||||
pub(crate) queue: wgpu::Queue,
|
||||
adapter: wgpu::Adapter,
|
||||
instance: wgpu::Instance,
|
||||
}
|
||||
|
||||
impl WgpuContext {
|
||||
pub(crate) async fn new() -> Self {
|
||||
let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor {
|
||||
backends: wgpu::Backends::PRIMARY,
|
||||
..Default::default()
|
||||
});
|
||||
|
||||
let adapter = instance
|
||||
.request_adapter(&wgpu::RequestAdapterOptions {
|
||||
power_preference: wgpu::PowerPreference::default(),
|
||||
compatible_surface: None,
|
||||
force_fallback_adapter: false,
|
||||
})
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let required_limits = adapter.limits();
|
||||
|
||||
let (device, queue) = adapter
|
||||
.request_device(&wgpu::DeviceDescriptor {
|
||||
label: None,
|
||||
required_features: wgpu::Features::PUSH_CONSTANTS,
|
||||
required_limits,
|
||||
memory_hints: Default::default(),
|
||||
trace: wgpu::Trace::Off,
|
||||
})
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
Self { device, queue, adapter, instance }
|
||||
}
|
||||
}
|
||||
pub use wgpu_executor::Context as WgpuContext;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct GraphicsState {
|
||||
|
||||
Reference in New Issue
Block a user