mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-21 22:28:11 +08:00
Make hue saturation node work on the gpu + make f32 default for user inputs
This commit is contained in:
committed by
Keavon Chambers
parent
fea9f8ea24
commit
4abad688a2
@@ -7,6 +7,7 @@ license = "MIT OR Apache-2.0"
|
||||
[features]
|
||||
default = []
|
||||
profiling = ["nvtx"]
|
||||
passthrough = []
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
|
||||
@@ -19,17 +19,16 @@ impl Context {
|
||||
// `request_adapter` instantiates the general connection to the GPU
|
||||
let adapter = instance.request_adapter(&wgpu::RequestAdapterOptions::default()).await?;
|
||||
|
||||
//let limits = adapter.limits();
|
||||
|
||||
//log::trace!("Adapter limits: {:?}", limits);
|
||||
|
||||
// `request_device` instantiates the feature specific connection to the GPU, defining some parameters,
|
||||
// `features` being the available features.
|
||||
let (device, queue) = adapter
|
||||
.request_device(
|
||||
&wgpu::DeviceDescriptor {
|
||||
label: None,
|
||||
#[cfg(not(feature = "passthrough"))]
|
||||
features: wgpu::Features::empty(),
|
||||
#[cfg(feature = "passthrough")]
|
||||
features: wgpu::Features::SPIRV_SHADER_PASSTHROUGH,
|
||||
limits: Default::default(),
|
||||
},
|
||||
None,
|
||||
|
||||
@@ -118,10 +118,18 @@ impl gpu_executor::GpuExecutor for WgpuExecutor {
|
||||
type Window = Arc<winit::window::Window>;
|
||||
|
||||
fn load_shader(&self, shader: Shader) -> Result<Self::ShaderHandle> {
|
||||
#[cfg(not(feature = "passthrough"))]
|
||||
let shader_module = self.context.device.create_shader_module(wgpu::ShaderModuleDescriptor {
|
||||
label: Some(shader.name),
|
||||
source: wgpu::ShaderSource::SpirV(shader.source),
|
||||
});
|
||||
#[cfg(feature = "passthrough")]
|
||||
let shader_module = unsafe {
|
||||
self.context.device.create_shader_module_spirv(&wgpu::ShaderModuleDescriptorSpirV {
|
||||
label: Some(shader.name),
|
||||
source: shader.source,
|
||||
})
|
||||
};
|
||||
Ok(ShaderModuleWrapper(shader_module))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user